rem: prefInterface =    Components.classes["@mozilla.org/preferences;1"]. getService(Components.interfaces.nsIPref);  defaultLanguage =  prefInterface. getLocalizedUnicharPref("general.useragent.locale");  defaultRegion =   prefInterface. getLocalizedUnicharPref("general.useragent.contentlocale"); 
add: const nsIPrefLocalizedString = Components.interfaces.nsIPrefLocalizedString; var prefBranch = Components.classes["@mozilla.org/preferences-service;1"] .getService(Components.interfaces.nsIPrefService) .getBranch("general.useragent."); defaultLanguage = prefBranch.getComplexValue("locale", nsIPrefLocalizedString).data; defaultRegion = prefBranch.getComplexValue("contentlocale", nsIPrefLocalizedString).data; 
context: function Startup(){  var prefInterface;    var defaultLanguage;  var languageList = document.getElementById("langList");  var selectedLanguage = window.arguments.length ? window.arguments[0] : null;    var defaultRegion;  var regionList = document.getElementById("regionList");  var selectedRegion = window.arguments.length ? window.arguments[1] : null;  //get pref defaults  try  {    prefInterface =    Components.classes["@mozilla.org/preferences;1"].                       getService(Components.interfaces.nsIPref);    defaultLanguage =  prefInterface.                       getLocalizedUnicharPref("general.useragent.locale");    defaultRegion =   prefInterface.                       getLocalizedUnicharPref("general.useragent.contentlocale");  }  catch(e)   {}  //persist previous user selection, highlight a default otherwise  if (!SelectListItem(languageList, selectedLanguage))    if (!SelectListItem(languageList, defaultLanguage))      languageList.selectedIndex = 0;  //persist previous user selection, highlight a default otherwise  if (!SelectListItem(regionList, selectedRegion))    if (!SelectListItem(regionList, defaultRegion))      regionList.selectedIndex = 1;}
meta: 9421	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/9421/e083c214fb940a9024341d1aa6cfc190360ee5fd/selectLang.js/buggy/profile/resources/content/selectLang.js