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

Merge pull request #3642 from taku0/font-family-by-language

(cherry picked from commit a07d5b7bd1)
Signed-off-by: Joshua Boniface <joshua@boniface.me>
This commit is contained in:
Joshua M. Boniface 2022-05-15 20:27:54 -04:00 committed by Joshua Boniface
parent 34051a677d
commit b41ed9477e
9 changed files with 1564 additions and 4 deletions

View file

@ -1,7 +1,7 @@
import { Events } from 'jellyfin-apiclient';
import isEmpty from 'lodash-es/isEmpty';
import * as userSettings from './settings/userSettings';
import { currentSettings as userSettings } from './settings/userSettings';
/* eslint-disable indent */

View file

@ -246,11 +246,24 @@ async function onAppReady() {
}
};
Events.on(ServerConnections, 'localusersignedin', handleStyleChange);
Events.on(ServerConnections, 'localusersignedout', handleStyleChange);
const handleLanguageChange = () => {
const locale = globalize.getCurrentLocale();
document.documentElement.setAttribute('lang', locale);
};
const handleUserChange = () => {
handleStyleChange();
handleLanguageChange();
};
Events.on(ServerConnections, 'localusersignedin', handleUserChange);
Events.on(ServerConnections, 'localusersignedout', handleUserChange);
Events.on(currentSettings, 'change', (e, prop) => {
if (prop == 'disableCustomCss' || prop == 'customCss') {
handleStyleChange();
} else if (prop == 'language') {
handleLanguageChange();
}
});