@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.
- package/index.d.ts +12 -1
- package/index.js +9 -1
- package/index.js.map +1 -1
- package/locale-data/af.js +2 -2
- package/locale-data/ak.js +2 -2
- package/locale-data/am.js +2 -2
- package/locale-data/an.js +2 -2
- package/locale-data/ar.js +32 -16
- package/locale-data/ars.js +32 -16
- package/locale-data/as.js +14 -14
- package/locale-data/asa.js +2 -2
- package/locale-data/az.js +26 -10
- package/locale-data/bal.js +4 -4
- package/locale-data/be.js +26 -10
- package/locale-data/bem.js +2 -2
- package/locale-data/bez.js +2 -2
- package/locale-data/bg.js +2 -2
- package/locale-data/bho.js +2 -2
- package/locale-data/blo.js +14 -14
- package/locale-data/bn.js +14 -14
- package/locale-data/br.js +28 -12
- package/locale-data/brx.js +2 -2
- package/locale-data/bs.js +22 -6
- package/locale-data/ca.js +28 -12
- package/locale-data/ce.js +2 -2
- package/locale-data/ceb.js +18 -2
- package/locale-data/cgg.js +2 -2
- package/locale-data/chr.js +2 -2
- package/locale-data/ckb.js +2 -2
- package/locale-data/cs.js +4 -4
- package/locale-data/csw.js +2 -2
- package/locale-data/cv.js +6 -6
- package/locale-data/cy.js +32 -32
- package/locale-data/da.js +2 -2
- package/locale-data/doi.js +2 -2
- package/locale-data/dsb.js +24 -8
- package/locale-data/dv.js +2 -2
- package/locale-data/ee.js +2 -2
- package/locale-data/el.js +2 -2
- package/locale-data/en.js +24 -8
- package/locale-data/eo.js +2 -2
- package/locale-data/es.js +22 -6
- package/locale-data/eu.js +2 -2
- package/locale-data/fa.js +2 -2
- package/locale-data/fil.js +20 -4
- package/locale-data/fo.js +2 -2
- package/locale-data/fr.js +22 -6
- package/locale-data/fur.js +2 -2
- package/locale-data/ga.js +14 -14
- package/locale-data/gd.js +16 -16
- package/locale-data/gsw.js +2 -2
- package/locale-data/gu.js +14 -14
- package/locale-data/guw.js +2 -2
- package/locale-data/gv.js +26 -10
- package/locale-data/ha.js +2 -2
- package/locale-data/haw.js +2 -2
- package/locale-data/hi.js +14 -14
- package/locale-data/hr.js +22 -6
- package/locale-data/hsb.js +24 -8
- package/locale-data/hu.js +4 -4
- package/locale-data/hy.js +2 -2
- package/locale-data/is.js +18 -2
- package/locale-data/it.js +22 -6
- package/locale-data/iu.js +4 -4
- package/locale-data/jgo.js +2 -2
- package/locale-data/jmc.js +2 -2
- package/locale-data/ka.js +22 -6
- package/locale-data/kaj.js +2 -2
- package/locale-data/kcg.js +2 -2
- package/locale-data/kk.js +20 -4
- package/locale-data/kkj.js +2 -2
- package/locale-data/kl.js +2 -2
- package/locale-data/kn.js +2 -2
- package/locale-data/kok-Latn.js +10 -10
- package/locale-data/kok.js +10 -10
- package/locale-data/ks.js +2 -2
- package/locale-data/ksb.js +2 -2
- package/locale-data/ksh.js +6 -6
- package/locale-data/ku.js +2 -2
- package/locale-data/kw.js +38 -22
- package/locale-data/ky.js +2 -2
- package/locale-data/lag.js +6 -6
- package/locale-data/lb.js +2 -2
- package/locale-data/lg.js +2 -2
- package/locale-data/lij.js +2 -2
- package/locale-data/lld.js +22 -6
- package/locale-data/ln.js +2 -2
- package/locale-data/lo.js +2 -2
- package/locale-data/lt.js +22 -6
- package/locale-data/lv.js +22 -6
- package/locale-data/mas.js +2 -2
- package/locale-data/mg.js +2 -2
- package/locale-data/mgo.js +2 -2
- package/locale-data/mk.js +26 -10
- package/locale-data/ml.js +2 -2
- package/locale-data/mn.js +2 -2
- package/locale-data/mo.js +22 -6
- package/locale-data/mr.js +10 -10
- package/locale-data/ms.js +2 -2
- package/locale-data/mt.js +28 -12
- package/locale-data/nah.js +2 -2
- package/locale-data/naq.js +4 -4
- package/locale-data/nb.js +2 -2
- package/locale-data/nd.js +2 -2
- package/locale-data/ne.js +4 -4
- package/locale-data/nn.js +2 -2
- package/locale-data/nnh.js +2 -2
- package/locale-data/no.js +2 -2
- package/locale-data/nr.js +2 -2
- package/locale-data/nso.js +2 -2
- package/locale-data/ny.js +2 -2
- package/locale-data/nyn.js +2 -2
- package/locale-data/om.js +2 -2
- package/locale-data/or.js +14 -14
- package/locale-data/os.js +2 -2
- package/locale-data/pa.js +2 -2
- package/locale-data/pap.js +2 -2
- package/locale-data/pcm.js +2 -2
- package/locale-data/pl.js +24 -8
- package/locale-data/prg.js +22 -6
- package/locale-data/ps.js +2 -2
- package/locale-data/pt-PT.js +20 -4
- package/locale-data/pt.js +20 -4
- package/locale-data/rm.js +2 -2
- package/locale-data/ro.js +22 -6
- package/locale-data/rof.js +2 -2
- package/locale-data/ru.js +24 -8
- package/locale-data/rwk.js +2 -2
- package/locale-data/saq.js +2 -2
- package/locale-data/sat.js +4 -4
- package/locale-data/sc.js +2 -2
- package/locale-data/scn.js +22 -6
- package/locale-data/sd.js +2 -2
- package/locale-data/sdh.js +2 -2
- package/locale-data/se.js +4 -4
- package/locale-data/seh.js +2 -2
- package/locale-data/sgs.js +26 -10
- package/locale-data/sh.js +22 -6
- package/locale-data/shi.js +6 -6
- package/locale-data/si.js +2 -2
- package/locale-data/sk.js +4 -4
- package/locale-data/sl.js +24 -8
- package/locale-data/sma.js +4 -4
- package/locale-data/smi.js +4 -4
- package/locale-data/smj.js +4 -4
- package/locale-data/smn.js +4 -4
- package/locale-data/sms.js +4 -4
- package/locale-data/sn.js +2 -2
- package/locale-data/so.js +2 -2
- package/locale-data/sq.js +24 -8
- package/locale-data/sr.js +22 -6
- package/locale-data/ss.js +2 -2
- package/locale-data/ssy.js +2 -2
- package/locale-data/st.js +2 -2
- package/locale-data/sv.js +18 -2
- package/locale-data/syr.js +2 -2
- package/locale-data/ta.js +2 -2
- package/locale-data/te.js +2 -2
- package/locale-data/teo.js +2 -2
- package/locale-data/ti.js +2 -2
- package/locale-data/tig.js +2 -2
- package/locale-data/tk.js +20 -4
- package/locale-data/tl.js +20 -4
- package/locale-data/tn.js +2 -2
- package/locale-data/tr.js +2 -2
- package/locale-data/ts.js +2 -2
- package/locale-data/tzm.js +2 -2
- package/locale-data/ug.js +2 -2
- package/locale-data/uk.js +26 -10
- package/locale-data/uz.js +2 -2
- package/locale-data/ve.js +2 -2
- package/locale-data/vec.js +22 -6
- package/locale-data/vi.js +2 -2
- package/locale-data/vo.js +2 -2
- package/locale-data/vun.js +2 -2
- package/locale-data/wa.js +2 -2
- package/locale-data/wae.js +2 -2
- package/locale-data/xh.js +2 -2
- package/locale-data/xog.js +2 -2
- package/locale-data/zu.js +2 -2
- package/package.json +2 -2
- package/polyfill-force.js +9 -1
- package/polyfill-force.js.map +1 -1
- package/polyfill.iife.js +2077 -3435
- package/polyfill.js +9 -1
- package/polyfill.js.map +1 -1
- package/should-polyfill.js.map +1 -1
package/locale-data/dsb.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","two"],"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,17 +20,25 @@ if (Intl.PluralRules && typeof Intl.PluralRules.__addLocaleData === 'function')
|
|
|
12
20
|
if (isOrdinal) {
|
|
13
21
|
}
|
|
14
22
|
else {
|
|
15
|
-
if (v === 0 && (
|
|
16
|
-
return "few";
|
|
17
|
-
if (v === 0 && (i % 100) === 1 || (f % 100) === 1)
|
|
23
|
+
if (v === 0 && modDigits(integerPart, 100) === 1 || modDigits(decimalPart, 100) === 1)
|
|
18
24
|
return "one";
|
|
19
|
-
if (v === 0 && (
|
|
25
|
+
if (v === 0 && modDigits(integerPart, 100) === 2 || modDigits(decimalPart, 100) === 2)
|
|
20
26
|
return "two";
|
|
27
|
+
if (v === 0 && (modDigits(integerPart, 100) >= 3 && modDigits(integerPart, 100) <= 4) || (modDigits(decimalPart, 100) >= 3 && modDigits(decimalPart, 100) <= 4))
|
|
28
|
+
return "few";
|
|
21
29
|
}
|
|
22
30
|
return "other";
|
|
23
31
|
}},"locale":"dsb"})
|
|
24
32
|
} else {
|
|
25
33
|
(globalThis.__FORMATJS_PLURALRULES_DATA__ = globalThis.__FORMATJS_PLURALRULES_DATA__ || []).push({"data":{"categories":{"cardinal":["few","one","other","two"],"ordinal":["other"]},"fn":function(num, isOrdinal, exponent = 0) {
|
|
34
|
+
function modDigits(digits, divisor) {
|
|
35
|
+
let value = 0;
|
|
36
|
+
for (let index = 0; index < digits.length; index++) {
|
|
37
|
+
const digit = digits.charCodeAt(index) - 48;
|
|
38
|
+
if (digit >= 0 && digit <= 9) value = (value * 10 + digit) % divisor;
|
|
39
|
+
}
|
|
40
|
+
return value;
|
|
41
|
+
}
|
|
26
42
|
const numStr = String(num);
|
|
27
43
|
const parts = numStr.split(".");
|
|
28
44
|
const integerPart = parts[0];
|
|
@@ -33,12 +49,12 @@ if (Intl.PluralRules && typeof Intl.PluralRules.__addLocaleData === 'function')
|
|
|
33
49
|
if (isOrdinal) {
|
|
34
50
|
}
|
|
35
51
|
else {
|
|
36
|
-
if (v === 0 && (
|
|
37
|
-
return "few";
|
|
38
|
-
if (v === 0 && (i % 100) === 1 || (f % 100) === 1)
|
|
52
|
+
if (v === 0 && modDigits(integerPart, 100) === 1 || modDigits(decimalPart, 100) === 1)
|
|
39
53
|
return "one";
|
|
40
|
-
if (v === 0 && (
|
|
54
|
+
if (v === 0 && modDigits(integerPart, 100) === 2 || modDigits(decimalPart, 100) === 2)
|
|
41
55
|
return "two";
|
|
56
|
+
if (v === 0 && (modDigits(integerPart, 100) >= 3 && modDigits(integerPart, 100) <= 4) || (modDigits(decimalPart, 100) >= 3 && modDigits(decimalPart, 100) <= 4))
|
|
57
|
+
return "few";
|
|
42
58
|
}
|
|
43
59
|
return "other";
|
|
44
60
|
}},"locale":"dsb"})
|
package/locale-data/dv.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/ee.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/el.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/en.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":["few","one","other","two"]},"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,12 +18,12 @@ 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 ((
|
|
14
|
-
return "few";
|
|
15
|
-
if ((n % 10) === 1 && (n % 100) !== 11)
|
|
21
|
+
if ((!/[1-9]/.test(decimalPart) && modDigits(integerPart, 10) === 1) && (/[1-9]/.test(decimalPart) || modDigits(integerPart, 100) !== 11))
|
|
16
22
|
return "one";
|
|
17
|
-
if ((
|
|
23
|
+
if ((!/[1-9]/.test(decimalPart) && modDigits(integerPart, 10) === 2) && (/[1-9]/.test(decimalPart) || modDigits(integerPart, 100) !== 12))
|
|
18
24
|
return "two";
|
|
25
|
+
if ((!/[1-9]/.test(decimalPart) && modDigits(integerPart, 10) === 3) && (/[1-9]/.test(decimalPart) || modDigits(integerPart, 100) !== 13))
|
|
26
|
+
return "few";
|
|
19
27
|
}
|
|
20
28
|
else {
|
|
21
29
|
if (i === 1 && v === 0)
|
|
@@ -25,6 +33,14 @@ if (Intl.PluralRules && typeof Intl.PluralRules.__addLocaleData === 'function')
|
|
|
25
33
|
},"pluralRanges":{"cardinal":{"one_other":"other","other_one":"other","other_other":"other"},"ordinal":{}}},"locale":"en"})
|
|
26
34
|
} else {
|
|
27
35
|
(globalThis.__FORMATJS_PLURALRULES_DATA__ = globalThis.__FORMATJS_PLURALRULES_DATA__ || []).push({"data":{"categories":{"cardinal":["one","other"],"ordinal":["few","one","other","two"]},"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,12 +49,12 @@ 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 ((
|
|
37
|
-
return "few";
|
|
38
|
-
if ((n % 10) === 1 && (n % 100) !== 11)
|
|
52
|
+
if ((!/[1-9]/.test(decimalPart) && modDigits(integerPart, 10) === 1) && (/[1-9]/.test(decimalPart) || modDigits(integerPart, 100) !== 11))
|
|
39
53
|
return "one";
|
|
40
|
-
if ((
|
|
54
|
+
if ((!/[1-9]/.test(decimalPart) && modDigits(integerPart, 10) === 2) && (/[1-9]/.test(decimalPart) || modDigits(integerPart, 100) !== 12))
|
|
41
55
|
return "two";
|
|
56
|
+
if ((!/[1-9]/.test(decimalPart) && modDigits(integerPart, 10) === 3) && (/[1-9]/.test(decimalPart) || modDigits(integerPart, 100) !== 13))
|
|
57
|
+
return "few";
|
|
42
58
|
}
|
|
43
59
|
else {
|
|
44
60
|
if (i === 1 && v === 0)
|
package/locale-data/eo.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/es.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":["many","one","other"],"ordinal":["other"]},"compactExponents":{"short":{"3":3,"4":3,"5":3,"6":6,"7":6,"8":6,"9":6,"10":9,"11":9,"12":12,"13":12,"14":12},"long":{"3":3,"4":3,"5":3,"6":6,"7":6,"8":6,"9":9,"10":9,"11":9,"12":12,"13":12,"14":12}},"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];
|
|
@@ -13,15 +21,23 @@ if (Intl.PluralRules && typeof Intl.PluralRules.__addLocaleData === 'function')
|
|
|
13
21
|
if (isOrdinal) {
|
|
14
22
|
}
|
|
15
23
|
else {
|
|
16
|
-
if (
|
|
17
|
-
return "many";
|
|
18
|
-
if (n === 1)
|
|
24
|
+
if ((!/[1-9]/.test(decimalPart) && n === 1))
|
|
19
25
|
return "one";
|
|
26
|
+
if (e === 0 && i !== 0 && modDigits(integerPart, 1000000) === 0 && v === 0 || (e < 0 || e > 5))
|
|
27
|
+
return "many";
|
|
20
28
|
}
|
|
21
29
|
return "other";
|
|
22
30
|
},"pluralRanges":{"cardinal":{"one_other":"other","other_one":"other","other_other":"other"},"ordinal":{}}},"locale":"es"})
|
|
23
31
|
} else {
|
|
24
32
|
(globalThis.__FORMATJS_PLURALRULES_DATA__ = globalThis.__FORMATJS_PLURALRULES_DATA__ || []).push({"data":{"categories":{"cardinal":["many","one","other"],"ordinal":["other"]},"compactExponents":{"short":{"3":3,"4":3,"5":3,"6":6,"7":6,"8":6,"9":6,"10":9,"11":9,"12":12,"13":12,"14":12},"long":{"3":3,"4":3,"5":3,"6":6,"7":6,"8":6,"9":9,"10":9,"11":9,"12":12,"13":12,"14":12}},"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];
|
|
@@ -33,10 +49,10 @@ if (Intl.PluralRules && typeof Intl.PluralRules.__addLocaleData === 'function')
|
|
|
33
49
|
if (isOrdinal) {
|
|
34
50
|
}
|
|
35
51
|
else {
|
|
36
|
-
if (
|
|
37
|
-
return "many";
|
|
38
|
-
if (n === 1)
|
|
52
|
+
if ((!/[1-9]/.test(decimalPart) && n === 1))
|
|
39
53
|
return "one";
|
|
54
|
+
if (e === 0 && i !== 0 && modDigits(integerPart, 1000000) === 0 && v === 0 || (e < 0 || e > 5))
|
|
55
|
+
return "many";
|
|
40
56
|
}
|
|
41
57
|
return "other";
|
|
42
58
|
},"pluralRanges":{"cardinal":{"one_other":"other","other_one":"other","other_other":"other"},"ordinal":{}}},"locale":"es"})
|
package/locale-data/eu.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/fa.js
CHANGED
|
@@ -11,7 +11,7 @@ if (Intl.PluralRules && typeof Intl.PluralRules.__addLocaleData === 'function')
|
|
|
11
11
|
if (isOrdinal) {
|
|
12
12
|
}
|
|
13
13
|
else {
|
|
14
|
-
if (i === 0 || n === 1)
|
|
14
|
+
if (i === 0 || (!/[1-9]/.test(decimalPart) && n === 1))
|
|
15
15
|
return "one";
|
|
16
16
|
}
|
|
17
17
|
return "other";
|
|
@@ -27,7 +27,7 @@ if (Intl.PluralRules && typeof Intl.PluralRules.__addLocaleData === 'function')
|
|
|
27
27
|
if (isOrdinal) {
|
|
28
28
|
}
|
|
29
29
|
else {
|
|
30
|
-
if (i === 0 || n === 1)
|
|
30
|
+
if (i === 0 || (!/[1-9]/.test(decimalPart) && n === 1))
|
|
31
31
|
return "one";
|
|
32
32
|
}
|
|
33
33
|
return "other";
|
package/locale-data/fil.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 && (((
|
|
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
|
},"pluralRanges":{"cardinal":{"one_one":"one","one_other":"other","other_one":"one","other_other":"other"},"ordinal":{}}},"locale":"fil"})
|
|
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 && (((
|
|
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/fo.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/fr.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":["many","one","other"],"ordinal":["one","other"]},"compactExponents":{"short":{"3":3,"4":3,"5":3,"6":6,"7":6,"8":6,"9":9,"10":9,"11":9,"12":12,"13":12,"14":12},"long":{"3":3,"4":3,"5":3,"6":6,"7":6,"8":6,"9":9,"10":9,"11":9,"12":12,"13":12,"14":12}},"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,19 +19,27 @@ if (Intl.PluralRules && typeof Intl.PluralRules.__addLocaleData === 'function')
|
|
|
11
19
|
const v = decimalPart.length;
|
|
12
20
|
const e = exponent;
|
|
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 (e === 0 && i !== 0 && (i % 1000000) === 0 && v === 0 || (e < 0 || e > 5))
|
|
19
|
-
return "many";
|
|
20
26
|
if ((i === 0 || i === 1))
|
|
21
27
|
return "one";
|
|
28
|
+
if (e === 0 && i !== 0 && modDigits(integerPart, 1000000) === 0 && v === 0 || (e < 0 || e > 5))
|
|
29
|
+
return "many";
|
|
22
30
|
}
|
|
23
31
|
return "other";
|
|
24
32
|
},"pluralRanges":{"cardinal":{"one_one":"one","one_other":"other","other_other":"other"},"ordinal":{}}},"locale":"fr"})
|
|
25
33
|
} else {
|
|
26
34
|
(globalThis.__FORMATJS_PLURALRULES_DATA__ = globalThis.__FORMATJS_PLURALRULES_DATA__ || []).push({"data":{"categories":{"cardinal":["many","one","other"],"ordinal":["one","other"]},"compactExponents":{"short":{"3":3,"4":3,"5":3,"6":6,"7":6,"8":6,"9":9,"10":9,"11":9,"12":12,"13":12,"14":12},"long":{"3":3,"4":3,"5":3,"6":6,"7":6,"8":6,"9":9,"10":9,"11":9,"12":12,"13":12,"14":12}},"fn":function(num, isOrdinal, exponent = 0) {
|
|
35
|
+
function modDigits(digits, divisor) {
|
|
36
|
+
let value = 0;
|
|
37
|
+
for (let index = 0; index < digits.length; index++) {
|
|
38
|
+
const digit = digits.charCodeAt(index) - 48;
|
|
39
|
+
if (digit >= 0 && digit <= 9) value = (value * 10 + digit) % divisor;
|
|
40
|
+
}
|
|
41
|
+
return value;
|
|
42
|
+
}
|
|
27
43
|
const numStr = String(num);
|
|
28
44
|
const parts = numStr.split(".");
|
|
29
45
|
const integerPart = parts[0];
|
|
@@ -33,14 +49,14 @@ if (Intl.PluralRules && typeof Intl.PluralRules.__addLocaleData === 'function')
|
|
|
33
49
|
const v = decimalPart.length;
|
|
34
50
|
const e = exponent;
|
|
35
51
|
if (isOrdinal) {
|
|
36
|
-
if (n === 1)
|
|
52
|
+
if ((!/[1-9]/.test(decimalPart) && n === 1))
|
|
37
53
|
return "one";
|
|
38
54
|
}
|
|
39
55
|
else {
|
|
40
|
-
if (e === 0 && i !== 0 && (i % 1000000) === 0 && v === 0 || (e < 0 || e > 5))
|
|
41
|
-
return "many";
|
|
42
56
|
if ((i === 0 || i === 1))
|
|
43
57
|
return "one";
|
|
58
|
+
if (e === 0 && i !== 0 && modDigits(integerPart, 1000000) === 0 && v === 0 || (e < 0 || e > 5))
|
|
59
|
+
return "many";
|
|
44
60
|
}
|
|
45
61
|
return "other";
|
|
46
62
|
},"pluralRanges":{"cardinal":{"one_one":"one","one_other":"other","other_other":"other"},"ordinal":{}}},"locale":"fr"})
|
package/locale-data/fur.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/ga.js
CHANGED
|
@@ -8,18 +8,18 @@ if (Intl.PluralRules && typeof Intl.PluralRules.__addLocaleData === 'function')
|
|
|
8
8
|
const decimalPart = parts[1] || "";
|
|
9
9
|
const n = Math.abs(parseFloat(numStr));
|
|
10
10
|
if (isOrdinal) {
|
|
11
|
-
if (n === 1)
|
|
11
|
+
if ((!/[1-9]/.test(decimalPart) && n === 1))
|
|
12
12
|
return "one";
|
|
13
13
|
}
|
|
14
14
|
else {
|
|
15
|
-
if ((
|
|
16
|
-
return "few";
|
|
17
|
-
if ((n >= 7 && n <= 10))
|
|
18
|
-
return "many";
|
|
19
|
-
if (n === 1)
|
|
15
|
+
if ((!/[1-9]/.test(decimalPart) && n === 1))
|
|
20
16
|
return "one";
|
|
21
|
-
if (n === 2)
|
|
17
|
+
if ((!/[1-9]/.test(decimalPart) && n === 2))
|
|
22
18
|
return "two";
|
|
19
|
+
if ((!/[1-9]/.test(decimalPart) && (n >= 3 && n <= 6)))
|
|
20
|
+
return "few";
|
|
21
|
+
if ((!/[1-9]/.test(decimalPart) && (n >= 7 && n <= 10)))
|
|
22
|
+
return "many";
|
|
23
23
|
}
|
|
24
24
|
return "other";
|
|
25
25
|
},"pluralRanges":{"cardinal":{"few_few":"few","few_many":"many","few_other":"other","many_many":"many","many_other":"other","one_few":"few","one_many":"many","one_other":"other","one_two":"two","other_few":"few","other_many":"many","other_one":"one","other_other":"other","other_two":"two","two_few":"few","two_many":"many","two_other":"other"},"ordinal":{}}},"locale":"ga"})
|
|
@@ -31,18 +31,18 @@ if (Intl.PluralRules && typeof Intl.PluralRules.__addLocaleData === 'function')
|
|
|
31
31
|
const decimalPart = parts[1] || "";
|
|
32
32
|
const n = Math.abs(parseFloat(numStr));
|
|
33
33
|
if (isOrdinal) {
|
|
34
|
-
if (n === 1)
|
|
34
|
+
if ((!/[1-9]/.test(decimalPart) && n === 1))
|
|
35
35
|
return "one";
|
|
36
36
|
}
|
|
37
37
|
else {
|
|
38
|
-
if ((
|
|
39
|
-
return "few";
|
|
40
|
-
if ((n >= 7 && n <= 10))
|
|
41
|
-
return "many";
|
|
42
|
-
if (n === 1)
|
|
38
|
+
if ((!/[1-9]/.test(decimalPart) && n === 1))
|
|
43
39
|
return "one";
|
|
44
|
-
if (n === 2)
|
|
40
|
+
if ((!/[1-9]/.test(decimalPart) && n === 2))
|
|
45
41
|
return "two";
|
|
42
|
+
if ((!/[1-9]/.test(decimalPart) && (n >= 3 && n <= 6)))
|
|
43
|
+
return "few";
|
|
44
|
+
if ((!/[1-9]/.test(decimalPart) && (n >= 7 && n <= 10)))
|
|
45
|
+
return "many";
|
|
46
46
|
}
|
|
47
47
|
return "other";
|
|
48
48
|
},"pluralRanges":{"cardinal":{"few_few":"few","few_many":"many","few_other":"other","many_many":"many","many_other":"other","one_few":"few","one_many":"many","one_other":"other","one_two":"two","other_few":"few","other_many":"many","other_one":"one","other_other":"other","other_two":"two","two_few":"few","two_many":"many","two_other":"other"},"ordinal":{}}},"locale":"ga"})
|
package/locale-data/gd.js
CHANGED
|
@@ -8,20 +8,20 @@ if (Intl.PluralRules && typeof Intl.PluralRules.__addLocaleData === 'function')
|
|
|
8
8
|
const decimalPart = parts[1] || "";
|
|
9
9
|
const n = Math.abs(parseFloat(numStr));
|
|
10
10
|
if (isOrdinal) {
|
|
11
|
-
if ((n ===
|
|
12
|
-
return "few";
|
|
13
|
-
if ((n === 1 || n === 11))
|
|
11
|
+
if ((!/[1-9]/.test(decimalPart) && (n === 1 || n === 11)))
|
|
14
12
|
return "one";
|
|
15
|
-
if ((n === 2 || n === 12))
|
|
13
|
+
if ((!/[1-9]/.test(decimalPart) && (n === 2 || n === 12)))
|
|
16
14
|
return "two";
|
|
15
|
+
if ((!/[1-9]/.test(decimalPart) && (n === 3 || n === 13)))
|
|
16
|
+
return "few";
|
|
17
17
|
}
|
|
18
18
|
else {
|
|
19
|
-
if (((
|
|
20
|
-
return "few";
|
|
21
|
-
if ((n === 1 || n === 11))
|
|
19
|
+
if ((!/[1-9]/.test(decimalPart) && (n === 1 || n === 11)))
|
|
22
20
|
return "one";
|
|
23
|
-
if ((n === 2 || n === 12))
|
|
21
|
+
if ((!/[1-9]/.test(decimalPart) && (n === 2 || n === 12)))
|
|
24
22
|
return "two";
|
|
23
|
+
if ((!/[1-9]/.test(decimalPart) && ((n >= 3 && n <= 10) || (n >= 13 && n <= 19))))
|
|
24
|
+
return "few";
|
|
25
25
|
}
|
|
26
26
|
return "other";
|
|
27
27
|
}},"locale":"gd"})
|
|
@@ -33,20 +33,20 @@ if (Intl.PluralRules && typeof Intl.PluralRules.__addLocaleData === 'function')
|
|
|
33
33
|
const decimalPart = parts[1] || "";
|
|
34
34
|
const n = Math.abs(parseFloat(numStr));
|
|
35
35
|
if (isOrdinal) {
|
|
36
|
-
if ((n ===
|
|
37
|
-
return "few";
|
|
38
|
-
if ((n === 1 || n === 11))
|
|
36
|
+
if ((!/[1-9]/.test(decimalPart) && (n === 1 || n === 11)))
|
|
39
37
|
return "one";
|
|
40
|
-
if ((n === 2 || n === 12))
|
|
38
|
+
if ((!/[1-9]/.test(decimalPart) && (n === 2 || n === 12)))
|
|
41
39
|
return "two";
|
|
40
|
+
if ((!/[1-9]/.test(decimalPart) && (n === 3 || n === 13)))
|
|
41
|
+
return "few";
|
|
42
42
|
}
|
|
43
43
|
else {
|
|
44
|
-
if (((
|
|
45
|
-
return "few";
|
|
46
|
-
if ((n === 1 || n === 11))
|
|
44
|
+
if ((!/[1-9]/.test(decimalPart) && (n === 1 || n === 11)))
|
|
47
45
|
return "one";
|
|
48
|
-
if ((n === 2 || n === 12))
|
|
46
|
+
if ((!/[1-9]/.test(decimalPart) && (n === 2 || n === 12)))
|
|
49
47
|
return "two";
|
|
48
|
+
if ((!/[1-9]/.test(decimalPart) && ((n >= 3 && n <= 10) || (n >= 13 && n <= 19))))
|
|
49
|
+
return "few";
|
|
50
50
|
}
|
|
51
51
|
return "other";
|
|
52
52
|
}},"locale":"gd"})
|
package/locale-data/gsw.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/gu.js
CHANGED
|
@@ -9,17 +9,17 @@ if (Intl.PluralRules && typeof Intl.PluralRules.__addLocaleData === 'function')
|
|
|
9
9
|
const n = Math.abs(parseFloat(numStr));
|
|
10
10
|
const i = Math.floor(Math.abs(parseFloat(integerPart)));
|
|
11
11
|
if (isOrdinal) {
|
|
12
|
-
if (n ===
|
|
13
|
-
return "few";
|
|
14
|
-
if (n === 6)
|
|
15
|
-
return "many";
|
|
16
|
-
if (n === 1)
|
|
12
|
+
if ((!/[1-9]/.test(decimalPart) && n === 1))
|
|
17
13
|
return "one";
|
|
18
|
-
if ((n === 2 || n === 3))
|
|
14
|
+
if ((!/[1-9]/.test(decimalPart) && (n === 2 || n === 3)))
|
|
19
15
|
return "two";
|
|
16
|
+
if ((!/[1-9]/.test(decimalPart) && n === 4))
|
|
17
|
+
return "few";
|
|
18
|
+
if ((!/[1-9]/.test(decimalPart) && n === 6))
|
|
19
|
+
return "many";
|
|
20
20
|
}
|
|
21
21
|
else {
|
|
22
|
-
if (i === 0 || n === 1)
|
|
22
|
+
if (i === 0 || (!/[1-9]/.test(decimalPart) && n === 1))
|
|
23
23
|
return "one";
|
|
24
24
|
}
|
|
25
25
|
return "other";
|
|
@@ -33,17 +33,17 @@ if (Intl.PluralRules && typeof Intl.PluralRules.__addLocaleData === 'function')
|
|
|
33
33
|
const n = Math.abs(parseFloat(numStr));
|
|
34
34
|
const i = Math.floor(Math.abs(parseFloat(integerPart)));
|
|
35
35
|
if (isOrdinal) {
|
|
36
|
-
if (n ===
|
|
37
|
-
return "few";
|
|
38
|
-
if (n === 6)
|
|
39
|
-
return "many";
|
|
40
|
-
if (n === 1)
|
|
36
|
+
if ((!/[1-9]/.test(decimalPart) && n === 1))
|
|
41
37
|
return "one";
|
|
42
|
-
if ((n === 2 || n === 3))
|
|
38
|
+
if ((!/[1-9]/.test(decimalPart) && (n === 2 || n === 3)))
|
|
43
39
|
return "two";
|
|
40
|
+
if ((!/[1-9]/.test(decimalPart) && n === 4))
|
|
41
|
+
return "few";
|
|
42
|
+
if ((!/[1-9]/.test(decimalPart) && n === 6))
|
|
43
|
+
return "many";
|
|
44
44
|
}
|
|
45
45
|
else {
|
|
46
|
-
if (i === 0 || n === 1)
|
|
46
|
+
if (i === 0 || (!/[1-9]/.test(decimalPart) && n === 1))
|
|
47
47
|
return "one";
|
|
48
48
|
}
|
|
49
49
|
return "other";
|