mirror of https://github.com/usememos/memos.git
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
|
|
@ -96,6 +96,7 @@ export const loadLocale = (locale: string): Locale => {
|
|||
const validLocale = isValidLocale(locale) ? (locale as Locale) : findNearestMatchedLanguage(navigator.language);
|
||||
setStoredLocale(validLocale);
|
||||
i18n.changeLanguage(validLocale);
|
||||
document.documentElement.lang = validLocale;
|
||||
return validLocale;
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue