www

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | Submodules | README | LICENSE

commit 2addf6b27b1466bf5520881fc007a31cd645076b
parent 2bd3aa9669f1f16e9be34233d1c3080efaec491a
Author: Dan Stillman <dstillman@zotero.org>
Date:   Fri, 21 Jul 2017 05:27:58 -0400

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...

Diffstat:
Mchrome/content/zotero/xpcom/zotero.js | 18+++---------------
Achrome/locale/af-ZA/zotero/mozilla/intl.properties | 1+
Achrome/locale/ar/zotero/mozilla/intl.properties | 1+
Achrome/locale/bg-BG/zotero/mozilla/intl.properties | 1+
Achrome/locale/ca-AD/zotero/mozilla/intl.properties | 1+
Achrome/locale/cs-CZ/zotero/mozilla/intl.properties | 1+
Achrome/locale/da-DK/zotero/mozilla/intl.properties | 1+
Achrome/locale/de/zotero/mozilla/intl.properties | 1+
Achrome/locale/el-GR/zotero/mozilla/intl.properties | 1+
Achrome/locale/en-US/zotero/mozilla/intl.properties | 1+
Achrome/locale/es-ES/zotero/mozilla/intl.properties | 1+
Achrome/locale/et-EE/zotero/mozilla/intl.properties | 1+
Achrome/locale/eu-ES/zotero/mozilla/intl.properties | 1+
Achrome/locale/fa/zotero/mozilla/intl.properties | 1+
Achrome/locale/fi-FI/zotero/mozilla/intl.properties | 1+
Achrome/locale/fr-FR/zotero/mozilla/intl.properties | 1+
Achrome/locale/gl-ES/zotero/mozilla/intl.properties | 1+
Achrome/locale/he-IL/zotero/mozilla/intl.properties | 1+
Achrome/locale/hr-HR/zotero/mozilla/intl.properties | 1+
Achrome/locale/hu-HU/zotero/mozilla/intl.properties | 1+
Achrome/locale/id-ID/zotero/mozilla/intl.properties | 1+
Achrome/locale/is-IS/zotero/mozilla/intl.properties | 1+
Achrome/locale/it-IT/zotero/mozilla/intl.properties | 1+
Achrome/locale/ja-JP/zotero/mozilla/intl.properties | 1+
Achrome/locale/km/zotero/mozilla/intl.properties | 1+
Achrome/locale/ko-KR/zotero/mozilla/intl.properties | 1+
Achrome/locale/lt-LT/zotero/mozilla/intl.properties | 1+
Achrome/locale/mn-MN/zotero/mozilla/intl.properties | 1+
Achrome/locale/nb-NO/zotero/mozilla/intl.properties | 1+
Achrome/locale/nl-NL/zotero/mozilla/intl.properties | 1+
Achrome/locale/nn-NO/zotero/mozilla/intl.properties | 1+
Achrome/locale/pl-PL/zotero/mozilla/intl.properties | 1+
Achrome/locale/pt-BR/zotero/mozilla/intl.properties | 1+
Achrome/locale/pt-PT/zotero/mozilla/intl.properties | 1+
Achrome/locale/ro-RO/zotero/mozilla/intl.properties | 1+
Achrome/locale/ru-RU/zotero/mozilla/intl.properties | 1+
Achrome/locale/sk-SK/zotero/mozilla/intl.properties | 1+
Achrome/locale/sl-SI/zotero/mozilla/intl.properties | 1+
Achrome/locale/sr-RS/zotero/mozilla/intl.properties | 1+
Achrome/locale/sv-SE/zotero/mozilla/intl.properties | 1+
Achrome/locale/th-TH/zotero/mozilla/intl.properties | 1+
Achrome/locale/tr-TR/zotero/mozilla/intl.properties | 1+
Achrome/locale/uk-UA/zotero/mozilla/intl.properties | 1+
Achrome/locale/vi-VN/zotero/mozilla/intl.properties | 1+
Achrome/locale/zh-CN/zotero/mozilla/intl.properties | 1+
Achrome/locale/zh-TW/zotero/mozilla/intl.properties | 1+
46 files changed, 48 insertions(+), 15 deletions(-)

diff --git a/chrome/content/zotero/xpcom/zotero.js b/chrome/content/zotero/xpcom/zotero.js @@ -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 diff --git a/chrome/locale/af-ZA/zotero/mozilla/intl.properties b/chrome/locale/af-ZA/zotero/mozilla/intl.properties @@ -0,0 +1 @@ +general.useragent.locale=af-ZA diff --git a/chrome/locale/ar/zotero/mozilla/intl.properties b/chrome/locale/ar/zotero/mozilla/intl.properties @@ -0,0 +1 @@ +general.useragent.locale=ar diff --git a/chrome/locale/bg-BG/zotero/mozilla/intl.properties b/chrome/locale/bg-BG/zotero/mozilla/intl.properties @@ -0,0 +1 @@ +general.useragent.locale=bg-BG diff --git a/chrome/locale/ca-AD/zotero/mozilla/intl.properties b/chrome/locale/ca-AD/zotero/mozilla/intl.properties @@ -0,0 +1 @@ +general.useragent.locale=ca-AD diff --git a/chrome/locale/cs-CZ/zotero/mozilla/intl.properties b/chrome/locale/cs-CZ/zotero/mozilla/intl.properties @@ -0,0 +1 @@ +general.useragent.locale=cs-CZ diff --git a/chrome/locale/da-DK/zotero/mozilla/intl.properties b/chrome/locale/da-DK/zotero/mozilla/intl.properties @@ -0,0 +1 @@ +general.useragent.locale=da-DK diff --git a/chrome/locale/de/zotero/mozilla/intl.properties b/chrome/locale/de/zotero/mozilla/intl.properties @@ -0,0 +1 @@ +general.useragent.locale=de diff --git a/chrome/locale/el-GR/zotero/mozilla/intl.properties b/chrome/locale/el-GR/zotero/mozilla/intl.properties @@ -0,0 +1 @@ +general.useragent.locale=el-GR diff --git a/chrome/locale/en-US/zotero/mozilla/intl.properties b/chrome/locale/en-US/zotero/mozilla/intl.properties @@ -0,0 +1 @@ +general.useragent.locale=en-US diff --git a/chrome/locale/es-ES/zotero/mozilla/intl.properties b/chrome/locale/es-ES/zotero/mozilla/intl.properties @@ -0,0 +1 @@ +general.useragent.locale=es-ES diff --git a/chrome/locale/et-EE/zotero/mozilla/intl.properties b/chrome/locale/et-EE/zotero/mozilla/intl.properties @@ -0,0 +1 @@ +general.useragent.locale=et-EE diff --git a/chrome/locale/eu-ES/zotero/mozilla/intl.properties b/chrome/locale/eu-ES/zotero/mozilla/intl.properties @@ -0,0 +1 @@ +general.useragent.locale=eu-ES diff --git a/chrome/locale/fa/zotero/mozilla/intl.properties b/chrome/locale/fa/zotero/mozilla/intl.properties @@ -0,0 +1 @@ +general.useragent.locale=fa diff --git a/chrome/locale/fi-FI/zotero/mozilla/intl.properties b/chrome/locale/fi-FI/zotero/mozilla/intl.properties @@ -0,0 +1 @@ +general.useragent.locale=fi-FI diff --git a/chrome/locale/fr-FR/zotero/mozilla/intl.properties b/chrome/locale/fr-FR/zotero/mozilla/intl.properties @@ -0,0 +1 @@ +general.useragent.locale=fr-FR diff --git a/chrome/locale/gl-ES/zotero/mozilla/intl.properties b/chrome/locale/gl-ES/zotero/mozilla/intl.properties @@ -0,0 +1 @@ +general.useragent.locale=gl-ES diff --git a/chrome/locale/he-IL/zotero/mozilla/intl.properties b/chrome/locale/he-IL/zotero/mozilla/intl.properties @@ -0,0 +1 @@ +general.useragent.locale=he-IL diff --git a/chrome/locale/hr-HR/zotero/mozilla/intl.properties b/chrome/locale/hr-HR/zotero/mozilla/intl.properties @@ -0,0 +1 @@ +general.useragent.locale=hr-HR diff --git a/chrome/locale/hu-HU/zotero/mozilla/intl.properties b/chrome/locale/hu-HU/zotero/mozilla/intl.properties @@ -0,0 +1 @@ +general.useragent.locale=hu-HU diff --git a/chrome/locale/id-ID/zotero/mozilla/intl.properties b/chrome/locale/id-ID/zotero/mozilla/intl.properties @@ -0,0 +1 @@ +general.useragent.locale=id-ID diff --git a/chrome/locale/is-IS/zotero/mozilla/intl.properties b/chrome/locale/is-IS/zotero/mozilla/intl.properties @@ -0,0 +1 @@ +general.useragent.locale=is-IS diff --git a/chrome/locale/it-IT/zotero/mozilla/intl.properties b/chrome/locale/it-IT/zotero/mozilla/intl.properties @@ -0,0 +1 @@ +general.useragent.locale=it-IT diff --git a/chrome/locale/ja-JP/zotero/mozilla/intl.properties b/chrome/locale/ja-JP/zotero/mozilla/intl.properties @@ -0,0 +1 @@ +general.useragent.locale=ja-JP diff --git a/chrome/locale/km/zotero/mozilla/intl.properties b/chrome/locale/km/zotero/mozilla/intl.properties @@ -0,0 +1 @@ +general.useragent.locale=km diff --git a/chrome/locale/ko-KR/zotero/mozilla/intl.properties b/chrome/locale/ko-KR/zotero/mozilla/intl.properties @@ -0,0 +1 @@ +general.useragent.locale=ko-KR diff --git a/chrome/locale/lt-LT/zotero/mozilla/intl.properties b/chrome/locale/lt-LT/zotero/mozilla/intl.properties @@ -0,0 +1 @@ +general.useragent.locale=lt-LT diff --git a/chrome/locale/mn-MN/zotero/mozilla/intl.properties b/chrome/locale/mn-MN/zotero/mozilla/intl.properties @@ -0,0 +1 @@ +general.useragent.locale=mn-MN diff --git a/chrome/locale/nb-NO/zotero/mozilla/intl.properties b/chrome/locale/nb-NO/zotero/mozilla/intl.properties @@ -0,0 +1 @@ +general.useragent.locale=nb-NO diff --git a/chrome/locale/nl-NL/zotero/mozilla/intl.properties b/chrome/locale/nl-NL/zotero/mozilla/intl.properties @@ -0,0 +1 @@ +general.useragent.locale=nl-NL diff --git a/chrome/locale/nn-NO/zotero/mozilla/intl.properties b/chrome/locale/nn-NO/zotero/mozilla/intl.properties @@ -0,0 +1 @@ +general.useragent.locale=nn-NO diff --git a/chrome/locale/pl-PL/zotero/mozilla/intl.properties b/chrome/locale/pl-PL/zotero/mozilla/intl.properties @@ -0,0 +1 @@ +general.useragent.locale=pl-PL diff --git a/chrome/locale/pt-BR/zotero/mozilla/intl.properties b/chrome/locale/pt-BR/zotero/mozilla/intl.properties @@ -0,0 +1 @@ +general.useragent.locale=pt-BR diff --git a/chrome/locale/pt-PT/zotero/mozilla/intl.properties b/chrome/locale/pt-PT/zotero/mozilla/intl.properties @@ -0,0 +1 @@ +general.useragent.locale=pt-PT diff --git a/chrome/locale/ro-RO/zotero/mozilla/intl.properties b/chrome/locale/ro-RO/zotero/mozilla/intl.properties @@ -0,0 +1 @@ +general.useragent.locale=ro-RO diff --git a/chrome/locale/ru-RU/zotero/mozilla/intl.properties b/chrome/locale/ru-RU/zotero/mozilla/intl.properties @@ -0,0 +1 @@ +general.useragent.locale=ru-RU diff --git a/chrome/locale/sk-SK/zotero/mozilla/intl.properties b/chrome/locale/sk-SK/zotero/mozilla/intl.properties @@ -0,0 +1 @@ +general.useragent.locale=sk-SK diff --git a/chrome/locale/sl-SI/zotero/mozilla/intl.properties b/chrome/locale/sl-SI/zotero/mozilla/intl.properties @@ -0,0 +1 @@ +general.useragent.locale=sl-SI diff --git a/chrome/locale/sr-RS/zotero/mozilla/intl.properties b/chrome/locale/sr-RS/zotero/mozilla/intl.properties @@ -0,0 +1 @@ +general.useragent.locale=sr-RS diff --git a/chrome/locale/sv-SE/zotero/mozilla/intl.properties b/chrome/locale/sv-SE/zotero/mozilla/intl.properties @@ -0,0 +1 @@ +general.useragent.locale=sv-SE diff --git a/chrome/locale/th-TH/zotero/mozilla/intl.properties b/chrome/locale/th-TH/zotero/mozilla/intl.properties @@ -0,0 +1 @@ +general.useragent.locale=th-TH diff --git a/chrome/locale/tr-TR/zotero/mozilla/intl.properties b/chrome/locale/tr-TR/zotero/mozilla/intl.properties @@ -0,0 +1 @@ +general.useragent.locale=tr-TR diff --git a/chrome/locale/uk-UA/zotero/mozilla/intl.properties b/chrome/locale/uk-UA/zotero/mozilla/intl.properties @@ -0,0 +1 @@ +general.useragent.locale=uk-UA diff --git a/chrome/locale/vi-VN/zotero/mozilla/intl.properties b/chrome/locale/vi-VN/zotero/mozilla/intl.properties @@ -0,0 +1 @@ +general.useragent.locale=vi-VN diff --git a/chrome/locale/zh-CN/zotero/mozilla/intl.properties b/chrome/locale/zh-CN/zotero/mozilla/intl.properties @@ -0,0 +1 @@ +general.useragent.locale=zh-CN diff --git a/chrome/locale/zh-TW/zotero/mozilla/intl.properties b/chrome/locale/zh-TW/zotero/mozilla/intl.properties @@ -0,0 +1 @@ +general.useragent.locale=zh-TW