Fix for bug 127783. Moved the code from two functions SwitchLanguagePack and SwitchContentPack

into a single function SwitchPacks.  r=tao, sr=alecf, a=scc (for drivers)
This commit is contained in:
dbragg%netscape.com 2006-04-08 00:57:36 +00:00
Родитель 2cac64a653
Коммит 7fe6762aa8
1 изменённых файлов: 6 добавлений и 12 удалений

Просмотреть файл

@ -65,14 +65,12 @@
parent.hPrefWindow.registerOKCallbackFunc( SwitchPacks ); parent.hPrefWindow.registerOKCallbackFunc( SwitchPacks );
} }
function SwitchPacks() function SwitchPacks()
{ {
SwitchContentPack(); //Switch the Content pack if necessary
SwitchLanguagePack();
}
function SwitchContentPack()
{
var oldContentPack = parent.hPrefWindow.getPref( "localizedstring", "general.useragent.contentlocale"); var oldContentPack = parent.hPrefWindow.getPref( "localizedstring", "general.useragent.contentlocale");
var newContentPack; var newContentPack;
@ -102,18 +100,15 @@
alertText = alertText.replace(/%brand%/g, brandBundle.getString("brandShortName")); alertText = alertText.replace(/%brand%/g, brandBundle.getString("brandShortName"));
var titleText = contentBundle.GetStringFromName("languageTitle"); var titleText = contentBundle.GetStringFromName("languageTitle");
var promptService = Components.classes["@mozilla.org/embedcomp/prompt-service;1"].getService(); var promptService = Components.classes["@mozilla.org/embedcomp/prompt-service;1"].getService();
promptService = promptService.QueryInterface(Components.interfaces.nsIPromptService) promptService = promptService.QueryInterface(Components.interfaces.nsIPromptService);
promptService.alert(window, titleText, alertText); promptService.alert(window, titleText, alertText);
} }
catch(e) { catch(e) {
return false; return false;
} }
} }
return true;
}
function SwitchLanguagePack() ///Switch the Language pack if necessary
{
var oldLanguagePack = parent.hPrefWindow.getPref( "localizedstring", "general.useragent.locale"); var oldLanguagePack = parent.hPrefWindow.getPref( "localizedstring", "general.useragent.locale");
var newLanguagePack; var newLanguagePack;
@ -141,7 +136,6 @@
return false; return false;
} }
} }
return true;
} }
function SelectContentPack() function SelectContentPack()