diff --git a/chrome/content/zotero/xpcom/zotero.js b/chrome/content/zotero/xpcom/zotero.js index 7c16c22e0c..753bf50152 100644 --- a/chrome/content/zotero/xpcom/zotero.js +++ b/chrome/content/zotero/xpcom/zotero.js @@ -225,18 +225,18 @@ Services.scriptloader.loadSubScript("resource://zotero/polyfill.js"); Zotero.browser = "g"; // 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 - // getString() when a number is based - PluralForm.get(1, '1;2;3;4;5;6;7;8;9;10;11;12;13;14;15;16') + var intlProps = Services.strings.createBundle("chrome://zotero/locale/mozilla/intl.properties"); + this.locale = intlProps.GetStringFromName("general.useragent.locale"); + let [get, numForms] = PluralForm.makeGetter(intlProps.GetStringFromName("pluralRule")); + this.pluralFormGet = get; + this.pluralFormNumForms = numForms; // Also load the brand as appName var brandBundle = Services.strings.createBundle("chrome://branding/locale/brand.properties"); this.appName = brandBundle.GetStringFromName("brandShortName"); + _localizedStringBundle = Services.strings.createBundle("chrome://zotero/locale/zotero.properties"); + // Set the locale direction to Zotero.dir // DEBUG: is there a better way to get the entity from JS? var xmlhttp = Components.classes["@mozilla.org/xmlextras/xmlhttprequest;1"] @@ -1239,11 +1239,11 @@ Services.scriptloader.loadSubScript("resource://zotero/polyfill.js"); // If not enough available forms, use last one -- PluralForm.get() uses first by // default, but it's more likely that a localizer will translate the two English // strings with some plural form as the second one, so we might as well use that - if (availableForms.length < PluralForm.numForms()) { + if (availableForms.length < this.pluralFormNumForms()) { l10n = availableForms[availableForms.length - 1]; } else { - l10n = PluralForm.get(num, l10n); + l10n = this.pluralFormGet(num, l10n); } } } diff --git a/chrome/locale/af-ZA/zotero/mozilla/intl.properties b/chrome/locale/af-ZA/zotero/mozilla/intl.properties index 1966121af2..1144f6c223 100644 --- a/chrome/locale/af-ZA/zotero/mozilla/intl.properties +++ b/chrome/locale/af-ZA/zotero/mozilla/intl.properties @@ -1 +1,2 @@ general.useragent.locale=af-ZA +pluralRule=1 diff --git a/chrome/locale/ar/zotero/mozilla/intl.properties b/chrome/locale/ar/zotero/mozilla/intl.properties index d41b5792e9..2cbb529e58 100644 --- a/chrome/locale/ar/zotero/mozilla/intl.properties +++ b/chrome/locale/ar/zotero/mozilla/intl.properties @@ -1 +1,2 @@ general.useragent.locale=ar +pluralRule=12 diff --git a/chrome/locale/bg-BG/zotero/mozilla/intl.properties b/chrome/locale/bg-BG/zotero/mozilla/intl.properties index a4a12ddcad..b5594341b3 100644 --- a/chrome/locale/bg-BG/zotero/mozilla/intl.properties +++ b/chrome/locale/bg-BG/zotero/mozilla/intl.properties @@ -1 +1,2 @@ general.useragent.locale=bg-BG +pluralRule=1 diff --git a/chrome/locale/ca-AD/zotero/mozilla/intl.properties b/chrome/locale/ca-AD/zotero/mozilla/intl.properties index 2b948bc563..649ea02a4b 100644 --- a/chrome/locale/ca-AD/zotero/mozilla/intl.properties +++ b/chrome/locale/ca-AD/zotero/mozilla/intl.properties @@ -1 +1,2 @@ general.useragent.locale=ca-AD +pluralRule=1 diff --git a/chrome/locale/cs-CZ/zotero/mozilla/intl.properties b/chrome/locale/cs-CZ/zotero/mozilla/intl.properties index 2fdb895944..dc309c9a80 100644 --- a/chrome/locale/cs-CZ/zotero/mozilla/intl.properties +++ b/chrome/locale/cs-CZ/zotero/mozilla/intl.properties @@ -1 +1,2 @@ general.useragent.locale=cs-CZ +pluralRule=8 diff --git a/chrome/locale/da-DK/zotero/mozilla/intl.properties b/chrome/locale/da-DK/zotero/mozilla/intl.properties index db378db882..4ba3bfb307 100644 --- a/chrome/locale/da-DK/zotero/mozilla/intl.properties +++ b/chrome/locale/da-DK/zotero/mozilla/intl.properties @@ -1 +1,2 @@ general.useragent.locale=da-DK +pluralRule=1 diff --git a/chrome/locale/de/zotero/mozilla/intl.properties b/chrome/locale/de/zotero/mozilla/intl.properties index b4a6e5c100..c70ac2f739 100644 --- a/chrome/locale/de/zotero/mozilla/intl.properties +++ b/chrome/locale/de/zotero/mozilla/intl.properties @@ -1 +1,2 @@ general.useragent.locale=de +pluralRule=1 diff --git a/chrome/locale/el-GR/zotero/mozilla/intl.properties b/chrome/locale/el-GR/zotero/mozilla/intl.properties index c7aa7332af..5af03b6698 100644 --- a/chrome/locale/el-GR/zotero/mozilla/intl.properties +++ b/chrome/locale/el-GR/zotero/mozilla/intl.properties @@ -1 +1,2 @@ general.useragent.locale=el-GR +pluralRule=1 diff --git a/chrome/locale/en-US/zotero/mozilla/intl.properties b/chrome/locale/en-US/zotero/mozilla/intl.properties index 8a2461fa9f..2ed2374872 100644 --- a/chrome/locale/en-US/zotero/mozilla/intl.properties +++ b/chrome/locale/en-US/zotero/mozilla/intl.properties @@ -1 +1,2 @@ general.useragent.locale=en-US +pluralRule=1 diff --git a/chrome/locale/es-ES/zotero/mozilla/intl.properties b/chrome/locale/es-ES/zotero/mozilla/intl.properties index 86f5244220..f4d91da74d 100644 --- a/chrome/locale/es-ES/zotero/mozilla/intl.properties +++ b/chrome/locale/es-ES/zotero/mozilla/intl.properties @@ -1 +1,2 @@ -general.useragent.locale=es-ES +general.useragent.locale =es-ES +pluralRule = 1 diff --git a/chrome/locale/et-EE/zotero/mozilla/intl.properties b/chrome/locale/et-EE/zotero/mozilla/intl.properties index 12647ff3d0..4aff8429f4 100644 --- a/chrome/locale/et-EE/zotero/mozilla/intl.properties +++ b/chrome/locale/et-EE/zotero/mozilla/intl.properties @@ -1 +1,2 @@ general.useragent.locale=et-EE +pluralRule=1 diff --git a/chrome/locale/eu-ES/zotero/mozilla/intl.properties b/chrome/locale/eu-ES/zotero/mozilla/intl.properties index f60f82ddab..9f6a533ad4 100644 --- a/chrome/locale/eu-ES/zotero/mozilla/intl.properties +++ b/chrome/locale/eu-ES/zotero/mozilla/intl.properties @@ -1 +1,2 @@ general.useragent.locale=eu-ES +pluralRule=1 diff --git a/chrome/locale/fa/zotero/mozilla/intl.properties b/chrome/locale/fa/zotero/mozilla/intl.properties index 3a6fb610b3..e296712dbc 100644 --- a/chrome/locale/fa/zotero/mozilla/intl.properties +++ b/chrome/locale/fa/zotero/mozilla/intl.properties @@ -1 +1,2 @@ general.useragent.locale=fa +pluralRule=0 diff --git a/chrome/locale/fi-FI/zotero/mozilla/intl.properties b/chrome/locale/fi-FI/zotero/mozilla/intl.properties index ae72ffdc51..113a31c499 100644 --- a/chrome/locale/fi-FI/zotero/mozilla/intl.properties +++ b/chrome/locale/fi-FI/zotero/mozilla/intl.properties @@ -1 +1,2 @@ general.useragent.locale=fi-FI +pluralRule=1 diff --git a/chrome/locale/fr-FR/zotero/mozilla/intl.properties b/chrome/locale/fr-FR/zotero/mozilla/intl.properties index 94a37a4c8e..3d6b46dc90 100644 --- a/chrome/locale/fr-FR/zotero/mozilla/intl.properties +++ b/chrome/locale/fr-FR/zotero/mozilla/intl.properties @@ -1 +1,2 @@ general.useragent.locale=fr-FR +pluralRule=2 diff --git a/chrome/locale/gl-ES/zotero/mozilla/intl.properties b/chrome/locale/gl-ES/zotero/mozilla/intl.properties index f129787ad9..2ed2374872 100644 --- a/chrome/locale/gl-ES/zotero/mozilla/intl.properties +++ b/chrome/locale/gl-ES/zotero/mozilla/intl.properties @@ -1 +1,2 @@ -general.useragent.locale=gl-ES +general.useragent.locale=en-US +pluralRule=1 diff --git a/chrome/locale/he-IL/zotero/mozilla/intl.properties b/chrome/locale/he-IL/zotero/mozilla/intl.properties index d76ef1d842..1aca412dff 100644 --- a/chrome/locale/he-IL/zotero/mozilla/intl.properties +++ b/chrome/locale/he-IL/zotero/mozilla/intl.properties @@ -1 +1,2 @@ general.useragent.locale=he-IL +pluralRule=1 diff --git a/chrome/locale/hr-HR/zotero/mozilla/intl.properties b/chrome/locale/hr-HR/zotero/mozilla/intl.properties index bcb693d63a..5d49e39e29 100644 --- a/chrome/locale/hr-HR/zotero/mozilla/intl.properties +++ b/chrome/locale/hr-HR/zotero/mozilla/intl.properties @@ -1 +1,2 @@ general.useragent.locale=hr-HR +pluralRule=7 diff --git a/chrome/locale/hu-HU/zotero/mozilla/intl.properties b/chrome/locale/hu-HU/zotero/mozilla/intl.properties index 0bd7249c93..182c675bfc 100644 --- a/chrome/locale/hu-HU/zotero/mozilla/intl.properties +++ b/chrome/locale/hu-HU/zotero/mozilla/intl.properties @@ -1 +1,2 @@ general.useragent.locale=hu-HU +pluralRule=1 diff --git a/chrome/locale/id-ID/zotero/mozilla/intl.properties b/chrome/locale/id-ID/zotero/mozilla/intl.properties index 5a67e7155e..0fdd2d46e8 100644 --- a/chrome/locale/id-ID/zotero/mozilla/intl.properties +++ b/chrome/locale/id-ID/zotero/mozilla/intl.properties @@ -1 +1,2 @@ general.useragent.locale=id-ID +pluralRule=0 diff --git a/chrome/locale/is-IS/zotero/mozilla/intl.properties b/chrome/locale/is-IS/zotero/mozilla/intl.properties index 28a5d93a4f..2ab50500b9 100644 --- a/chrome/locale/is-IS/zotero/mozilla/intl.properties +++ b/chrome/locale/is-IS/zotero/mozilla/intl.properties @@ -1 +1,2 @@ general.useragent.locale=is-IS +pluralRule=15 diff --git a/chrome/locale/it-IT/zotero/mozilla/intl.properties b/chrome/locale/it-IT/zotero/mozilla/intl.properties index 7be31b2b29..97caf5aaa7 100644 --- a/chrome/locale/it-IT/zotero/mozilla/intl.properties +++ b/chrome/locale/it-IT/zotero/mozilla/intl.properties @@ -1 +1,2 @@ -general.useragent.locale=it-IT +general.useragent.locale =it-IT +pluralRule = 1 diff --git a/chrome/locale/ja-JP/zotero/mozilla/intl.properties b/chrome/locale/ja-JP/zotero/mozilla/intl.properties index 641b5291d0..12dc41cd3b 100644 --- a/chrome/locale/ja-JP/zotero/mozilla/intl.properties +++ b/chrome/locale/ja-JP/zotero/mozilla/intl.properties @@ -1 +1,2 @@ -general.useragent.locale=ja-JP +general.useragent.locale =ja-JP +pluralRule = 0 diff --git a/chrome/locale/km/zotero/mozilla/intl.properties b/chrome/locale/km/zotero/mozilla/intl.properties index a74dbce9d8..5d02ea2558 100644 --- a/chrome/locale/km/zotero/mozilla/intl.properties +++ b/chrome/locale/km/zotero/mozilla/intl.properties @@ -1 +1,2 @@ general.useragent.locale=km +pluralRule=1 diff --git a/chrome/locale/ko-KR/zotero/mozilla/intl.properties b/chrome/locale/ko-KR/zotero/mozilla/intl.properties index 73ac368b08..a32cdaf831 100644 --- a/chrome/locale/ko-KR/zotero/mozilla/intl.properties +++ b/chrome/locale/ko-KR/zotero/mozilla/intl.properties @@ -1 +1,2 @@ general.useragent.locale=ko-KR +pluralRule=0 diff --git a/chrome/locale/lt-LT/zotero/mozilla/intl.properties b/chrome/locale/lt-LT/zotero/mozilla/intl.properties index 550c13b2b6..5147c10d51 100644 --- a/chrome/locale/lt-LT/zotero/mozilla/intl.properties +++ b/chrome/locale/lt-LT/zotero/mozilla/intl.properties @@ -1 +1,2 @@ general.useragent.locale=lt-LT +pluralRule=6 diff --git a/chrome/locale/mn-MN/zotero/mozilla/intl.properties b/chrome/locale/mn-MN/zotero/mozilla/intl.properties index 3818922cdb..2ed2374872 100644 --- a/chrome/locale/mn-MN/zotero/mozilla/intl.properties +++ b/chrome/locale/mn-MN/zotero/mozilla/intl.properties @@ -1 +1,2 @@ -general.useragent.locale=mn-MN +general.useragent.locale=en-US +pluralRule=1 diff --git a/chrome/locale/nb-NO/zotero/mozilla/intl.properties b/chrome/locale/nb-NO/zotero/mozilla/intl.properties index e02a90d7eb..19aaf41ef7 100644 --- a/chrome/locale/nb-NO/zotero/mozilla/intl.properties +++ b/chrome/locale/nb-NO/zotero/mozilla/intl.properties @@ -1 +1,2 @@ general.useragent.locale=nb-NO +pluralRule=1 diff --git a/chrome/locale/nl-NL/zotero/mozilla/intl.properties b/chrome/locale/nl-NL/zotero/mozilla/intl.properties index 21a4f2c382..cc11e51b2f 100644 --- a/chrome/locale/nl-NL/zotero/mozilla/intl.properties +++ b/chrome/locale/nl-NL/zotero/mozilla/intl.properties @@ -1 +1,2 @@ general.useragent.locale=nl-NL +pluralRule=1 diff --git a/chrome/locale/nn-NO/zotero/mozilla/intl.properties b/chrome/locale/nn-NO/zotero/mozilla/intl.properties index 3d32a5d912..df7764dcbe 100644 --- a/chrome/locale/nn-NO/zotero/mozilla/intl.properties +++ b/chrome/locale/nn-NO/zotero/mozilla/intl.properties @@ -1 +1,2 @@ general.useragent.locale=nn-NO +pluralRule=1 diff --git a/chrome/locale/pl-PL/zotero/mozilla/intl.properties b/chrome/locale/pl-PL/zotero/mozilla/intl.properties index ad527ebd82..b9c6bb7205 100644 --- a/chrome/locale/pl-PL/zotero/mozilla/intl.properties +++ b/chrome/locale/pl-PL/zotero/mozilla/intl.properties @@ -1 +1,2 @@ general.useragent.locale=pl-PL +pluralRule=9 diff --git a/chrome/locale/pt-BR/zotero/mozilla/intl.properties b/chrome/locale/pt-BR/zotero/mozilla/intl.properties index 4a9d349676..a38e676bf3 100644 --- a/chrome/locale/pt-BR/zotero/mozilla/intl.properties +++ b/chrome/locale/pt-BR/zotero/mozilla/intl.properties @@ -1 +1,2 @@ general.useragent.locale=pt-BR +pluralRule=1 diff --git a/chrome/locale/pt-PT/zotero/mozilla/intl.properties b/chrome/locale/pt-PT/zotero/mozilla/intl.properties index fb754e65cd..76d1998a76 100644 --- a/chrome/locale/pt-PT/zotero/mozilla/intl.properties +++ b/chrome/locale/pt-PT/zotero/mozilla/intl.properties @@ -1 +1,2 @@ general.useragent.locale=pt-PT +pluralRule=1 diff --git a/chrome/locale/ro-RO/zotero/mozilla/intl.properties b/chrome/locale/ro-RO/zotero/mozilla/intl.properties index f6f95698e3..f2890b47fe 100644 --- a/chrome/locale/ro-RO/zotero/mozilla/intl.properties +++ b/chrome/locale/ro-RO/zotero/mozilla/intl.properties @@ -1 +1,2 @@ general.useragent.locale=ro-RO +pluralRule=1 diff --git a/chrome/locale/ru-RU/zotero/mozilla/intl.properties b/chrome/locale/ru-RU/zotero/mozilla/intl.properties index 8bba235474..b50bbc29c3 100644 --- a/chrome/locale/ru-RU/zotero/mozilla/intl.properties +++ b/chrome/locale/ru-RU/zotero/mozilla/intl.properties @@ -1 +1,2 @@ -general.useragent.locale=ru-RU +general.useragent.locale =ru-RU +pluralRule = 7 diff --git a/chrome/locale/sk-SK/zotero/mozilla/intl.properties b/chrome/locale/sk-SK/zotero/mozilla/intl.properties index 4b3a46cd2a..cd9818a25a 100644 --- a/chrome/locale/sk-SK/zotero/mozilla/intl.properties +++ b/chrome/locale/sk-SK/zotero/mozilla/intl.properties @@ -1 +1,2 @@ general.useragent.locale=sk-SK +pluralRule=8 diff --git a/chrome/locale/sl-SI/zotero/mozilla/intl.properties b/chrome/locale/sl-SI/zotero/mozilla/intl.properties index 21d24fd0b5..f49a46998c 100644 --- a/chrome/locale/sl-SI/zotero/mozilla/intl.properties +++ b/chrome/locale/sl-SI/zotero/mozilla/intl.properties @@ -1 +1,2 @@ general.useragent.locale=sl-SI +pluralRule=10 diff --git a/chrome/locale/sr-RS/zotero/mozilla/intl.properties b/chrome/locale/sr-RS/zotero/mozilla/intl.properties index 872f9d77bf..073efa72eb 100644 --- a/chrome/locale/sr-RS/zotero/mozilla/intl.properties +++ b/chrome/locale/sr-RS/zotero/mozilla/intl.properties @@ -1 +1,2 @@ general.useragent.locale=sr-RS +pluralRule=7 diff --git a/chrome/locale/sv-SE/zotero/mozilla/intl.properties b/chrome/locale/sv-SE/zotero/mozilla/intl.properties index fbc9d877d7..92aecf1036 100644 --- a/chrome/locale/sv-SE/zotero/mozilla/intl.properties +++ b/chrome/locale/sv-SE/zotero/mozilla/intl.properties @@ -1 +1,2 @@ general.useragent.locale=sv-SE +pluralRule=1 diff --git a/chrome/locale/th-TH/zotero/mozilla/intl.properties b/chrome/locale/th-TH/zotero/mozilla/intl.properties index 489c5e0095..b47e8e41f0 100644 --- a/chrome/locale/th-TH/zotero/mozilla/intl.properties +++ b/chrome/locale/th-TH/zotero/mozilla/intl.properties @@ -1 +1,2 @@ general.useragent.locale=th-TH +pluralRule=0 diff --git a/chrome/locale/tr-TR/zotero/mozilla/intl.properties b/chrome/locale/tr-TR/zotero/mozilla/intl.properties index 8f901a19ce..7380c62183 100644 --- a/chrome/locale/tr-TR/zotero/mozilla/intl.properties +++ b/chrome/locale/tr-TR/zotero/mozilla/intl.properties @@ -1 +1,2 @@ general.useragent.locale=tr-TR +pluralRule=0 diff --git a/chrome/locale/uk-UA/zotero/mozilla/intl.properties b/chrome/locale/uk-UA/zotero/mozilla/intl.properties index 64452d3592..451daafbef 100644 --- a/chrome/locale/uk-UA/zotero/mozilla/intl.properties +++ b/chrome/locale/uk-UA/zotero/mozilla/intl.properties @@ -1 +1,2 @@ general.useragent.locale=uk-UA +pluralRule=7 diff --git a/chrome/locale/vi-VN/zotero/mozilla/intl.properties b/chrome/locale/vi-VN/zotero/mozilla/intl.properties index 82e8a0f4ce..7bd8ac6465 100644 --- a/chrome/locale/vi-VN/zotero/mozilla/intl.properties +++ b/chrome/locale/vi-VN/zotero/mozilla/intl.properties @@ -1 +1,2 @@ general.useragent.locale=vi-VN +pluralRule=1 diff --git a/chrome/locale/zh-CN/zotero/mozilla/intl.properties b/chrome/locale/zh-CN/zotero/mozilla/intl.properties index 52f8d7c4f4..98762d07ed 100644 --- a/chrome/locale/zh-CN/zotero/mozilla/intl.properties +++ b/chrome/locale/zh-CN/zotero/mozilla/intl.properties @@ -1 +1,2 @@ general.useragent.locale=zh-CN +pluralRule=1 diff --git a/chrome/locale/zh-TW/zotero/mozilla/intl.properties b/chrome/locale/zh-TW/zotero/mozilla/intl.properties index 4e35cda69b..fd4ad32ae3 100644 --- a/chrome/locale/zh-TW/zotero/mozilla/intl.properties +++ b/chrome/locale/zh-TW/zotero/mozilla/intl.properties @@ -1 +1,2 @@ general.useragent.locale=zh-TW +pluralRule=0