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
commit 178a07747d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 9 deletions

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();
}
});

View file

@ -89,6 +89,8 @@ const Direction = {
currentCulture = normalizeLocaleName(culture);
document.documentElement.setAttribute('lang', currentCulture);
let dateTimeCulture;
try {
dateTimeCulture = userSettings.dateTimeLocale();