From a4bd9bb87a09da7e1880089816e578053746de30 Mon Sep 17 00:00:00 2001 From: frost768 Date: Sun, 18 Jun 2023 15:10:26 +0300 Subject: [PATCH] fix: language preference persistence --- src/index.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/index.tsx b/src/index.tsx index 1bf99f70..36b1fb14 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -8,13 +8,14 @@ import { registerSW } from "virtual:pwa-register"; import { ErrorBoundary } from "@/components/layout/ErrorBoundary"; import App from "@/setup/App"; import { conf } from "@/setup/config"; +import i18n from "@/setup/i18n"; import "@/setup/ga"; import "@/setup/sentry"; -import "@/setup/i18n"; import "@/setup/index.css"; import "@/backend"; import { initializeChromecast } from "./setup/chromecast"; +import { SettingsStore } from "./state/settings/store"; import { initializeStores } from "./utils/storage"; // initialize @@ -30,6 +31,7 @@ registerSW({ const LazyLoadedApp = React.lazy(async () => { await initializeStores(); + i18n.changeLanguage(SettingsStore.get().language ?? "en"); return { default: App, };