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) {
|
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
|
||||||
|
|
|
@ -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(
|
||||||
|
|
|
@ -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"],
|
||||||
|
|
Loading…
Reference in New Issue