fx-compat: Use new mozILocaleService API

Replace functions with arrays, as in https://phabricator.services.mozilla.com/D6339
This commit is contained in:
Dan Stillman 2022-06-20 23:09:46 -04:00
parent 6e43d2cd4e
commit 789a8a5fe9
3 changed files with 5 additions and 5 deletions

View file

@ -627,7 +627,7 @@ Zotero_Preferences.Advanced = {
},
onLocaleChange: function () {
var requestedLocale = Services.locale.getRequestedLocale();
var requestedLocale = Services.locale.requestedLocale;
var menu = document.getElementById('locale-menu');
if (menu.value == 'automatic') {
@ -636,12 +636,12 @@ Zotero_Preferences.Advanced = {
var changed = requestedLocale
&& requestedLocale == Zotero.locale
&& menu.label != this._getAutomaticLocaleMenuLabel();
Services.locale.setRequestedLocales(null);
Services.locale.requestedLocales = null;
}
else {
// Changed if moving to a locale other than the current one
var changed = requestedLocale != menu.value
Services.locale.setRequestedLocales([menu.value]);
Services.locale.requestedLocales = [menu.value];
}
if (!changed) {

View file

@ -38,7 +38,7 @@ Zotero.Intl = new function () {
let restart = false;
if (prevMatchOS === false && prevLocale) {
try {
Services.locale.setRequestedLocales([prevLocale]);
Services.locale.requestedLocales = [prevLocale];
restart = true;
}
catch (e) {

View file

@ -397,7 +397,7 @@ describe("Zotero.Utilities.Internal", function () {
var availableLocales;
before(function () {
availableLocales = Services.locale.getAvailableLocales();
availableLocales = Services.locale.availableLocales;
});
function resolve(locale) {