Update view language if system language is changed and the user has no profile language set
This commit is contained in:
@@ -51,8 +51,10 @@ async function main() {
|
||||
return i18n;
|
||||
}
|
||||
|
||||
async function setLanguage(lang) {
|
||||
window.localStorage.NG_TRANSLATE_LANG_KEY = lang;
|
||||
async function setLanguage(lang, profile = false) {
|
||||
// only change if we set the language also for the profile or the user has no profile language set
|
||||
if (profile) window.localStorage.NG_TRANSLATE_LANG_KEY = lang;
|
||||
else if (window.localStorage.NG_TRANSLATE_LANG_KEY) return;
|
||||
|
||||
try {
|
||||
const result = await fetcher.get(`${API_ORIGIN}/translation/${lang}.json`);
|
||||
|
||||
Reference in New Issue
Block a user