зеркало из https://github.com/mozilla/pjs.git
Bug 675252 - Store buildid when locales are installed and make sure it is current on startup. r=mfinkle
This commit is contained in:
Родитель
d57df5bee8
Коммит
47d612c75f
|
@ -217,6 +217,7 @@ pref("extensions.getAddons.get.url", "https://services.addons.mozilla.org/%LOCAL
|
|||
|
||||
/* preference for the locale picker */
|
||||
pref("extensions.getLocales.get.url", "");
|
||||
pref("extensions.compatability.locales.buildid", "0");
|
||||
|
||||
/* blocklist preferences */
|
||||
pref("extensions.blocklist.enabled", true);
|
||||
|
|
|
@ -214,6 +214,8 @@ let LocaleUI = {
|
|||
},
|
||||
|
||||
closeWindow : function() {
|
||||
var buildID = Cc["@mozilla.org/xre/app-info;1"].getService(Ci.nsIXULAppInfo).platformBuildID;
|
||||
Services.prefs.setCharPref("extensions.compatability.locales.buildid", buildID);
|
||||
// Trying to close this window and open a new one results in a corrupt UI.
|
||||
if (LocaleUI._currentInstall) {
|
||||
// a new locale was installed, restart the browser
|
||||
|
|
|
@ -126,6 +126,12 @@ function haveSystemLocale() {
|
|||
|
||||
function checkCurrentLocale() {
|
||||
if (Services.prefs.prefHasUserValue("general.useragent.locale")) {
|
||||
// if the user has a compatable locale from a different buildid, we need to update
|
||||
var buildID = Cc["@mozilla.org/xre/app-info;1"].getService(Ci.nsIXULAppInfo).appBuildID;
|
||||
let localeBuildID = Services.prefs.getCharPref("extensions.compatability.locales.buildid");
|
||||
if (buildID != localeBuildID)
|
||||
return false;
|
||||
|
||||
let currentLocale = Services.prefs.getCharPref("general.useragent.locale");
|
||||
return isLocaleAvailable(currentLocale);
|
||||
}
|
||||
|
@ -239,7 +245,7 @@ BrowserCLH.prototype = {
|
|||
uris = uris.slice(1);
|
||||
}
|
||||
|
||||
// Show the locale selector if we have a new profile
|
||||
// Show the locale selector if we have a new profile, or if the selected locale is no longer compatible
|
||||
let showLocalePicker = Services.prefs.getBoolPref("browser.firstrun.show.localepicker")
|
||||
if ((needHomepageOverride() == "new profile" && showLocalePicker && !haveSystemLocale()) || !checkCurrentLocale()) {
|
||||
browserWin = openWindow(null, "chrome://browser/content/localePicker.xul", "_blank", "chrome,dialog=no,all", defaultURL);
|
||||
|
|
|
@ -238,6 +238,9 @@ UpdatePrompt.prototype = {
|
|||
aLocale.addon.install.install();
|
||||
}
|
||||
}, this);
|
||||
// store the buildid of these locales so that we can disable locales when the
|
||||
// user updates through a non-updater channel
|
||||
Services.prefs.setCharPref("extensions.compatability.locales.buildid", aUpdate.buildID);
|
||||
}).bind(this), { buildID: aUpdate.buildID });
|
||||
},
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче