Merge pull request #4306 from dmitrylyzo/fix-html-lang

Fix html lang attribute
This commit is contained in:
Bill Thornton
2023-02-07 12:28:56 -05:00
committed by GitHub
2 changed files with 3 additions and 9 deletions
+1 -9
View File
@@ -74,6 +74,7 @@ function init() {
autoFocuser.enable();
Events.on(ServerConnections, 'localusersignedin', globalize.updateCurrentCulture);
Events.on(ServerConnections, 'localusersignedout', globalize.updateCurrentCulture);
});
}
@@ -227,15 +228,8 @@ async function onAppReady() {
}
};
const handleLanguageChange = () => {
const locale = globalize.getCurrentLocale();
document.documentElement.setAttribute('lang', locale);
};
const handleUserChange = () => {
handleStyleChange();
handleLanguageChange();
};
Events.on(ServerConnections, 'localusersignedin', handleUserChange);
@@ -243,8 +237,6 @@ async function onAppReady() {
Events.on(currentSettings, 'change', (e, prop) => {
if (prop == 'disableCustomCss' || prop == 'customCss') {
handleStyleChange();
} else if (prop == 'language') {
handleLanguageChange();
}
});
+2
View File
@@ -89,6 +89,8 @@ const Direction = {
currentCulture = normalizeLocaleName(culture);
document.documentElement.setAttribute('lang', currentCulture);
let dateTimeCulture;
try {
dateTimeCulture = userSettings.dateTimeLocale();