2022-01-21 19:05:46 +07:00
|
|
|
import i18n from "i18next";
|
|
|
|
import LanguageDetector from "i18next-browser-languagedetector";
|
|
|
|
import XHR from "i18next-http-backend";
|
|
|
|
import { initReactI18next } from "react-i18next";
|
|
|
|
|
2022-04-01 17:25:30 +07:00
|
|
|
import langDe from "@i18n/locales/de.json";
|
2022-01-21 19:05:46 +07:00
|
|
|
import langEn from "@i18n/locales/en.json";
|
|
|
|
import langEs from "@i18n/locales/es.json";
|
|
|
|
|
|
|
|
const resources = {
|
|
|
|
en: langEn,
|
|
|
|
es: langEs,
|
2022-04-01 17:25:30 +07:00
|
|
|
de: langDe,
|
2022-01-21 19:05:46 +07:00
|
|
|
};
|
|
|
|
|
|
|
|
const options = {
|
|
|
|
order: ["querystring", "navigator"],
|
|
|
|
lookupQuerystring: "lng",
|
|
|
|
};
|
|
|
|
|
|
|
|
i18n.use(XHR)
|
|
|
|
.use(LanguageDetector)
|
|
|
|
.use(initReactI18next)
|
|
|
|
.init({
|
|
|
|
detection: options,
|
|
|
|
resources,
|
|
|
|
ns: [""],
|
|
|
|
defaultNS: "",
|
|
|
|
fallbackLng: "en",
|
2022-04-01 17:25:30 +07:00
|
|
|
supportedLngs: ["en", "es", "de"],
|
2022-01-21 19:05:46 +07:00
|
|
|
interpolation: {
|
|
|
|
escapeValue: false,
|
|
|
|
},
|
|
|
|
debug: false,
|
|
|
|
});
|
|
|
|
|
|
|
|
export default i18n;
|