Skip to content

armgit / memos

Public Imported from GitHub
0

Memos is an open-source, self-hosted note-taking app that brings your everyday thoughts together in a personal timeline. Your data stays yours, and you choose what to keep private or share.

fix: sync html lang attribute with active locale (#5753)

memoclawbe00abe85247
diff --git a/web/src/utils/i18n.ts b/web/src/utils/i18n.ts
index 069d50de3..b96421a27 100644
--- a/web/src/utils/i18n.ts
+++ b/web/src/utils/i18n.ts
@@ -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;
};