feat(web): i18n with react-i18next (sv/en)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-06-03 22:42:47 +02:00
parent 66d0624279
commit 478b4ce44e
10 changed files with 156 additions and 0 deletions
+18
View File
@@ -0,0 +1,18 @@
import i18n from "i18next";
import { initReactI18next } from "react-i18next";
import en from "./en.json";
import sv from "./sv.json";
export const LOCALE_KEY = "locale";
const stored =
typeof localStorage !== "undefined" ? localStorage.getItem(LOCALE_KEY) : null;
const fallback = "en";
void i18n.use(initReactI18next).init({
resources: { en: { translation: en }, sv: { translation: sv } },
lng: stored ?? fallback,
fallbackLng: fallback,
interpolation: { escapeValue: false },
});
export default i18n;