UNPKG

demo-lenguaje-2

Version:
16 lines (12 loc) 443 B
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;