fix: language detection

This commit is contained in:
Maya 2025-07-31 21:53:52 +03:00
parent 749339c594
commit ee0de6e178
No known key found for this signature in database
3 changed files with 1 additions and 4 deletions

View File

@ -304,7 +304,6 @@ export const availableLocales = {
export function updateLocale(newLocale: string) { export function updateLocale(newLocale: string) {
log(["locale"], `set to ${newLocale}`); log(["locale"], `set to ${newLocale}`);
localStorage.setItem("locale", newLocale);
// @ts-expect-error shush // @ts-expect-error shush
setLocale(newLocale, { reload: false }); setLocale(newLocale, { reload: false });
// @ts-expect-error shush // @ts-expect-error shush

View File

@ -71,8 +71,6 @@
theme.set( theme.set(
(localStorage.getItem("theme") as "light" | "dark") || "light", (localStorage.getItem("theme") as "light" | "dark") || "light",
); );
updateLocale(localStorage.getItem("locale") || "en");
Settings.instance.load(); Settings.instance.load();
fetch(`${Settings.instance.settings.vertdURL}/api/version`).then( fetch(`${Settings.instance.settings.vertdURL}/api/version`).then(

View File

@ -10,7 +10,7 @@ export default defineConfig(({ command }) => {
paraglideVitePlugin({ paraglideVitePlugin({
project: "./project.inlang", project: "./project.inlang",
outdir: "./src/lib/paraglide", outdir: "./src/lib/paraglide",
strategy: ["globalVariable", "preferredLanguage", "baseLocale"], strategy: ["localStorage", "preferredLanguage", "baseLocale"],
}), }),
svg({ svg({
includePaths: ["./src/lib/assets"], includePaths: ["./src/lib/assets"],