Get Zotero.locale from loaded locale, not from pref

It was previously set from general.useragent.locale, but that's not used
by default, meaning that date interpretation and some other things might
have been incorrect for everyone who didn't set a locale explicitly and
toggle matchOS...
This commit is contained in:
Dan Stillman 2017-07-21 05:27:58 -04:00
parent 2bd3aa9669
commit 2addf6b27b
46 changed files with 48 additions and 15 deletions

View file

@ -224,21 +224,9 @@ Services.scriptloader.loadSubScript("resource://zotero/polyfill.js");
// Browser
Zotero.browser = "g";
// Locale
var uaPrefs = Services.prefs.getBranch("general.useragent.");
try {
this.locale = uaPrefs.getComplexValue("locale", Components.interfaces.nsIPrefLocalizedString);
} catch (e) {}
if(this.locale) {
this.locale = this.locale.toString();
} else {
this.locale = uaPrefs.getCharPref("locale");
}
if (this.locale.length == 2) {
this.locale = this.locale + '-' + this.locale.toUpperCase();
}
// Get resolved locale
this.locale = Services.strings.createBundle("chrome://zotero/locale/mozilla/intl.properties")
.GetStringFromName("general.useragent.locale");
_localizedStringBundle = Services.strings.createBundle("chrome://zotero/locale/zotero.properties");
// Fix logged error in PluralForm.jsm when numForms() is called before get(), as it is in

View file

@ -0,0 +1 @@
general.useragent.locale=af-ZA

View file

@ -0,0 +1 @@
general.useragent.locale=ar

View file

@ -0,0 +1 @@
general.useragent.locale=bg-BG

View file

@ -0,0 +1 @@
general.useragent.locale=ca-AD

View file

@ -0,0 +1 @@
general.useragent.locale=cs-CZ

View file

@ -0,0 +1 @@
general.useragent.locale=da-DK

View file

@ -0,0 +1 @@
general.useragent.locale=de

View file

@ -0,0 +1 @@
general.useragent.locale=el-GR

View file

@ -0,0 +1 @@
general.useragent.locale=en-US

View file

@ -0,0 +1 @@
general.useragent.locale=es-ES

View file

@ -0,0 +1 @@
general.useragent.locale=et-EE

View file

@ -0,0 +1 @@
general.useragent.locale=eu-ES

View file

@ -0,0 +1 @@
general.useragent.locale=fa

View file

@ -0,0 +1 @@
general.useragent.locale=fi-FI

View file

@ -0,0 +1 @@
general.useragent.locale=fr-FR

View file

@ -0,0 +1 @@
general.useragent.locale=gl-ES

View file

@ -0,0 +1 @@
general.useragent.locale=he-IL

View file

@ -0,0 +1 @@
general.useragent.locale=hr-HR

View file

@ -0,0 +1 @@
general.useragent.locale=hu-HU

View file

@ -0,0 +1 @@
general.useragent.locale=id-ID

View file

@ -0,0 +1 @@
general.useragent.locale=is-IS

View file

@ -0,0 +1 @@
general.useragent.locale=it-IT

View file

@ -0,0 +1 @@
general.useragent.locale=ja-JP

View file

@ -0,0 +1 @@
general.useragent.locale=km

View file

@ -0,0 +1 @@
general.useragent.locale=ko-KR

View file

@ -0,0 +1 @@
general.useragent.locale=lt-LT

View file

@ -0,0 +1 @@
general.useragent.locale=mn-MN

View file

@ -0,0 +1 @@
general.useragent.locale=nb-NO

View file

@ -0,0 +1 @@
general.useragent.locale=nl-NL

View file

@ -0,0 +1 @@
general.useragent.locale=nn-NO

View file

@ -0,0 +1 @@
general.useragent.locale=pl-PL

View file

@ -0,0 +1 @@
general.useragent.locale=pt-BR

View file

@ -0,0 +1 @@
general.useragent.locale=pt-PT

View file

@ -0,0 +1 @@
general.useragent.locale=ro-RO

View file

@ -0,0 +1 @@
general.useragent.locale=ru-RU

View file

@ -0,0 +1 @@
general.useragent.locale=sk-SK

View file

@ -0,0 +1 @@
general.useragent.locale=sl-SI

View file

@ -0,0 +1 @@
general.useragent.locale=sr-RS

View file

@ -0,0 +1 @@
general.useragent.locale=sv-SE

View file

@ -0,0 +1 @@
general.useragent.locale=th-TH

View file

@ -0,0 +1 @@
general.useragent.locale=tr-TR

View file

@ -0,0 +1 @@
general.useragent.locale=uk-UA

View file

@ -0,0 +1 @@
general.useragent.locale=vi-VN

View file

@ -0,0 +1 @@
general.useragent.locale=zh-CN

View file

@ -0,0 +1 @@
general.useragent.locale=zh-TW