fx-compat: Use new mozILocaleService API
Replace functions with arrays, as in https://phabricator.services.mozilla.com/D6339
This commit is contained in:
parent
6e43d2cd4e
commit
789a8a5fe9
3 changed files with 5 additions and 5 deletions
|
@ -627,7 +627,7 @@ Zotero_Preferences.Advanced = {
|
||||||
},
|
},
|
||||||
|
|
||||||
onLocaleChange: function () {
|
onLocaleChange: function () {
|
||||||
var requestedLocale = Services.locale.getRequestedLocale();
|
var requestedLocale = Services.locale.requestedLocale;
|
||||||
var menu = document.getElementById('locale-menu');
|
var menu = document.getElementById('locale-menu');
|
||||||
|
|
||||||
if (menu.value == 'automatic') {
|
if (menu.value == 'automatic') {
|
||||||
|
@ -636,12 +636,12 @@ Zotero_Preferences.Advanced = {
|
||||||
var changed = requestedLocale
|
var changed = requestedLocale
|
||||||
&& requestedLocale == Zotero.locale
|
&& requestedLocale == Zotero.locale
|
||||||
&& menu.label != this._getAutomaticLocaleMenuLabel();
|
&& menu.label != this._getAutomaticLocaleMenuLabel();
|
||||||
Services.locale.setRequestedLocales(null);
|
Services.locale.requestedLocales = null;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// Changed if moving to a locale other than the current one
|
// Changed if moving to a locale other than the current one
|
||||||
var changed = requestedLocale != menu.value
|
var changed = requestedLocale != menu.value
|
||||||
Services.locale.setRequestedLocales([menu.value]);
|
Services.locale.requestedLocales = [menu.value];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!changed) {
|
if (!changed) {
|
||||||
|
|
|
@ -38,7 +38,7 @@ Zotero.Intl = new function () {
|
||||||
let restart = false;
|
let restart = false;
|
||||||
if (prevMatchOS === false && prevLocale) {
|
if (prevMatchOS === false && prevLocale) {
|
||||||
try {
|
try {
|
||||||
Services.locale.setRequestedLocales([prevLocale]);
|
Services.locale.requestedLocales = [prevLocale];
|
||||||
restart = true;
|
restart = true;
|
||||||
}
|
}
|
||||||
catch (e) {
|
catch (e) {
|
||||||
|
|
|
@ -397,7 +397,7 @@ describe("Zotero.Utilities.Internal", function () {
|
||||||
var availableLocales;
|
var availableLocales;
|
||||||
|
|
||||||
before(function () {
|
before(function () {
|
||||||
availableLocales = Services.locale.getAvailableLocales();
|
availableLocales = Services.locale.availableLocales;
|
||||||
});
|
});
|
||||||
|
|
||||||
function resolve(locale) {
|
function resolve(locale) {
|
||||||
|
|
Loading…
Reference in a new issue