fix: sync html lang attribute with active locale (#5753)
Co-authored-by: memoclaw <265580040+memoclaw@users.noreply.github.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
parent
ff32869d2f
commit
be00abe852
1 changed files with 1 additions and 0 deletions
|
|
@ -96,6 +96,7 @@ export const loadLocale = (locale: string): Locale => {
|
||||||
const validLocale = isValidLocale(locale) ? (locale as Locale) : findNearestMatchedLanguage(navigator.language);
|
const validLocale = isValidLocale(locale) ? (locale as Locale) : findNearestMatchedLanguage(navigator.language);
|
||||||
setStoredLocale(validLocale);
|
setStoredLocale(validLocale);
|
||||||
i18n.changeLanguage(validLocale);
|
i18n.changeLanguage(validLocale);
|
||||||
|
document.documentElement.lang = validLocale;
|
||||||
return validLocale;
|
return validLocale;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue