react-i18nify
Version:
Simple i18n translation and localization components and helpers for React.
21 lines • 469 B
JavaScript
import PropTypes from 'prop-types';
import translate from '../lib/translate';
import BaseComponent from './Base';
class Translate extends BaseComponent {
render() {
const {
value,
locale,
...otherProps
} = this.props;
const translation = translate(value, otherProps, {
locale
});
return translation;
}
}
Translate.propTypes = {
value: PropTypes.string.isRequired,
locale: PropTypes.string
};
export default Translate;