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
+13
View File
@@ -0,0 +1,13 @@
import { useTranslation } from "react-i18next";
import i18n, { LOCALE_KEY } from "./index";
export function useLocale() {
const { i18n: instance } = useTranslation();
const setLocale = (lng: "en" | "sv") => {
localStorage.setItem(LOCALE_KEY, lng);
void i18n.changeLanguage(lng);
};
return { locale: instance.language, setLocale };
}