mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
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();
|
autoFocuser.enable();
|
||||||
|
|
||||||
Events.on(ServerConnections, 'localusersignedin', globalize.updateCurrentCulture);
|
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 = () => {
|
const handleUserChange = () => {
|
||||||
handleStyleChange();
|
handleStyleChange();
|
||||||
handleLanguageChange();
|
|
||||||
};
|
};
|
||||||
|
|
||||||
Events.on(ServerConnections, 'localusersignedin', handleUserChange);
|
Events.on(ServerConnections, 'localusersignedin', handleUserChange);
|
||||||
|
@ -243,8 +237,6 @@ async function onAppReady() {
|
||||||
Events.on(currentSettings, 'change', (e, prop) => {
|
Events.on(currentSettings, 'change', (e, prop) => {
|
||||||
if (prop == 'disableCustomCss' || prop == 'customCss') {
|
if (prop == 'disableCustomCss' || prop == 'customCss') {
|
||||||
handleStyleChange();
|
handleStyleChange();
|
||||||
} else if (prop == 'language') {
|
|
||||||
handleLanguageChange();
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -89,6 +89,8 @@ const Direction = {
|
||||||
|
|
||||||
currentCulture = normalizeLocaleName(culture);
|
currentCulture = normalizeLocaleName(culture);
|
||||||
|
|
||||||
|
document.documentElement.setAttribute('lang', currentCulture);
|
||||||
|
|
||||||
let dateTimeCulture;
|
let dateTimeCulture;
|
||||||
try {
|
try {
|
||||||
dateTimeCulture = userSettings.dateTimeLocale();
|
dateTimeCulture = userSettings.dateTimeLocale();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue