mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-07 04:05:49 +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");
|
dump("*** LangAlreadyActive, PrefString: " + pref_string + "\n");
|
||||||
|
|
||||||
|
var found = false;
|
||||||
try {
|
try {
|
||||||
if (pref_string.indexOf(langId) != -1)
|
arrayOfPrefs = pref_string.split(', ');
|
||||||
return true;
|
|
||||||
else
|
if (arrayOfPrefs) for (i = 0; i < arrayOfPrefs.length; i++) {
|
||||||
return false;
|
if (arrayOfPrefs[i] == langId) {
|
||||||
|
found = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return found;
|
||||||
}
|
}
|
||||||
|
|
||||||
catch(ex){
|
catch(ex){
|
||||||
|
Loading…
Reference in New Issue
Block a user