@formatjs/intl-pluralrules 6.3.16 → 6.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (187) hide show
  1. package/index.d.ts +12 -1
  2. package/index.js +9 -1
  3. package/index.js.map +1 -1
  4. package/locale-data/af.js +2 -2
  5. package/locale-data/ak.js +2 -2
  6. package/locale-data/am.js +2 -2
  7. package/locale-data/an.js +2 -2
  8. package/locale-data/ar.js +32 -16
  9. package/locale-data/ars.js +32 -16
  10. package/locale-data/as.js +14 -14
  11. package/locale-data/asa.js +2 -2
  12. package/locale-data/az.js +26 -10
  13. package/locale-data/bal.js +4 -4
  14. package/locale-data/be.js +26 -10
  15. package/locale-data/bem.js +2 -2
  16. package/locale-data/bez.js +2 -2
  17. package/locale-data/bg.js +2 -2
  18. package/locale-data/bho.js +2 -2
  19. package/locale-data/blo.js +14 -14
  20. package/locale-data/bn.js +14 -14
  21. package/locale-data/br.js +28 -12
  22. package/locale-data/brx.js +2 -2
  23. package/locale-data/bs.js +22 -6
  24. package/locale-data/ca.js +28 -12
  25. package/locale-data/ce.js +2 -2
  26. package/locale-data/ceb.js +18 -2
  27. package/locale-data/cgg.js +2 -2
  28. package/locale-data/chr.js +2 -2
  29. package/locale-data/ckb.js +2 -2
  30. package/locale-data/cs.js +4 -4
  31. package/locale-data/csw.js +2 -2
  32. package/locale-data/cv.js +6 -6
  33. package/locale-data/cy.js +32 -32
  34. package/locale-data/da.js +2 -2
  35. package/locale-data/doi.js +2 -2
  36. package/locale-data/dsb.js +24 -8
  37. package/locale-data/dv.js +2 -2
  38. package/locale-data/ee.js +2 -2
  39. package/locale-data/el.js +2 -2
  40. package/locale-data/en.js +24 -8
  41. package/locale-data/eo.js +2 -2
  42. package/locale-data/es.js +22 -6
  43. package/locale-data/eu.js +2 -2
  44. package/locale-data/fa.js +2 -2
  45. package/locale-data/fil.js +20 -4
  46. package/locale-data/fo.js +2 -2
  47. package/locale-data/fr.js +22 -6
  48. package/locale-data/fur.js +2 -2
  49. package/locale-data/ga.js +14 -14
  50. package/locale-data/gd.js +16 -16
  51. package/locale-data/gsw.js +2 -2
  52. package/locale-data/gu.js +14 -14
  53. package/locale-data/guw.js +2 -2
  54. package/locale-data/gv.js +26 -10
  55. package/locale-data/ha.js +2 -2
  56. package/locale-data/haw.js +2 -2
  57. package/locale-data/hi.js +14 -14
  58. package/locale-data/hr.js +22 -6
  59. package/locale-data/hsb.js +24 -8
  60. package/locale-data/hu.js +4 -4
  61. package/locale-data/hy.js +2 -2
  62. package/locale-data/is.js +18 -2
  63. package/locale-data/it.js +22 -6
  64. package/locale-data/iu.js +4 -4
  65. package/locale-data/jgo.js +2 -2
  66. package/locale-data/jmc.js +2 -2
  67. package/locale-data/ka.js +22 -6
  68. package/locale-data/kaj.js +2 -2
  69. package/locale-data/kcg.js +2 -2
  70. package/locale-data/kk.js +20 -4
  71. package/locale-data/kkj.js +2 -2
  72. package/locale-data/kl.js +2 -2
  73. package/locale-data/kn.js +2 -2
  74. package/locale-data/kok-Latn.js +10 -10
  75. package/locale-data/kok.js +10 -10
  76. package/locale-data/ks.js +2 -2
  77. package/locale-data/ksb.js +2 -2
  78. package/locale-data/ksh.js +6 -6
  79. package/locale-data/ku.js +2 -2
  80. package/locale-data/kw.js +38 -22
  81. package/locale-data/ky.js +2 -2
  82. package/locale-data/lag.js +6 -6
  83. package/locale-data/lb.js +2 -2
  84. package/locale-data/lg.js +2 -2
  85. package/locale-data/lij.js +2 -2
  86. package/locale-data/lld.js +22 -6
  87. package/locale-data/ln.js +2 -2
  88. package/locale-data/lo.js +2 -2
  89. package/locale-data/lt.js +22 -6
  90. package/locale-data/lv.js +22 -6
  91. package/locale-data/mas.js +2 -2
  92. package/locale-data/mg.js +2 -2
  93. package/locale-data/mgo.js +2 -2
  94. package/locale-data/mk.js +26 -10
  95. package/locale-data/ml.js +2 -2
  96. package/locale-data/mn.js +2 -2
  97. package/locale-data/mo.js +22 -6
  98. package/locale-data/mr.js +10 -10
  99. package/locale-data/ms.js +2 -2
  100. package/locale-data/mt.js +28 -12
  101. package/locale-data/nah.js +2 -2
  102. package/locale-data/naq.js +4 -4
  103. package/locale-data/nb.js +2 -2
  104. package/locale-data/nd.js +2 -2
  105. package/locale-data/ne.js +4 -4
  106. package/locale-data/nn.js +2 -2
  107. package/locale-data/nnh.js +2 -2
  108. package/locale-data/no.js +2 -2
  109. package/locale-data/nr.js +2 -2
  110. package/locale-data/nso.js +2 -2
  111. package/locale-data/ny.js +2 -2
  112. package/locale-data/nyn.js +2 -2
  113. package/locale-data/om.js +2 -2
  114. package/locale-data/or.js +14 -14
  115. package/locale-data/os.js +2 -2
  116. package/locale-data/pa.js +2 -2
  117. package/locale-data/pap.js +2 -2
  118. package/locale-data/pcm.js +2 -2
  119. package/locale-data/pl.js +24 -8
  120. package/locale-data/prg.js +22 -6
  121. package/locale-data/ps.js +2 -2
  122. package/locale-data/pt-PT.js +20 -4
  123. package/locale-data/pt.js +20 -4
  124. package/locale-data/rm.js +2 -2
  125. package/locale-data/ro.js +22 -6
  126. package/locale-data/rof.js +2 -2
  127. package/locale-data/ru.js +24 -8
  128. package/locale-data/rwk.js +2 -2
  129. package/locale-data/saq.js +2 -2
  130. package/locale-data/sat.js +4 -4
  131. package/locale-data/sc.js +2 -2
  132. package/locale-data/scn.js +22 -6
  133. package/locale-data/sd.js +2 -2
  134. package/locale-data/sdh.js +2 -2
  135. package/locale-data/se.js +4 -4
  136. package/locale-data/seh.js +2 -2
  137. package/locale-data/sgs.js +26 -10
  138. package/locale-data/sh.js +22 -6
  139. package/locale-data/shi.js +6 -6
  140. package/locale-data/si.js +2 -2
  141. package/locale-data/sk.js +4 -4
  142. package/locale-data/sl.js +24 -8
  143. package/locale-data/sma.js +4 -4
  144. package/locale-data/smi.js +4 -4
  145. package/locale-data/smj.js +4 -4
  146. package/locale-data/smn.js +4 -4
  147. package/locale-data/sms.js +4 -4
  148. package/locale-data/sn.js +2 -2
  149. package/locale-data/so.js +2 -2
  150. package/locale-data/sq.js +24 -8
  151. package/locale-data/sr.js +22 -6
  152. package/locale-data/ss.js +2 -2
  153. package/locale-data/ssy.js +2 -2
  154. package/locale-data/st.js +2 -2
  155. package/locale-data/sv.js +18 -2
  156. package/locale-data/syr.js +2 -2
  157. package/locale-data/ta.js +2 -2
  158. package/locale-data/te.js +2 -2
  159. package/locale-data/teo.js +2 -2
  160. package/locale-data/ti.js +2 -2
  161. package/locale-data/tig.js +2 -2
  162. package/locale-data/tk.js +20 -4
  163. package/locale-data/tl.js +20 -4
  164. package/locale-data/tn.js +2 -2
  165. package/locale-data/tr.js +2 -2
  166. package/locale-data/ts.js +2 -2
  167. package/locale-data/tzm.js +2 -2
  168. package/locale-data/ug.js +2 -2
  169. package/locale-data/uk.js +26 -10
  170. package/locale-data/uz.js +2 -2
  171. package/locale-data/ve.js +2 -2
  172. package/locale-data/vec.js +22 -6
  173. package/locale-data/vi.js +2 -2
  174. package/locale-data/vo.js +2 -2
  175. package/locale-data/vun.js +2 -2
  176. package/locale-data/wa.js +2 -2
  177. package/locale-data/wae.js +2 -2
  178. package/locale-data/xh.js +2 -2
  179. package/locale-data/xog.js +2 -2
  180. package/locale-data/zu.js +2 -2
  181. package/package.json +2 -2
  182. package/polyfill-force.js +9 -1
  183. package/polyfill-force.js.map +1 -1
  184. package/polyfill.iife.js +2077 -3435
  185. package/polyfill.js +9 -1
  186. package/polyfill.js.map +1 -1
  187. package/should-polyfill.js.map +1 -1
package/locale-data/so.js CHANGED
@@ -10,7 +10,7 @@ if (Intl.PluralRules && typeof Intl.PluralRules.__addLocaleData === 'function')
10
10
  if (isOrdinal) {
11
11
  }
12
12
  else {
13
- if (n === 1)
13
+ if ((!/[1-9]/.test(decimalPart) && n === 1))
14
14
  return "one";
15
15
  }
16
16
  return "other";
@@ -25,7 +25,7 @@ if (Intl.PluralRules && typeof Intl.PluralRules.__addLocaleData === 'function')
25
25
  if (isOrdinal) {
26
26
  }
27
27
  else {
28
- if (n === 1)
28
+ if ((!/[1-9]/.test(decimalPart) && n === 1))
29
29
  return "one";
30
30
  }
31
31
  return "other";
package/locale-data/sq.js CHANGED
@@ -2,38 +2,54 @@
2
2
  // prettier-ignore
3
3
  if (Intl.PluralRules && typeof Intl.PluralRules.__addLocaleData === 'function') {
4
4
  Intl.PluralRules.__addLocaleData({"data":{"categories":{"cardinal":["one","other"],"ordinal":["many","one","other"]},"fn":function(num, isOrdinal, exponent = 0) {
5
+ function modDigits(digits, divisor) {
6
+ let value = 0;
7
+ for (let index = 0; index < digits.length; index++) {
8
+ const digit = digits.charCodeAt(index) - 48;
9
+ if (digit >= 0 && digit <= 9) value = (value * 10 + digit) % divisor;
10
+ }
11
+ return value;
12
+ }
5
13
  const numStr = String(num);
6
14
  const parts = numStr.split(".");
7
15
  const integerPart = parts[0];
8
16
  const decimalPart = parts[1] || "";
9
17
  const n = Math.abs(parseFloat(numStr));
10
18
  if (isOrdinal) {
11
- if ((n % 10) === 4 && (n % 100) !== 14)
12
- return "many";
13
- if (n === 1)
19
+ if ((!/[1-9]/.test(decimalPart) && n === 1))
14
20
  return "one";
21
+ if ((!/[1-9]/.test(decimalPart) && modDigits(integerPart, 10) === 4) && (/[1-9]/.test(decimalPart) || modDigits(integerPart, 100) !== 14))
22
+ return "many";
15
23
  }
16
24
  else {
17
- if (n === 1)
25
+ if ((!/[1-9]/.test(decimalPart) && n === 1))
18
26
  return "one";
19
27
  }
20
28
  return "other";
21
29
  },"pluralRanges":{"cardinal":{"one_other":"other","other_one":"one","other_other":"other"},"ordinal":{}}},"locale":"sq"})
22
30
  } else {
23
31
  (globalThis.__FORMATJS_PLURALRULES_DATA__ = globalThis.__FORMATJS_PLURALRULES_DATA__ || []).push({"data":{"categories":{"cardinal":["one","other"],"ordinal":["many","one","other"]},"fn":function(num, isOrdinal, exponent = 0) {
32
+ function modDigits(digits, divisor) {
33
+ let value = 0;
34
+ for (let index = 0; index < digits.length; index++) {
35
+ const digit = digits.charCodeAt(index) - 48;
36
+ if (digit >= 0 && digit <= 9) value = (value * 10 + digit) % divisor;
37
+ }
38
+ return value;
39
+ }
24
40
  const numStr = String(num);
25
41
  const parts = numStr.split(".");
26
42
  const integerPart = parts[0];
27
43
  const decimalPart = parts[1] || "";
28
44
  const n = Math.abs(parseFloat(numStr));
29
45
  if (isOrdinal) {
30
- if ((n % 10) === 4 && (n % 100) !== 14)
31
- return "many";
32
- if (n === 1)
46
+ if ((!/[1-9]/.test(decimalPart) && n === 1))
33
47
  return "one";
48
+ if ((!/[1-9]/.test(decimalPart) && modDigits(integerPart, 10) === 4) && (/[1-9]/.test(decimalPart) || modDigits(integerPart, 100) !== 14))
49
+ return "many";
34
50
  }
35
51
  else {
36
- if (n === 1)
52
+ if ((!/[1-9]/.test(decimalPart) && n === 1))
37
53
  return "one";
38
54
  }
39
55
  return "other";
package/locale-data/sr.js CHANGED
@@ -2,6 +2,14 @@
2
2
  // prettier-ignore
3
3
  if (Intl.PluralRules && typeof Intl.PluralRules.__addLocaleData === 'function') {
4
4
  Intl.PluralRules.__addLocaleData({"data":{"categories":{"cardinal":["few","one","other"],"ordinal":["other"]},"fn":function(num, isOrdinal, exponent = 0) {
5
+ function modDigits(digits, divisor) {
6
+ let value = 0;
7
+ for (let index = 0; index < digits.length; index++) {
8
+ const digit = digits.charCodeAt(index) - 48;
9
+ if (digit >= 0 && digit <= 9) value = (value * 10 + digit) % divisor;
10
+ }
11
+ return value;
12
+ }
5
13
  const numStr = String(num);
6
14
  const parts = numStr.split(".");
7
15
  const integerPart = parts[0];
@@ -12,15 +20,23 @@ if (Intl.PluralRules && typeof Intl.PluralRules.__addLocaleData === 'function')
12
20
  if (isOrdinal) {
13
21
  }
14
22
  else {
15
- if (v === 0 && ((i % 10) >= 2 && (i % 10) <= 4) && ((i % 100) < 12 || (i % 100) > 14) || ((f % 10) >= 2 && (f % 10) <= 4) && ((f % 100) < 12 || (f % 100) > 14))
16
- return "few";
17
- if (v === 0 && (i % 10) === 1 && (i % 100) !== 11 || (f % 10) === 1 && (f % 100) !== 11)
23
+ if (v === 0 && modDigits(integerPart, 10) === 1 && modDigits(integerPart, 100) !== 11 || modDigits(decimalPart, 10) === 1 && modDigits(decimalPart, 100) !== 11)
18
24
  return "one";
25
+ if (v === 0 && (modDigits(integerPart, 10) >= 2 && modDigits(integerPart, 10) <= 4) && (modDigits(integerPart, 100) < 12 || modDigits(integerPart, 100) > 14) || (modDigits(decimalPart, 10) >= 2 && modDigits(decimalPart, 10) <= 4) && (modDigits(decimalPart, 100) < 12 || modDigits(decimalPart, 100) > 14))
26
+ return "few";
19
27
  }
20
28
  return "other";
21
29
  },"pluralRanges":{"cardinal":{"few_few":"few","few_one":"one","few_other":"other","one_few":"few","one_one":"one","one_other":"other","other_few":"few","other_one":"one","other_other":"other"},"ordinal":{}}},"locale":"sr"})
22
30
  } else {
23
31
  (globalThis.__FORMATJS_PLURALRULES_DATA__ = globalThis.__FORMATJS_PLURALRULES_DATA__ || []).push({"data":{"categories":{"cardinal":["few","one","other"],"ordinal":["other"]},"fn":function(num, isOrdinal, exponent = 0) {
32
+ function modDigits(digits, divisor) {
33
+ let value = 0;
34
+ for (let index = 0; index < digits.length; index++) {
35
+ const digit = digits.charCodeAt(index) - 48;
36
+ if (digit >= 0 && digit <= 9) value = (value * 10 + digit) % divisor;
37
+ }
38
+ return value;
39
+ }
24
40
  const numStr = String(num);
25
41
  const parts = numStr.split(".");
26
42
  const integerPart = parts[0];
@@ -31,10 +47,10 @@ if (Intl.PluralRules && typeof Intl.PluralRules.__addLocaleData === 'function')
31
47
  if (isOrdinal) {
32
48
  }
33
49
  else {
34
- if (v === 0 && ((i % 10) >= 2 && (i % 10) <= 4) && ((i % 100) < 12 || (i % 100) > 14) || ((f % 10) >= 2 && (f % 10) <= 4) && ((f % 100) < 12 || (f % 100) > 14))
35
- return "few";
36
- if (v === 0 && (i % 10) === 1 && (i % 100) !== 11 || (f % 10) === 1 && (f % 100) !== 11)
50
+ if (v === 0 && modDigits(integerPart, 10) === 1 && modDigits(integerPart, 100) !== 11 || modDigits(decimalPart, 10) === 1 && modDigits(decimalPart, 100) !== 11)
37
51
  return "one";
52
+ if (v === 0 && (modDigits(integerPart, 10) >= 2 && modDigits(integerPart, 10) <= 4) && (modDigits(integerPart, 100) < 12 || modDigits(integerPart, 100) > 14) || (modDigits(decimalPart, 10) >= 2 && modDigits(decimalPart, 10) <= 4) && (modDigits(decimalPart, 100) < 12 || modDigits(decimalPart, 100) > 14))
53
+ return "few";
38
54
  }
39
55
  return "other";
40
56
  },"pluralRanges":{"cardinal":{"few_few":"few","few_one":"one","few_other":"other","one_few":"few","one_one":"one","one_other":"other","other_few":"few","other_one":"one","other_other":"other"},"ordinal":{}}},"locale":"sr"})
package/locale-data/ss.js CHANGED
@@ -10,7 +10,7 @@ if (Intl.PluralRules && typeof Intl.PluralRules.__addLocaleData === 'function')
10
10
  if (isOrdinal) {
11
11
  }
12
12
  else {
13
- if (n === 1)
13
+ if ((!/[1-9]/.test(decimalPart) && n === 1))
14
14
  return "one";
15
15
  }
16
16
  return "other";
@@ -25,7 +25,7 @@ if (Intl.PluralRules && typeof Intl.PluralRules.__addLocaleData === 'function')
25
25
  if (isOrdinal) {
26
26
  }
27
27
  else {
28
- if (n === 1)
28
+ if ((!/[1-9]/.test(decimalPart) && n === 1))
29
29
  return "one";
30
30
  }
31
31
  return "other";
@@ -10,7 +10,7 @@ if (Intl.PluralRules && typeof Intl.PluralRules.__addLocaleData === 'function')
10
10
  if (isOrdinal) {
11
11
  }
12
12
  else {
13
- if (n === 1)
13
+ if ((!/[1-9]/.test(decimalPart) && n === 1))
14
14
  return "one";
15
15
  }
16
16
  return "other";
@@ -25,7 +25,7 @@ if (Intl.PluralRules && typeof Intl.PluralRules.__addLocaleData === 'function')
25
25
  if (isOrdinal) {
26
26
  }
27
27
  else {
28
- if (n === 1)
28
+ if ((!/[1-9]/.test(decimalPart) && n === 1))
29
29
  return "one";
30
30
  }
31
31
  return "other";
package/locale-data/st.js CHANGED
@@ -10,7 +10,7 @@ if (Intl.PluralRules && typeof Intl.PluralRules.__addLocaleData === 'function')
10
10
  if (isOrdinal) {
11
11
  }
12
12
  else {
13
- if (n === 1)
13
+ if ((!/[1-9]/.test(decimalPart) && n === 1))
14
14
  return "one";
15
15
  }
16
16
  return "other";
@@ -25,7 +25,7 @@ if (Intl.PluralRules && typeof Intl.PluralRules.__addLocaleData === 'function')
25
25
  if (isOrdinal) {
26
26
  }
27
27
  else {
28
- if (n === 1)
28
+ if ((!/[1-9]/.test(decimalPart) && n === 1))
29
29
  return "one";
30
30
  }
31
31
  return "other";
package/locale-data/sv.js CHANGED
@@ -2,6 +2,14 @@
2
2
  // prettier-ignore
3
3
  if (Intl.PluralRules && typeof Intl.PluralRules.__addLocaleData === 'function') {
4
4
  Intl.PluralRules.__addLocaleData({"data":{"categories":{"cardinal":["one","other"],"ordinal":["one","other"]},"fn":function(num, isOrdinal, exponent = 0) {
5
+ function modDigits(digits, divisor) {
6
+ let value = 0;
7
+ for (let index = 0; index < digits.length; index++) {
8
+ const digit = digits.charCodeAt(index) - 48;
9
+ if (digit >= 0 && digit <= 9) value = (value * 10 + digit) % divisor;
10
+ }
11
+ return value;
12
+ }
5
13
  const numStr = String(num);
6
14
  const parts = numStr.split(".");
7
15
  const integerPart = parts[0];
@@ -10,7 +18,7 @@ if (Intl.PluralRules && typeof Intl.PluralRules.__addLocaleData === 'function')
10
18
  const i = Math.floor(Math.abs(parseFloat(integerPart)));
11
19
  const v = decimalPart.length;
12
20
  if (isOrdinal) {
13
- if (((n % 10) === 1 || (n % 10) === 2) && ((n % 100) !== 11 && (n % 100) !== 12))
21
+ if ((!/[1-9]/.test(decimalPart) && (modDigits(integerPart, 10) === 1 || modDigits(integerPart, 10) === 2)) && (/[1-9]/.test(decimalPart) || (modDigits(integerPart, 100) !== 11 && modDigits(integerPart, 100) !== 12)))
14
22
  return "one";
15
23
  }
16
24
  else {
@@ -21,6 +29,14 @@ if (Intl.PluralRules && typeof Intl.PluralRules.__addLocaleData === 'function')
21
29
  },"pluralRanges":{"cardinal":{"one_other":"other","other_one":"other","other_other":"other"},"ordinal":{}}},"locale":"sv"})
22
30
  } else {
23
31
  (globalThis.__FORMATJS_PLURALRULES_DATA__ = globalThis.__FORMATJS_PLURALRULES_DATA__ || []).push({"data":{"categories":{"cardinal":["one","other"],"ordinal":["one","other"]},"fn":function(num, isOrdinal, exponent = 0) {
32
+ function modDigits(digits, divisor) {
33
+ let value = 0;
34
+ for (let index = 0; index < digits.length; index++) {
35
+ const digit = digits.charCodeAt(index) - 48;
36
+ if (digit >= 0 && digit <= 9) value = (value * 10 + digit) % divisor;
37
+ }
38
+ return value;
39
+ }
24
40
  const numStr = String(num);
25
41
  const parts = numStr.split(".");
26
42
  const integerPart = parts[0];
@@ -29,7 +45,7 @@ if (Intl.PluralRules && typeof Intl.PluralRules.__addLocaleData === 'function')
29
45
  const i = Math.floor(Math.abs(parseFloat(integerPart)));
30
46
  const v = decimalPart.length;
31
47
  if (isOrdinal) {
32
- if (((n % 10) === 1 || (n % 10) === 2) && ((n % 100) !== 11 && (n % 100) !== 12))
48
+ if ((!/[1-9]/.test(decimalPart) && (modDigits(integerPart, 10) === 1 || modDigits(integerPart, 10) === 2)) && (/[1-9]/.test(decimalPart) || (modDigits(integerPart, 100) !== 11 && modDigits(integerPart, 100) !== 12)))
33
49
  return "one";
34
50
  }
35
51
  else {
@@ -10,7 +10,7 @@ if (Intl.PluralRules && typeof Intl.PluralRules.__addLocaleData === 'function')
10
10
  if (isOrdinal) {
11
11
  }
12
12
  else {
13
- if (n === 1)
13
+ if ((!/[1-9]/.test(decimalPart) && n === 1))
14
14
  return "one";
15
15
  }
16
16
  return "other";
@@ -25,7 +25,7 @@ if (Intl.PluralRules && typeof Intl.PluralRules.__addLocaleData === 'function')
25
25
  if (isOrdinal) {
26
26
  }
27
27
  else {
28
- if (n === 1)
28
+ if ((!/[1-9]/.test(decimalPart) && n === 1))
29
29
  return "one";
30
30
  }
31
31
  return "other";
package/locale-data/ta.js CHANGED
@@ -10,7 +10,7 @@ if (Intl.PluralRules && typeof Intl.PluralRules.__addLocaleData === 'function')
10
10
  if (isOrdinal) {
11
11
  }
12
12
  else {
13
- if (n === 1)
13
+ if ((!/[1-9]/.test(decimalPart) && n === 1))
14
14
  return "one";
15
15
  }
16
16
  return "other";
@@ -25,7 +25,7 @@ if (Intl.PluralRules && typeof Intl.PluralRules.__addLocaleData === 'function')
25
25
  if (isOrdinal) {
26
26
  }
27
27
  else {
28
- if (n === 1)
28
+ if ((!/[1-9]/.test(decimalPart) && n === 1))
29
29
  return "one";
30
30
  }
31
31
  return "other";
package/locale-data/te.js CHANGED
@@ -10,7 +10,7 @@ if (Intl.PluralRules && typeof Intl.PluralRules.__addLocaleData === 'function')
10
10
  if (isOrdinal) {
11
11
  }
12
12
  else {
13
- if (n === 1)
13
+ if ((!/[1-9]/.test(decimalPart) && n === 1))
14
14
  return "one";
15
15
  }
16
16
  return "other";
@@ -25,7 +25,7 @@ if (Intl.PluralRules && typeof Intl.PluralRules.__addLocaleData === 'function')
25
25
  if (isOrdinal) {
26
26
  }
27
27
  else {
28
- if (n === 1)
28
+ if ((!/[1-9]/.test(decimalPart) && n === 1))
29
29
  return "one";
30
30
  }
31
31
  return "other";
@@ -10,7 +10,7 @@ if (Intl.PluralRules && typeof Intl.PluralRules.__addLocaleData === 'function')
10
10
  if (isOrdinal) {
11
11
  }
12
12
  else {
13
- if (n === 1)
13
+ if ((!/[1-9]/.test(decimalPart) && n === 1))
14
14
  return "one";
15
15
  }
16
16
  return "other";
@@ -25,7 +25,7 @@ if (Intl.PluralRules && typeof Intl.PluralRules.__addLocaleData === 'function')
25
25
  if (isOrdinal) {
26
26
  }
27
27
  else {
28
- if (n === 1)
28
+ if ((!/[1-9]/.test(decimalPart) && n === 1))
29
29
  return "one";
30
30
  }
31
31
  return "other";
package/locale-data/ti.js CHANGED
@@ -10,7 +10,7 @@ if (Intl.PluralRules && typeof Intl.PluralRules.__addLocaleData === 'function')
10
10
  if (isOrdinal) {
11
11
  }
12
12
  else {
13
- if ((n >= 0 && n <= 1))
13
+ if ((!/[1-9]/.test(decimalPart) && (n >= 0 && n <= 1)))
14
14
  return "one";
15
15
  }
16
16
  return "other";
@@ -25,7 +25,7 @@ if (Intl.PluralRules && typeof Intl.PluralRules.__addLocaleData === 'function')
25
25
  if (isOrdinal) {
26
26
  }
27
27
  else {
28
- if ((n >= 0 && n <= 1))
28
+ if ((!/[1-9]/.test(decimalPart) && (n >= 0 && n <= 1)))
29
29
  return "one";
30
30
  }
31
31
  return "other";
@@ -10,7 +10,7 @@ if (Intl.PluralRules && typeof Intl.PluralRules.__addLocaleData === 'function')
10
10
  if (isOrdinal) {
11
11
  }
12
12
  else {
13
- if (n === 1)
13
+ if ((!/[1-9]/.test(decimalPart) && n === 1))
14
14
  return "one";
15
15
  }
16
16
  return "other";
@@ -25,7 +25,7 @@ if (Intl.PluralRules && typeof Intl.PluralRules.__addLocaleData === 'function')
25
25
  if (isOrdinal) {
26
26
  }
27
27
  else {
28
- if (n === 1)
28
+ if ((!/[1-9]/.test(decimalPart) && n === 1))
29
29
  return "one";
30
30
  }
31
31
  return "other";
package/locale-data/tk.js CHANGED
@@ -2,34 +2,50 @@
2
2
  // prettier-ignore
3
3
  if (Intl.PluralRules && typeof Intl.PluralRules.__addLocaleData === 'function') {
4
4
  Intl.PluralRules.__addLocaleData({"data":{"categories":{"cardinal":["one","other"],"ordinal":["few","other"]},"fn":function(num, isOrdinal, exponent = 0) {
5
+ function modDigits(digits, divisor) {
6
+ let value = 0;
7
+ for (let index = 0; index < digits.length; index++) {
8
+ const digit = digits.charCodeAt(index) - 48;
9
+ if (digit >= 0 && digit <= 9) value = (value * 10 + digit) % divisor;
10
+ }
11
+ return value;
12
+ }
5
13
  const numStr = String(num);
6
14
  const parts = numStr.split(".");
7
15
  const integerPart = parts[0];
8
16
  const decimalPart = parts[1] || "";
9
17
  const n = Math.abs(parseFloat(numStr));
10
18
  if (isOrdinal) {
11
- if (((n % 10) === 6 || (n % 10) === 9) || n === 10)
19
+ if ((!/[1-9]/.test(decimalPart) && (modDigits(integerPart, 10) === 6 || modDigits(integerPart, 10) === 9)) || (!/[1-9]/.test(decimalPart) && n === 10))
12
20
  return "few";
13
21
  }
14
22
  else {
15
- if (n === 1)
23
+ if ((!/[1-9]/.test(decimalPart) && n === 1))
16
24
  return "one";
17
25
  }
18
26
  return "other";
19
27
  },"pluralRanges":{"cardinal":{"one_other":"other","other_one":"one","other_other":"other"},"ordinal":{}}},"locale":"tk"})
20
28
  } else {
21
29
  (globalThis.__FORMATJS_PLURALRULES_DATA__ = globalThis.__FORMATJS_PLURALRULES_DATA__ || []).push({"data":{"categories":{"cardinal":["one","other"],"ordinal":["few","other"]},"fn":function(num, isOrdinal, exponent = 0) {
30
+ function modDigits(digits, divisor) {
31
+ let value = 0;
32
+ for (let index = 0; index < digits.length; index++) {
33
+ const digit = digits.charCodeAt(index) - 48;
34
+ if (digit >= 0 && digit <= 9) value = (value * 10 + digit) % divisor;
35
+ }
36
+ return value;
37
+ }
22
38
  const numStr = String(num);
23
39
  const parts = numStr.split(".");
24
40
  const integerPart = parts[0];
25
41
  const decimalPart = parts[1] || "";
26
42
  const n = Math.abs(parseFloat(numStr));
27
43
  if (isOrdinal) {
28
- if (((n % 10) === 6 || (n % 10) === 9) || n === 10)
44
+ if ((!/[1-9]/.test(decimalPart) && (modDigits(integerPart, 10) === 6 || modDigits(integerPart, 10) === 9)) || (!/[1-9]/.test(decimalPart) && n === 10))
29
45
  return "few";
30
46
  }
31
47
  else {
32
- if (n === 1)
48
+ if ((!/[1-9]/.test(decimalPart) && n === 1))
33
49
  return "one";
34
50
  }
35
51
  return "other";
package/locale-data/tl.js CHANGED
@@ -2,6 +2,14 @@
2
2
  // prettier-ignore
3
3
  if (Intl.PluralRules && typeof Intl.PluralRules.__addLocaleData === 'function') {
4
4
  Intl.PluralRules.__addLocaleData({"data":{"categories":{"cardinal":["one","other"],"ordinal":["one","other"]},"fn":function(num, isOrdinal, exponent = 0) {
5
+ function modDigits(digits, divisor) {
6
+ let value = 0;
7
+ for (let index = 0; index < digits.length; index++) {
8
+ const digit = digits.charCodeAt(index) - 48;
9
+ if (digit >= 0 && digit <= 9) value = (value * 10 + digit) % divisor;
10
+ }
11
+ return value;
12
+ }
5
13
  const numStr = String(num);
6
14
  const parts = numStr.split(".");
7
15
  const integerPart = parts[0];
@@ -11,17 +19,25 @@ if (Intl.PluralRules && typeof Intl.PluralRules.__addLocaleData === 'function')
11
19
  const v = decimalPart.length;
12
20
  const f = v > 0 ? parseInt(decimalPart, 10) : 0;
13
21
  if (isOrdinal) {
14
- if (n === 1)
22
+ if ((!/[1-9]/.test(decimalPart) && n === 1))
15
23
  return "one";
16
24
  }
17
25
  else {
18
- if (v === 0 && ((i === 1 || i === 2) || i === 3) || v === 0 && (((i % 10) !== 4 && (i % 10) !== 6) && (i % 10) !== 9) || v !== 0 && (((f % 10) !== 4 && (f % 10) !== 6) && (f % 10) !== 9))
26
+ if (v === 0 && ((i === 1 || i === 2) || i === 3) || v === 0 && ((modDigits(integerPart, 10) !== 4 && modDigits(integerPart, 10) !== 6) && modDigits(integerPart, 10) !== 9) || v !== 0 && ((modDigits(decimalPart, 10) !== 4 && modDigits(decimalPart, 10) !== 6) && modDigits(decimalPart, 10) !== 9))
19
27
  return "one";
20
28
  }
21
29
  return "other";
22
30
  }},"locale":"tl"})
23
31
  } else {
24
32
  (globalThis.__FORMATJS_PLURALRULES_DATA__ = globalThis.__FORMATJS_PLURALRULES_DATA__ || []).push({"data":{"categories":{"cardinal":["one","other"],"ordinal":["one","other"]},"fn":function(num, isOrdinal, exponent = 0) {
33
+ function modDigits(digits, divisor) {
34
+ let value = 0;
35
+ for (let index = 0; index < digits.length; index++) {
36
+ const digit = digits.charCodeAt(index) - 48;
37
+ if (digit >= 0 && digit <= 9) value = (value * 10 + digit) % divisor;
38
+ }
39
+ return value;
40
+ }
25
41
  const numStr = String(num);
26
42
  const parts = numStr.split(".");
27
43
  const integerPart = parts[0];
@@ -31,11 +47,11 @@ if (Intl.PluralRules && typeof Intl.PluralRules.__addLocaleData === 'function')
31
47
  const v = decimalPart.length;
32
48
  const f = v > 0 ? parseInt(decimalPart, 10) : 0;
33
49
  if (isOrdinal) {
34
- if (n === 1)
50
+ if ((!/[1-9]/.test(decimalPart) && n === 1))
35
51
  return "one";
36
52
  }
37
53
  else {
38
- if (v === 0 && ((i === 1 || i === 2) || i === 3) || v === 0 && (((i % 10) !== 4 && (i % 10) !== 6) && (i % 10) !== 9) || v !== 0 && (((f % 10) !== 4 && (f % 10) !== 6) && (f % 10) !== 9))
54
+ if (v === 0 && ((i === 1 || i === 2) || i === 3) || v === 0 && ((modDigits(integerPart, 10) !== 4 && modDigits(integerPart, 10) !== 6) && modDigits(integerPart, 10) !== 9) || v !== 0 && ((modDigits(decimalPart, 10) !== 4 && modDigits(decimalPart, 10) !== 6) && modDigits(decimalPart, 10) !== 9))
39
55
  return "one";
40
56
  }
41
57
  return "other";
package/locale-data/tn.js CHANGED
@@ -10,7 +10,7 @@ if (Intl.PluralRules && typeof Intl.PluralRules.__addLocaleData === 'function')
10
10
  if (isOrdinal) {
11
11
  }
12
12
  else {
13
- if (n === 1)
13
+ if ((!/[1-9]/.test(decimalPart) && n === 1))
14
14
  return "one";
15
15
  }
16
16
  return "other";
@@ -25,7 +25,7 @@ if (Intl.PluralRules && typeof Intl.PluralRules.__addLocaleData === 'function')
25
25
  if (isOrdinal) {
26
26
  }
27
27
  else {
28
- if (n === 1)
28
+ if ((!/[1-9]/.test(decimalPart) && n === 1))
29
29
  return "one";
30
30
  }
31
31
  return "other";
package/locale-data/tr.js CHANGED
@@ -10,7 +10,7 @@ if (Intl.PluralRules && typeof Intl.PluralRules.__addLocaleData === 'function')
10
10
  if (isOrdinal) {
11
11
  }
12
12
  else {
13
- if (n === 1)
13
+ if ((!/[1-9]/.test(decimalPart) && n === 1))
14
14
  return "one";
15
15
  }
16
16
  return "other";
@@ -25,7 +25,7 @@ if (Intl.PluralRules && typeof Intl.PluralRules.__addLocaleData === 'function')
25
25
  if (isOrdinal) {
26
26
  }
27
27
  else {
28
- if (n === 1)
28
+ if ((!/[1-9]/.test(decimalPart) && n === 1))
29
29
  return "one";
30
30
  }
31
31
  return "other";
package/locale-data/ts.js CHANGED
@@ -10,7 +10,7 @@ if (Intl.PluralRules && typeof Intl.PluralRules.__addLocaleData === 'function')
10
10
  if (isOrdinal) {
11
11
  }
12
12
  else {
13
- if (n === 1)
13
+ if ((!/[1-9]/.test(decimalPart) && n === 1))
14
14
  return "one";
15
15
  }
16
16
  return "other";
@@ -25,7 +25,7 @@ if (Intl.PluralRules && typeof Intl.PluralRules.__addLocaleData === 'function')
25
25
  if (isOrdinal) {
26
26
  }
27
27
  else {
28
- if (n === 1)
28
+ if ((!/[1-9]/.test(decimalPart) && n === 1))
29
29
  return "one";
30
30
  }
31
31
  return "other";
@@ -10,7 +10,7 @@ if (Intl.PluralRules && typeof Intl.PluralRules.__addLocaleData === 'function')
10
10
  if (isOrdinal) {
11
11
  }
12
12
  else {
13
- if ((n >= 0 && n <= 1) || (n >= 11 && n <= 99))
13
+ if ((!/[1-9]/.test(decimalPart) && (n >= 0 && n <= 1)) || (!/[1-9]/.test(decimalPart) && (n >= 11 && n <= 99)))
14
14
  return "one";
15
15
  }
16
16
  return "other";
@@ -25,7 +25,7 @@ if (Intl.PluralRules && typeof Intl.PluralRules.__addLocaleData === 'function')
25
25
  if (isOrdinal) {
26
26
  }
27
27
  else {
28
- if ((n >= 0 && n <= 1) || (n >= 11 && n <= 99))
28
+ if ((!/[1-9]/.test(decimalPart) && (n >= 0 && n <= 1)) || (!/[1-9]/.test(decimalPart) && (n >= 11 && n <= 99)))
29
29
  return "one";
30
30
  }
31
31
  return "other";
package/locale-data/ug.js CHANGED
@@ -10,7 +10,7 @@ if (Intl.PluralRules && typeof Intl.PluralRules.__addLocaleData === 'function')
10
10
  if (isOrdinal) {
11
11
  }
12
12
  else {
13
- if (n === 1)
13
+ if ((!/[1-9]/.test(decimalPart) && n === 1))
14
14
  return "one";
15
15
  }
16
16
  return "other";
@@ -25,7 +25,7 @@ if (Intl.PluralRules && typeof Intl.PluralRules.__addLocaleData === 'function')
25
25
  if (isOrdinal) {
26
26
  }
27
27
  else {
28
- if (n === 1)
28
+ if ((!/[1-9]/.test(decimalPart) && n === 1))
29
29
  return "one";
30
30
  }
31
31
  return "other";
package/locale-data/uk.js CHANGED
@@ -2,6 +2,14 @@
2
2
  // prettier-ignore
3
3
  if (Intl.PluralRules && typeof Intl.PluralRules.__addLocaleData === 'function') {
4
4
  Intl.PluralRules.__addLocaleData({"data":{"categories":{"cardinal":["few","many","one","other"],"ordinal":["few","other"]},"fn":function(num, isOrdinal, exponent = 0) {
5
+ function modDigits(digits, divisor) {
6
+ let value = 0;
7
+ for (let index = 0; index < digits.length; index++) {
8
+ const digit = digits.charCodeAt(index) - 48;
9
+ if (digit >= 0 && digit <= 9) value = (value * 10 + digit) % divisor;
10
+ }
11
+ return value;
12
+ }
5
13
  const numStr = String(num);
6
14
  const parts = numStr.split(".");
7
15
  const integerPart = parts[0];
@@ -10,21 +18,29 @@ if (Intl.PluralRules && typeof Intl.PluralRules.__addLocaleData === 'function')
10
18
  const i = Math.floor(Math.abs(parseFloat(integerPart)));
11
19
  const v = decimalPart.length;
12
20
  if (isOrdinal) {
13
- if ((n % 10) === 3 && (n % 100) !== 13)
21
+ if ((!/[1-9]/.test(decimalPart) && modDigits(integerPart, 10) === 3) && (/[1-9]/.test(decimalPart) || modDigits(integerPart, 100) !== 13))
14
22
  return "few";
15
23
  }
16
24
  else {
17
- if (v === 0 && ((i % 10) >= 2 && (i % 10) <= 4) && ((i % 100) < 12 || (i % 100) > 14))
25
+ if (v === 0 && modDigits(integerPart, 10) === 1 && modDigits(integerPart, 100) !== 11)
26
+ return "one";
27
+ if (v === 0 && (modDigits(integerPart, 10) >= 2 && modDigits(integerPart, 10) <= 4) && (modDigits(integerPart, 100) < 12 || modDigits(integerPart, 100) > 14))
18
28
  return "few";
19
- if (v === 0 && (i % 10) === 0 || v === 0 && ((i % 10) >= 5 && (i % 10) <= 9) || v === 0 && ((i % 100) >= 11 && (i % 100) <= 14))
29
+ if (v === 0 && modDigits(integerPart, 10) === 0 || v === 0 && (modDigits(integerPart, 10) >= 5 && modDigits(integerPart, 10) <= 9) || v === 0 && (modDigits(integerPart, 100) >= 11 && modDigits(integerPart, 100) <= 14))
20
30
  return "many";
21
- if (v === 0 && (i % 10) === 1 && (i % 100) !== 11)
22
- return "one";
23
31
  }
24
32
  return "other";
25
33
  },"pluralRanges":{"cardinal":{"few_few":"few","few_many":"many","few_one":"one","few_other":"other","many_few":"few","many_many":"many","many_one":"one","many_other":"other","one_few":"few","one_many":"many","one_one":"one","one_other":"other","other_few":"few","other_many":"many","other_one":"one","other_other":"other"},"ordinal":{}}},"locale":"uk"})
26
34
  } else {
27
35
  (globalThis.__FORMATJS_PLURALRULES_DATA__ = globalThis.__FORMATJS_PLURALRULES_DATA__ || []).push({"data":{"categories":{"cardinal":["few","many","one","other"],"ordinal":["few","other"]},"fn":function(num, isOrdinal, exponent = 0) {
36
+ function modDigits(digits, divisor) {
37
+ let value = 0;
38
+ for (let index = 0; index < digits.length; index++) {
39
+ const digit = digits.charCodeAt(index) - 48;
40
+ if (digit >= 0 && digit <= 9) value = (value * 10 + digit) % divisor;
41
+ }
42
+ return value;
43
+ }
28
44
  const numStr = String(num);
29
45
  const parts = numStr.split(".");
30
46
  const integerPart = parts[0];
@@ -33,16 +49,16 @@ if (Intl.PluralRules && typeof Intl.PluralRules.__addLocaleData === 'function')
33
49
  const i = Math.floor(Math.abs(parseFloat(integerPart)));
34
50
  const v = decimalPart.length;
35
51
  if (isOrdinal) {
36
- if ((n % 10) === 3 && (n % 100) !== 13)
52
+ if ((!/[1-9]/.test(decimalPart) && modDigits(integerPart, 10) === 3) && (/[1-9]/.test(decimalPart) || modDigits(integerPart, 100) !== 13))
37
53
  return "few";
38
54
  }
39
55
  else {
40
- if (v === 0 && ((i % 10) >= 2 && (i % 10) <= 4) && ((i % 100) < 12 || (i % 100) > 14))
56
+ if (v === 0 && modDigits(integerPart, 10) === 1 && modDigits(integerPart, 100) !== 11)
57
+ return "one";
58
+ if (v === 0 && (modDigits(integerPart, 10) >= 2 && modDigits(integerPart, 10) <= 4) && (modDigits(integerPart, 100) < 12 || modDigits(integerPart, 100) > 14))
41
59
  return "few";
42
- if (v === 0 && (i % 10) === 0 || v === 0 && ((i % 10) >= 5 && (i % 10) <= 9) || v === 0 && ((i % 100) >= 11 && (i % 100) <= 14))
60
+ if (v === 0 && modDigits(integerPart, 10) === 0 || v === 0 && (modDigits(integerPart, 10) >= 5 && modDigits(integerPart, 10) <= 9) || v === 0 && (modDigits(integerPart, 100) >= 11 && modDigits(integerPart, 100) <= 14))
43
61
  return "many";
44
- if (v === 0 && (i % 10) === 1 && (i % 100) !== 11)
45
- return "one";
46
62
  }
47
63
  return "other";
48
64
  },"pluralRanges":{"cardinal":{"few_few":"few","few_many":"many","few_one":"one","few_other":"other","many_few":"few","many_many":"many","many_one":"one","many_other":"other","one_few":"few","one_many":"many","one_one":"one","one_other":"other","other_few":"few","other_many":"many","other_one":"one","other_other":"other"},"ordinal":{}}},"locale":"uk"})