From 2f4f2505d79d867677d95f1a1e0d7b9d53fdc02c Mon Sep 17 00:00:00 2001 From: Stavros Date: Mon, 8 Dec 2025 19:03:35 +0200 Subject: [PATCH] fix: fix language selector and language detection --- frontend/src/lib/i18n/i18n.ts | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/frontend/src/lib/i18n/i18n.ts b/frontend/src/lib/i18n/i18n.ts index 49b151d..2810949 100644 --- a/frontend/src/lib/i18n/i18n.ts +++ b/frontend/src/lib/i18n/i18n.ts @@ -2,6 +2,7 @@ import i18n from "i18next"; import { initReactI18next } from "react-i18next"; import LanguageDetector from "i18next-browser-languagedetector"; import resourcesToBackend from "i18next-resources-to-backend"; +import { languages } from "./locales"; i18n .use(LanguageDetector) @@ -14,12 +15,12 @@ i18n .init({ fallbackLng: "en", debug: import.meta.env.MODE === "development", - - interpolation: { - escapeValue: false, - }, - + nonExplicitSupportedLngs: true, + supportedLngs: Object.keys(languages), load: "currentOnly", + detection: { + lookupLocalStorage: "tinyauth-lang", + }, }); export default i18n;