2022-04-05 14:25:53 +00:00
|
|
|
import i18n from "i18next";
|
|
|
|
import LanguageDetector from "i18next-browser-languagedetector";
|
|
|
|
import { initReactI18next } from "react-i18next";
|
|
|
|
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";
|
|
|
|
// import translationEU from "../../static/locales/eu.json";
|
2022-07-27 07:39:25 +00:00
|
|
|
// import translationSV from "../../static/locales/sv.json";
|
|
|
|
// import translationCS from "../../static/locales/cs.json";
|
2022-04-05 14:25:53 +00:00
|
|
|
|
|
|
|
i18n
|
|
|
|
.use(HttpApi)
|
|
|
|
.use(LanguageDetector)
|
|
|
|
.use(initReactI18next)
|
|
|
|
.init({
|
2022-07-17 20:42:29 +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},
|
2022-07-17 20:52:31 +00:00
|
|
|
// sv: {translations: translationSV},
|
2022-07-27 07:39:25 +00:00
|
|
|
// cs: {translations: translationCS},
|
2022-07-17 20:42:29 +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
|
|
|
fallbackLng: "en",
|
2022-04-17 19:14:22 +00:00
|
|
|
debug: false,
|
2022-04-05 14:25:53 +00:00
|
|
|
|
|
|
|
// have a common namespace used around the full app
|
|
|
|
ns: ["translations"],
|
|
|
|
defaultNS: "translations",
|
|
|
|
|
|
|
|
keySeparator: false, // we use content as keys
|
|
|
|
|
|
|
|
interpolation: {
|
|
|
|
escapeValue: false,
|
|
|
|
formatSeparator: ","
|
|
|
|
},
|
2022-04-10 15:11:11 +00:00
|
|
|
|
2022-04-05 14:25:53 +00:00
|
|
|
react: {
|
|
|
|
useSuspense: false,
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
export default i18n;
|