mirror of https://github.com/VERT-sh/VERT.git
fix: language detection
This commit is contained in:
parent
749339c594
commit
ee0de6e178
|
@ -304,7 +304,6 @@ export const availableLocales = {
|
|||
|
||||
export function updateLocale(newLocale: string) {
|
||||
log(["locale"], `set to ${newLocale}`);
|
||||
localStorage.setItem("locale", newLocale);
|
||||
// @ts-expect-error shush
|
||||
setLocale(newLocale, { reload: false });
|
||||
// @ts-expect-error shush
|
||||
|
|
|
@ -71,8 +71,6 @@
|
|||
theme.set(
|
||||
(localStorage.getItem("theme") as "light" | "dark") || "light",
|
||||
);
|
||||
updateLocale(localStorage.getItem("locale") || "en");
|
||||
|
||||
Settings.instance.load();
|
||||
|
||||
fetch(`${Settings.instance.settings.vertdURL}/api/version`).then(
|
||||
|
|
|
@ -10,7 +10,7 @@ export default defineConfig(({ command }) => {
|
|||
paraglideVitePlugin({
|
||||
project: "./project.inlang",
|
||||
outdir: "./src/lib/paraglide",
|
||||
strategy: ["globalVariable", "preferredLanguage", "baseLocale"],
|
||||
strategy: ["localStorage", "preferredLanguage", "baseLocale"],
|
||||
}),
|
||||
svg({
|
||||
includePaths: ["./src/lib/assets"],
|
||||
|
|
Loading…
Reference in New Issue