1
0
mirror of https://github.com/0rangebananaspy/authelia.git synced 2024-09-14 22:47:21 +07:00
authelia/web/src/i18n/index.ts
2022-05-28 16:10:49 +10:00

37 lines
963 B
TypeScript

import i18n from "i18next";
import LanguageDetector from "i18next-browser-languagedetector";
import Backend from "i18next-http-backend";
import { initReactI18next } from "react-i18next";
import { getBasePath } from "@utils/BasePath";
const basePath = getBasePath();
i18n.use(Backend)
.use(LanguageDetector)
.use(initReactI18next)
.init({
detection: {
order: ["querystring", "navigator"],
lookupQuerystring: "lng",
},
backend: {
loadPath: basePath + "/locales/{{lng}}/{{ns}}.json",
},
ns: ["portal"],
defaultNS: "portal",
fallbackLng: {
default: ["en"],
},
load: "all",
supportedLngs: ["en", "de", "es", "fr", "ru", "sv", "zh-TW"],
lowerCaseLng: false,
nonExplicitSupportedLngs: true,
interpolation: {
escapeValue: false,
},
debug: false,
});
export default i18n;