mirror of
https://github.com/cupcakearmy/svelte-i18n.git
synced 2024-11-16 18:10:43 +01:00
parent
cb443f81f5
commit
1c516c9cda
@ -35,7 +35,7 @@ export function getCurrentLocale() {
|
|||||||
$locale.subscribe((newLocale: string) => {
|
$locale.subscribe((newLocale: string) => {
|
||||||
current = newLocale;
|
current = newLocale;
|
||||||
|
|
||||||
if (typeof window !== 'undefined') {
|
if (typeof window !== 'undefined' && newLocale !== null) {
|
||||||
document.documentElement.setAttribute('lang', newLocale);
|
document.documentElement.setAttribute('lang', newLocale);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user