rem: /* reject bogus lang strings, INCLUDING those with HTTP "q" values kludged on the end of them */ if (!IsRFC1766LangTag(otherField.value)) { window.alert(prefLangBundle.GetStringFromName("illegalOtherLanguage")); 
add: var LanguageidsString = otherField.value.replace(/\s/g,"").toLowerCase(); var Languageids = LanguageidsString.split(separatorRe); for (var i = 0; i < Languageids.length; i++) { Languageid = Languageids[i];  if (IsRFC1766LangTag(Languageid)) { if (!LangAlreadySelected(Languageid)) { if (!LangAlreadyActive(Languageid)) { Languagename = GetLanguageTitle(Languageid); if (!Languagename) Languagename = '[' + Languageid + ']'; addThese[i+selCount] = Languageid; addTheseNames[i+selCount] = Languagename; } } } else { invalidLangs[invalidLangs.length] = Languageid; } } if (invalidLangs.length > 0) { var errorMsg = prefLangBundle.GetStringFromName("illegalOtherLanguage") + " " + invalidLangs.join(", "); var errorTitle = prefLangBundle.GetStringFromName("illegalOtherLanguageTitle");  var prompter = Components.classes["@mozilla.org/embedcomp/prompt-service;1"] .getService(Components.interfaces.nsIPromptService);  prompter.alert(this.window, errorTitle, errorMsg); otherField.focus(); 
context: function AddAvailableLanguage(){  var Languagename = new String();  var Languageid = new String();  //selected languages  for (var nodeIndex=0; nodeIndex < available_languages.selectedItems.length; nodeIndex++) {    var selItem =  available_languages.selectedItems[nodeIndex];    Languagename    = selItem.getAttribute('label');    Languageid      = selItem.getAttribute('id');    if (!LangAlreadyActive(Languageid)) {      AddListItem(window.opener.document, active_languages, Languageid, Languagename);    }//if  } //loop selected languages  //user-defined languages  var otherField = document.getElementById( "languages.other" );  if (otherField.value) {    /* reject bogus lang strings, INCLUDING those with HTTP "q"       values kludged on the end of them    */    if (!IsRFC1766LangTag(otherField.value)) {      window.alert(prefLangBundle.GetStringFromName("illegalOtherLanguage"));      return false;    }    Languageid      = otherField.value;    Languageid      = Languageid.toLowerCase();    Languagename    = GetLanguageTitle(Languageid);    if (!Languagename)       Languagename = '[' + Languageid + ']';    if (!LangAlreadyActive(Languageid)) {      AddListItem(window.opener.document, active_languages, Languageid, Languagename);    }//if  }  available_languages.clearSelection();  return true;} //AddAvailableLanguage
meta: 9421	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/9421/c47b4d9f93aa9d661666edb29290cc3ce295baac/pref-languages.js/clean/xpfe/components/prefwindow/resources/content/pref-languages.js