Skip to content

Commit 2f4f250

Browse files
committed
fix: fix language selector and language detection
1 parent 7bac1ac commit 2f4f250

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

frontend/src/lib/i18n/i18n.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import i18n from "i18next";
22
import { initReactI18next } from "react-i18next";
33
import LanguageDetector from "i18next-browser-languagedetector";
44
import resourcesToBackend from "i18next-resources-to-backend";
5+
import { languages } from "./locales";
56

67
i18n
78
.use(LanguageDetector)
@@ -14,12 +15,12 @@ i18n
1415
.init({
1516
fallbackLng: "en",
1617
debug: import.meta.env.MODE === "development",
17-
18-
interpolation: {
19-
escapeValue: false,
20-
},
21-
18+
nonExplicitSupportedLngs: true,
19+
supportedLngs: Object.keys(languages),
2220
load: "currentOnly",
21+
detection: {
22+
lookupLocalStorage: "tinyauth-lang",
23+
},
2324
});
2425

2526
export default i18n;

0 commit comments

Comments
 (0)