react-i18nify
Version:
Simple i18n translation and localization components and helpers for React.
20 lines (15 loc) • 437 B
JSX
import PropTypes from 'prop-types';
import { translate } from './core';
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;