rem: function (a, b) { if (a[0] < b[0]) return -1; if (a[0] > b[0]) return  1; return 0; 
add: function compareFn(a, b) { return a[0].localeCompare(b[0]); 
context: function ReadAvailableLanguages(){  availLanguageDict   = new Array();  var visible = new String();  var str = new String();  var i =0;  var acceptedBundleEnum = acceptedBundle.getSimpleEnumeration();  var curItem;  var stringName;  var stringNameProperty;  while (acceptedBundleEnum.hasMoreElements()) {    //progress through the bundle    curItem = acceptedBundleEnum.getNext();    //"unpack" the item, nsIPropertyElement is now partially scriptable    curItem = curItem.QueryInterface(Components.interfaces.nsIPropertyElement);    //dump string name (key)    stringName = curItem.key;    stringNameProperty = stringName.split('.');    if (stringNameProperty[1] == 'accept') {      //dump the UI string (value)      visible   = curItem.value;      //if (visible == 'true') {        str = stringNameProperty[0];        var stringLangRegion = stringNameProperty[0].split('-');        if (stringLangRegion[0]) {          var tit;          var language;          var region;          var use_region_format = false;          try {            language = languagesBundle.GetStringFromName(stringLangRegion[0]);          }          catch (ex) {            language = "";          }          if (stringLangRegion.length > 1) {            try {              region = regionsBundle.GetStringFromName(stringLangRegion[1]);              use_region_format = true;            }            catch (ex) {            }          }                    if (use_region_format) {            tit = prefLangBundle.formatStringFromName("languageRegionCodeFormat",                                                      [language, region, str], 3);          } else {            tit = prefLangBundle.formatStringFromName("languageCodeFormat",                                                      [language, str], 2);          }        } //if language        if (str && tit) {          availLanguageDict[i] = new Array(3);          availLanguageDict[i][0] = tit;          availLanguageDict[i][1] = str;          availLanguageDict[i][2] = visible;          i++;        } // if str&tit      //} //if visible    } //if accepted  } //while  availLanguageDict.sort( // sort on first element    function (a, b) {      if (a[0] < b[0]) return -1;      if (a[0] > b[0]) return  1;      return 0;    });}
meta: 8395	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/8395/285e4c3839884776b116d44f2a59981953d859dd/pref-languages.js/clean/suite/common/pref/pref-languages.js