forked from izu/student-web-if-development-kit
fix ACAAB language sync with header selection
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -5,7 +5,7 @@ const KIT_STORAGE_KEY = 'if_untan_lang';
|
|||||||
|
|
||||||
function readKitLang(): Lang {
|
function readKitLang(): Lang {
|
||||||
const saved = localStorage.getItem(KIT_STORAGE_KEY);
|
const saved = localStorage.getItem(KIT_STORAGE_KEY);
|
||||||
if (saved === 'en') return 'en';
|
if (saved === 'id' || saved === 'en') return saved;
|
||||||
const browser = (navigator.language || 'id').toLowerCase();
|
const browser = (navigator.language || 'id').toLowerCase();
|
||||||
return browser.startsWith('en') ? 'en' : 'id';
|
return browser.startsWith('en') ? 'en' : 'id';
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user