Merge pull request #4306 from dmitrylyzo/fix-html-lang
Fix html lang attribute
This commit is contained in:
commit
178a07747d
2 changed files with 3 additions and 9 deletions
|
@ -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();
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
@ -89,6 +89,8 @@ const Direction = {
|
|||
|
||||
currentCulture = normalizeLocaleName(culture);
|
||||
|
||||
document.documentElement.setAttribute('lang', currentCulture);
|
||||
|
||||
let dateTimeCulture;
|
||||
try {
|
||||
dateTimeCulture = userSettings.dateTimeLocale();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue