mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-06 17:16:12 +00:00
#47027 Can't add language XX when XX-YY is present
ra=ftang using IndexOf to check if a language is active is unreliable. We need to compare them one by one.
This commit is contained in:
parent
4aa5410139
commit
dc750e8293
@ -262,11 +262,18 @@ function LangAlreadyActive(langId)
|
||||
|
||||
dump("*** LangAlreadyActive, PrefString: " + pref_string + "\n");
|
||||
|
||||
var found = false;
|
||||
try {
|
||||
if (pref_string.indexOf(langId) != -1)
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
arrayOfPrefs = pref_string.split(', ');
|
||||
|
||||
if (arrayOfPrefs) for (i = 0; i < arrayOfPrefs.length; i++) {
|
||||
if (arrayOfPrefs[i] == langId) {
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return found;
|
||||
}
|
||||
|
||||
catch(ex){
|
||||
|
Loading…
Reference in New Issue
Block a user