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

(cherry picked from commit a07d5b7bd1eaa962b612bed1e3198fac0e2b58c0)
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

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