mirror of
https://github.com/0rangebananaspy/authelia.git
synced 2024-09-14 22:47:21 +07:00
4503ac07be
This fixes an issue with localization platforms and the docs regarding localization, and the forcing locale names to lowercase.
33 lines
844 B
TypeScript
33 lines
844 B
TypeScript
import i18n from "i18next";
|
|
import LanguageDetector from "i18next-browser-languagedetector";
|
|
import Backend from "i18next-http-backend";
|
|
import { initReactI18next } from "react-i18next";
|
|
|
|
i18n.use(Backend)
|
|
.use(LanguageDetector)
|
|
.use(initReactI18next)
|
|
.init({
|
|
detection: {
|
|
order: ["querystring", "navigator"],
|
|
lookupQuerystring: "lng",
|
|
},
|
|
backend: {
|
|
loadPath: "/locales/{{lng}}/{{ns}}.json",
|
|
},
|
|
ns: ["portal"],
|
|
defaultNS: "portal",
|
|
fallbackLng: {
|
|
default: ["en"],
|
|
},
|
|
load: "all",
|
|
supportedLngs: ["en", "es", "de"],
|
|
lowerCaseLng: false,
|
|
nonExplicitSupportedLngs: true,
|
|
interpolation: {
|
|
escapeValue: false,
|
|
},
|
|
debug: false,
|
|
});
|
|
|
|
export default i18n;
|