@aures/custom-react-table
Version:
dynamic table based on react table v7
32 lines • 996 B
JavaScript
import i18next from 'i18next';
import translationEN from './locales/en/translation.json';
import translationFR from './locales/fr/translation.json';
// the translations
const resources = {
en: {
translation: translationEN,
},
fr: {
translation: translationFR,
},
};
const initLanguage = localStorage.getItem('i18nextLng');
const lng = initLanguage === null || initLanguage === void 0 ? void 0 : initLanguage.slice(0, 2);
// Note that we are using createInstance here
const i18nConfig = i18next.createInstance({
lng: 'en',
fallbackLng: 'fr',
keySeparator: false,
ns: ['translation'],
defaultNS: 'translation',
react: { useSuspense: true },
interpolation: { escapeValue: false },
resources,
},
// We must provide a function as second parameter, otherwise i18next errors
(err) => {
if (err)
return; // console.log(err.message);
});
export default i18nConfig;
//# sourceMappingURL=i18n.js.map