Bug 1441146 - Sync DevTools plural-form.js with intl/PluralForm.jsm r?jdescottes draft
authorFrancesco Lodolo (:flod) <flod@lodolo.net>
Mon, 26 Feb 2018 14:41:26 +0100
changeset 759718 1165bf5e37396d2026fcbe43055be5f0e398b779
parent 759717 a1c1afcb7f23a190abd37e8e1b8889976570cb3a
push id100438
push userbmo:francesco.lodolo@gmail.com
push dateMon, 26 Feb 2018 13:42:27 +0000
reviewersjdescottes
bugs1441146
milestone60.0a1
Bug 1441146 - Sync DevTools plural-form.js with intl/PluralForm.jsm r?jdescottes MozReview-Commit-ID: 2FstwF4gpDO
devtools/shared/plural-form.js
--- a/devtools/shared/plural-form.js
+++ b/devtools/shared/plural-form.js
@@ -48,17 +48,17 @@ const L10N = new LocalizationHelper("too
 const gFunctions = [
   // 0: Chinese
   [1, (n) => 0],
   // 1: English
   [2, (n) => n!=1?1:0],
   // 2: French
   [2, (n) => n>1?1:0],
   // 3: Latvian
-  [3, (n) => n%10==1&&n%100!=11?1:n!=0?2:0],
+  [3, (n) => n%10==1&&n%100!=11?1:n%10==0?0:2],
   // 4: Scottish Gaelic
   [4, (n) => n==1||n==11?0:n==2||n==12?1:n>0&&n<20?2:3],
   // 5: Romanian
   [3, (n) => n==1?0:n==0||n%100>0&&n%100<20?1:2],
   // 6: Lithuanian
   [3, (n) => n%10==1&&n%100!=11?0:n%10>=2&&(n%100<10||n%100>=20)?2:1],
   // 7: Russian
   [3, (n) => n%10==1&&n%100!=11?0:n%10>=2&&n%10<=4&&(n%100<10||n%100>=20)?1:2],
@@ -69,22 +69,26 @@ const gFunctions = [
   // 10: Slovenian
   [4, (n) => n%100==1?0:n%100==2?1:n%100==3||n%100==4?2:3],
   // 11: Irish Gaeilge
   [5, (n) => n==1?0:n==2?1:n>=3&&n<=6?2:n>=7&&n<=10?3:4],
   // 12: Arabic
   [6, (n) => n==0?5:n==1?0:n==2?1:n%100>=3&&n%100<=10?2:n%100>=11&&n%100<=99?3:4],
   // 13: Maltese
   [4, (n) => n==1?0:n==0||n%100>0&&n%100<=10?1:n%100>10&&n%100<20?2:3],
-  // 14: Macedonian
+  // 14: Unused
   [3, (n) => n%10==1?0:n%10==2?1:2],
-  // 15: Icelandic
+  // 15: Icelandic, Macedonian
   [2, (n) => n%10==1&&n%100!=11?0:1],
   // 16: Breton
   [5, (n) => n%10==1&&n%100!=11&&n%100!=71&&n%100!=91?0:n%10==2&&n%100!=12&&n%100!=72&&n%100!=92?1:(n%10==3||n%10==4||n%10==9)&&n%100!=13&&n%100!=14&&n%100!=19&&n%100!=73&&n%100!=74&&n%100!=79&&n%100!=93&&n%100!=94&&n%100!=99?2:n%1000000==0&&n!=0?3:4],
+  // 17: Shuar
+  [2, (n) => n!=0?1:0],
+  // 18: Welsh
+  [6, (n) => n==0?0:n==1?1:n==2?2:n==3?3:n==6?4:5],
 ];
 
 const PluralForm = {
   /**
    * Get the correct plural form of a word based on the number
    *
    * @param aNum
    *        The number to decide which plural form to use