2022-09-09 17:18:04 +00:00
|
|
|
import i18n from 'i18next';
|
|
|
|
import LanguageDetector from 'i18next-browser-languagedetector';
|
|
|
|
import { initReactI18next } from 'react-i18next';
|
2022-04-05 14:25:53 +00:00
|
|
|
import HttpApi from 'i18next-http-backend';
|
|
|
|
|
2022-07-17 20:42:29 +00:00
|
|
|
// import translationEN from "../../static/locales/en.json";
|
|
|
|
// import translationES from "../../static/locales/es.json";
|
|
|
|
// import translationDE from "../../static/locales/de.json";
|
|
|
|
// import translationRU from "../../static/locales/ru.json";
|
|
|
|
// // import translationZH from "../../static/locales/zh.json";
|
|
|
|
// import translationPL from "../../static/locales/pl.json";
|
|
|
|
// import translationFR from "../../static/locales/fr.json";
|
|
|
|
// import translationCA from "../../static/locales/ca.json";
|
|
|
|
// import translationIT from "../../static/locales/it.json";
|
|
|
|
// import translationPT from "../../static/locales/pt.json";
|
2022-08-03 12:43:28 +00:00
|
|
|
// import translationEU from "../../static/locales/th.json";
|
2022-04-05 14:25:53 +00:00
|
|
|
|
|
|
|
i18n
|
|
|
|
.use(HttpApi)
|
|
|
|
.use(LanguageDetector)
|
|
|
|
.use(initReactI18next)
|
|
|
|
.init({
|
2022-09-09 17:18:04 +00:00
|
|
|
// resources: {
|
|
|
|
// en: {translations: translationEN},
|
|
|
|
// es: {translations: translationES},
|
|
|
|
// ru: {translations: translationRU},
|
|
|
|
// de: {translations: translationDE},
|
|
|
|
// // zh: {translations: translationZH},
|
|
|
|
// pl: {translations: translationPL},
|
|
|
|
// fr: {translations: translationFR},
|
|
|
|
// ca: {translations: translationCA},
|
|
|
|
// it: {translations: translationIT},
|
|
|
|
// pt: {translations: translationPT},
|
|
|
|
// eu: {translations: translationEU},
|
|
|
|
// sv: {translations: translationSV},
|
|
|
|
// cs: {translations: translationCS},
|
|
|
|
// th: {translations: translationCS},
|
|
|
|
// },
|
2022-07-17 20:42:29 +00:00
|
|
|
|
2022-09-09 17:18:04 +00:00
|
|
|
backend: {
|
|
|
|
loadPath: '/static/locales/{{lng}}.json',
|
|
|
|
allowMultiLoading: false, // set loadPath: '/locales/resources.json?lng={{lng}}&ns={{ns}}' to adapt to multiLoading
|
|
|
|
crossDomain: false,
|
|
|
|
withCredentials: false,
|
|
|
|
overrideMimeType: false,
|
|
|
|
reloadInterval: false, // can be used to reload resources in a specific interval (useful in server environments)
|
|
|
|
},
|
2022-04-05 14:25:53 +00:00
|
|
|
|
2022-09-09 17:18:04 +00:00
|
|
|
fallbackLng: 'en',
|
|
|
|
debug: false,
|
2022-04-05 14:25:53 +00:00
|
|
|
|
2022-09-09 17:18:04 +00:00
|
|
|
// have a common namespace used around the full app
|
|
|
|
ns: ['translations'],
|
|
|
|
defaultNS: 'translations',
|
2022-04-05 14:25:53 +00:00
|
|
|
|
2022-09-09 17:18:04 +00:00
|
|
|
keySeparator: false, // we use content as keys
|
2022-04-05 14:25:53 +00:00
|
|
|
|
2022-09-09 17:18:04 +00:00
|
|
|
interpolation: {
|
|
|
|
escapeValue: false,
|
|
|
|
formatSeparator: ',',
|
|
|
|
},
|
|
|
|
|
|
|
|
react: {
|
|
|
|
useSuspense: false,
|
|
|
|
},
|
|
|
|
});
|
|
|
|
|
|
|
|
export default i18n;
|