mirror of
https://github.com/steveiliop56/tinyauth.git
synced 2025-12-09 09:46:36 +00:00
fix: fix language selector and language detection
This commit is contained in:
@@ -2,6 +2,7 @@ import i18n from "i18next";
|
|||||||
import { initReactI18next } from "react-i18next";
|
import { initReactI18next } from "react-i18next";
|
||||||
import LanguageDetector from "i18next-browser-languagedetector";
|
import LanguageDetector from "i18next-browser-languagedetector";
|
||||||
import resourcesToBackend from "i18next-resources-to-backend";
|
import resourcesToBackend from "i18next-resources-to-backend";
|
||||||
|
import { languages } from "./locales";
|
||||||
|
|
||||||
i18n
|
i18n
|
||||||
.use(LanguageDetector)
|
.use(LanguageDetector)
|
||||||
@@ -14,12 +15,12 @@ i18n
|
|||||||
.init({
|
.init({
|
||||||
fallbackLng: "en",
|
fallbackLng: "en",
|
||||||
debug: import.meta.env.MODE === "development",
|
debug: import.meta.env.MODE === "development",
|
||||||
|
nonExplicitSupportedLngs: true,
|
||||||
interpolation: {
|
supportedLngs: Object.keys(languages),
|
||||||
escapeValue: false,
|
|
||||||
},
|
|
||||||
|
|
||||||
load: "currentOnly",
|
load: "currentOnly",
|
||||||
|
detection: {
|
||||||
|
lookupLocalStorage: "tinyauth-lang",
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
export default i18n;
|
export default i18n;
|
||||||
|
|||||||
Reference in New Issue
Block a user