demo-lenguaje-2
Version:
A React component that sums two number.
16 lines (12 loc) • 443 B
JavaScript
import PropTypes from "prop-types";
import i18n from "./i18n";
import Translation from "./translation";
const withTranslation = (props, mainT) => {
const { ...propsFrom } = props;
i18n.options.backend.loadPath = `${propsFrom.languageURL}/locales/{{lng}}/{{ns}}.json`;
return Translation({ propsFrom, i18n, mainT });
};
withTranslation.propTypes = {
mainT: PropTypes.func.isRequired
};
export default withTranslation;