UNPKG

@maherunlocker/custom-react-table

Version:
38 lines 1.38 kB
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); const i18next_1 = __importDefault(require("i18next")); const translation_json_1 = __importDefault(require("./locales/en/translation.json")); const translation_json_2 = __importDefault(require("./locales/fr/translation.json")); // the translations const resources = { en: { translation: translation_json_1.default, }, fr: { translation: translation_json_2.default, }, }; const initLanguage = localStorage.getItem('i18nextLng'); const lng = initLanguage === null || initLanguage === void 0 ? void 0 : initLanguage.slice(0, 2); console.log('🚀 ~ file: i18n.js ~ line 17 ~ lng', lng); // Note that we are using createInstance here const i18nConfig = i18next_1.default.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, t) => { if (err) return console.log(err); }); exports.default = i18nConfig; //# sourceMappingURL=i18n.js.map