@@ -19,6 +19,8 @@ server/dist
|
|||||||
packages/server/dist
|
packages/server/dist
|
||||||
*.local
|
*.local
|
||||||
ROADMAP.md
|
ROADMAP.md
|
||||||
|
pnpm-lock.yaml
|
||||||
|
pnpm-workspace.yaml
|
||||||
# Server data
|
# Server data
|
||||||
packages/server/data/
|
packages/server/data/
|
||||||
packages/server/node_modules/
|
packages/server/node_modules/
|
||||||
|
|||||||
@@ -33,7 +33,12 @@ function resolveLocale(saved: string | null): SupportedLocale {
|
|||||||
return 'en'
|
return 'en'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function setHtmlLang(locale: SupportedLocale) {
|
||||||
|
document.documentElement.lang = locale
|
||||||
|
}
|
||||||
|
|
||||||
const locale = resolveLocale(saved)
|
const locale = resolveLocale(saved)
|
||||||
|
setHtmlLang(locale)
|
||||||
|
|
||||||
export const i18n = createI18n({
|
export const i18n = createI18n({
|
||||||
legacy: false,
|
legacy: false,
|
||||||
@@ -44,4 +49,5 @@ export const i18n = createI18n({
|
|||||||
|
|
||||||
export function switchLocale(newLocale: string): void {
|
export function switchLocale(newLocale: string): void {
|
||||||
;(i18n.global.locale as any).value = newLocale
|
;(i18n.global.locale as any).value = newLocale
|
||||||
|
setHtmlLang(newLocale as SupportedLocale)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user