mirror of
https://github.com/0rangebananaspy/authelia.git
synced 2024-09-14 22:47:21 +07:00
36 lines
774 B
TypeScript
36 lines
774 B
TypeScript
|
import i18n from "i18next";
|
||
|
import LanguageDetector from "i18next-browser-languagedetector";
|
||
|
import XHR from "i18next-http-backend";
|
||
|
import { initReactI18next } from "react-i18next";
|
||
|
|
||
|
import langEn from "@i18n/locales/en.json";
|
||
|
import langEs from "@i18n/locales/es.json";
|
||
|
|
||
|
const resources = {
|
||
|
en: langEn,
|
||
|
es: langEs,
|
||
|
};
|
||
|
|
||
|
const options = {
|
||
|
order: ["querystring", "navigator"],
|
||
|
lookupQuerystring: "lng",
|
||
|
};
|
||
|
|
||
|
i18n.use(XHR)
|
||
|
.use(LanguageDetector)
|
||
|
.use(initReactI18next)
|
||
|
.init({
|
||
|
detection: options,
|
||
|
resources,
|
||
|
ns: [""],
|
||
|
defaultNS: "",
|
||
|
fallbackLng: "en",
|
||
|
supportedLngs: ["en", "es"],
|
||
|
interpolation: {
|
||
|
escapeValue: false,
|
||
|
},
|
||
|
debug: false,
|
||
|
});
|
||
|
|
||
|
export default i18n;
|