1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

Fix language change when refreshing

This commit is contained in:
Dmitry Lyzo 2023-01-26 00:06:16 +03:00
parent 5edafe901a
commit 5800102f9f
2 changed files with 2 additions and 9 deletions

View file

@ -227,15 +227,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 +236,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();
} }
}); });

View file

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