- BREAKING CHANGE: Remove $.pref in favor of new svgEditor.pref
(avoiding polluting jQuery). (Might be moved to own module in future.) - BREAKING CHANGE: `putLocale` (a function called automatically by `svg-editor.js`) no longer checks `pref`. Should not impact average consumers. `putLocale` now also logs lang and checks `goodLangs` even if an explicit lang param is provided
This commit is contained in:
@@ -374,28 +374,17 @@ export const readLang = async function (langData) {
|
||||
export const putLocale = async function (givenParam, goodLangs, conf) {
|
||||
if (givenParam) {
|
||||
langParam = givenParam;
|
||||
} else {
|
||||
langParam = $.pref('lang');
|
||||
if (!langParam) {
|
||||
if (navigator.userLanguage) { // Explorer
|
||||
langParam = navigator.userLanguage;
|
||||
} else if (navigator.language) { // FF, Opera, ...
|
||||
langParam = navigator.language;
|
||||
}
|
||||
}
|
||||
} else if (navigator.userLanguage) { // Explorer
|
||||
langParam = navigator.userLanguage;
|
||||
} else if (navigator.language) { // FF, Opera, ...
|
||||
langParam = navigator.language;
|
||||
}
|
||||
|
||||
console.log('Lang: ' + langParam); // eslint-disable-line no-console
|
||||
console.log('Lang: ' + langParam); // eslint-disable-line no-console
|
||||
|
||||
// Set to English if language is not in list of good langs
|
||||
if (!goodLangs.includes(langParam) && langParam !== 'test') {
|
||||
langParam = 'en';
|
||||
}
|
||||
|
||||
// don't bother on first run if language is English
|
||||
// The following line prevents setLang from running
|
||||
// extensions which depend on updated uiStrings,
|
||||
// so commenting it out.
|
||||
// if (langParam.startsWith('en')) {return;}
|
||||
// Set to English if language is not in list of good langs
|
||||
if (!goodLangs.includes(langParam) && langParam !== 'test') {
|
||||
langParam = 'en';
|
||||
}
|
||||
|
||||
const url = conf.langPath + 'lang.' + langParam + '.js';
|
||||
|
||||
Reference in New Issue
Block a user