#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:
shanjian%netscape.com 2000-09-11 20:49:34 +00:00
parent 4aa5410139
commit dc750e8293

View File

@ -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){