diff --git a/package-lock.json b/package-lock.json index ec552b3..d41e248 100644 --- a/package-lock.json +++ b/package-lock.json @@ -20,7 +20,7 @@ "@babel/preset-env": "^7.12.0", "@babel/register": "^7.12.0", "chai": "^4.2.0", - "cldr-core": "^37.0.0", + "cldr-core": "^39.0.0", "gulp": "^4.0.2", "gulp-babel": "^8.0.0", "mocha": "^9.1.0", @@ -2450,9 +2450,9 @@ } }, "node_modules/cldr-core": { - "version": "37.0.0", - "resolved": "https://registry.npmjs.org/cldr-core/-/cldr-core-37.0.0.tgz", - "integrity": "sha512-tNH5lbfsE9xzsjjXQjq1tlpMFcmnQYfssDy0zYIZKVtAY18MeQy0+1qlLxB2Z9dwCixGJV8cdhtFjBOub077Gw==" + "version": "39.0.0", + "resolved": "https://registry.npmjs.org/cldr-core/-/cldr-core-39.0.0.tgz", + "integrity": "sha512-ZSElD4Ckl2W3ApP+jz8XXOWen+UqELaO76P0J1H6SKxWuwkba1zmE5gU0grNyuI1RAYwBRUhbeIV+YTsJ7yw3g==" }, "node_modules/clean-stack": { "version": "2.2.0", @@ -8186,7 +8186,7 @@ "version": "6.2.1", "license": "ISC", "dependencies": { - "cldr-core": "^37.0.0", + "cldr-core": "^39.0.0", "make-plural-compiler": "^5.1.0", "safe-identifier": "^0.4.2", "yargs": "^17.1.1" @@ -10099,9 +10099,9 @@ } }, "cldr-core": { - "version": "37.0.0", - "resolved": "https://registry.npmjs.org/cldr-core/-/cldr-core-37.0.0.tgz", - "integrity": "sha512-tNH5lbfsE9xzsjjXQjq1tlpMFcmnQYfssDy0zYIZKVtAY18MeQy0+1qlLxB2Z9dwCixGJV8cdhtFjBOub077Gw==" + "version": "39.0.0", + "resolved": "https://registry.npmjs.org/cldr-core/-/cldr-core-39.0.0.tgz", + "integrity": "sha512-ZSElD4Ckl2W3ApP+jz8XXOWen+UqELaO76P0J1H6SKxWuwkba1zmE5gU0grNyuI1RAYwBRUhbeIV+YTsJ7yw3g==" }, "clean-stack": { "version": "2.2.0", @@ -11860,7 +11860,7 @@ "make-plural-cli": { "version": "file:packages/cli", "requires": { - "cldr-core": "^37.0.0", + "cldr-core": "^39.0.0", "make-plural-compiler": "^5.1.0", "safe-identifier": "^0.4.2", "yargs": "^17.1.1" diff --git a/package.json b/package.json index 650e885..2a579e3 100644 --- a/package.json +++ b/package.json @@ -29,7 +29,7 @@ "@babel/preset-env": "^7.12.0", "@babel/register": "^7.12.0", "chai": "^4.2.0", - "cldr-core": "^37.0.0", + "cldr-core": "^39.0.0", "gulp": "^4.0.2", "gulp-babel": "^8.0.0", "mocha": "^9.1.0", diff --git a/packages/cli/package.json b/packages/cli/package.json index b1a977d..15aa292 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -28,7 +28,7 @@ "make-plural": "./make-plural" }, "dependencies": { - "cldr-core": "^37.0.0", + "cldr-core": "^39.0.0", "make-plural-compiler": "^5.1.0", "safe-identifier": "^0.4.2", "yargs": "^17.1.1" diff --git a/packages/plurals/cardinals.d.ts b/packages/plurals/cardinals.d.ts index 47a007d..ff42a8c 100644 --- a/packages/plurals/cardinals.d.ts +++ b/packages/plurals/cardinals.d.ts @@ -31,6 +31,7 @@ export const cs: (n: number | string) => "one" | "few" | "many" | "other"; export const cy: (n: number | string) => "zero" | "one" | "two" | "few" | "many" | "other"; export const da: (n: number | string) => "one" | "other"; export const de: (n: number | string) => "one" | "other"; +export const doi: (n: number | string) => "one" | "other"; export const dsb: (n: number | string) => "one" | "two" | "few" | "other"; export const dv: (n: number | string) => "one" | "other"; export const dz: (n: number | string) => "other"; @@ -46,7 +47,7 @@ export const ff: (n: number | string) => "one" | "other"; export const fi: (n: number | string) => "one" | "other"; export const fil: (n: number | string) => "one" | "other"; export const fo: (n: number | string) => "one" | "other"; -export const fr: (n: number | string) => "one" | "other"; +export const fr: (n: number | string) => "one" | "many" | "other"; export const fur: (n: number | string) => "one" | "other"; export const fy: (n: number | string) => "one" | "other"; export const ga: (n: number | string) => "one" | "two" | "few" | "many" | "other"; @@ -102,6 +103,7 @@ export const ky: (n: number | string) => "one" | "other"; export const lag: (n: number | string) => "zero" | "one" | "other"; export const lb: (n: number | string) => "one" | "other"; export const lg: (n: number | string) => "one" | "other"; +export const lij: (n: number | string) => "one" | "other"; export const lkt: (n: number | string) => "other"; export const ln: (n: number | string) => "one" | "other"; export const lo: (n: number | string) => "other"; diff --git a/packages/plurals/cardinals.js b/packages/plurals/cardinals.js index 1c4bc4d..3043ab1 100644 --- a/packages/plurals/cardinals.js +++ b/packages/plurals/cardinals.js @@ -131,6 +131,8 @@ da: (n) => { de: d, +doi: c, + dsb: (n) => { const s = String(n).split('.'), i = s[0], f = s[1] || '', v0 = !s[1], i100 = i.slice(-2), f100 = f.slice(-2); return v0 && i100 == 1 || f100 == 1 ? 'one' @@ -170,7 +172,12 @@ fil: (n) => { fo: a, -fr: (n) => n >= 0 && n < 2 ? 'one' : 'other', +fr: (n) => { + const s = String(n).split('.'), i = s[0], v0 = !s[1], i1000000 = i.slice(-6); + return n >= 0 && n < 2 ? 'one' + : i != 0 && i1000000 == 0 && v0 ? 'many' + : 'other'; +}, fur: a, @@ -341,6 +348,8 @@ lb: a, lg: a, +lij: d, + lkt: e, ln: b, diff --git a/packages/plurals/cardinals.mjs b/packages/plurals/cardinals.mjs index 8cd7426..d1d933d 100644 --- a/packages/plurals/cardinals.mjs +++ b/packages/plurals/cardinals.mjs @@ -93,6 +93,7 @@ export const da = (n) => { return n == 1 || !t0 && (i == 0 || i == 1) ? 'one' : 'other'; }; export const de = d; +export const doi = c; export const dsb = (n) => { const s = String(n).split('.'), i = s[0], f = s[1] || '', v0 = !s[1], i100 = i.slice(-2), f100 = f.slice(-2); return v0 && i100 == 1 || f100 == 1 ? 'one' @@ -117,7 +118,12 @@ export const fil = (n) => { return v0 && (i == 1 || i == 2 || i == 3) || v0 && i10 != 4 && i10 != 6 && i10 != 9 || !v0 && f10 != 4 && f10 != 6 && f10 != 9 ? 'one' : 'other'; }; export const fo = a; -export const fr = (n) => n >= 0 && n < 2 ? 'one' : 'other'; +export const fr = (n) => { + const s = String(n).split('.'), i = s[0], v0 = !s[1], i1000000 = i.slice(-6); + return n >= 0 && n < 2 ? 'one' + : i != 0 && i1000000 == 0 && v0 ? 'many' + : 'other'; +}; export const fur = a; export const fy = d; export const ga = (n) => { @@ -233,6 +239,7 @@ export const lag = (n) => { }; export const lb = a; export const lg = a; +export const lij = d; export const lkt = e; export const ln = b; export const lo = e; diff --git a/packages/plurals/ordinals.d.ts b/packages/plurals/ordinals.d.ts index cf1a1b3..816b0a0 100644 --- a/packages/plurals/ordinals.d.ts +++ b/packages/plurals/ordinals.d.ts @@ -52,6 +52,7 @@ export const kn: (n: number | string) => "other"; export const ko: (n: number | string) => "other"; export const kw: (n: number | string) => "one" | "many" | "other"; export const ky: (n: number | string) => "other"; +export const lij: (n: number | string) => "many" | "other"; export const lo: (n: number | string) => "one" | "other"; export const lt: (n: number | string) => "other"; export const lv: (n: number | string) => "other"; @@ -65,6 +66,7 @@ export const my: (n: number | string) => "other"; export const nb: (n: number | string) => "other"; export const ne: (n: number | string) => "one" | "other"; export const nl: (n: number | string) => "other"; +export const no: (n: number | string) => "other"; export const or: (n: number | string) => "one" | "two" | "few" | "many" | "other"; export const pa: (n: number | string) => "other"; export const pl: (n: number | string) => "other"; diff --git a/packages/plurals/ordinals.js b/packages/plurals/ordinals.js index b8307e7..15ae823 100644 --- a/packages/plurals/ordinals.js +++ b/packages/plurals/ordinals.js @@ -166,6 +166,11 @@ kw: (n) => { ky: a, +lij: (n) => { + const s = String(n).split('.'), t0 = Number(s[0]) == n; + return (n == 11 || n == 8 || (t0 && n >= 80 && n <= 89) || (t0 && n >= 800 && n <= 899)) ? 'many' : 'other'; +}, + lo: b, lt: a, @@ -204,6 +209,8 @@ ne: (n) => { nl: a, +no: a, + or: (n) => { const s = String(n).split('.'), t0 = Number(s[0]) == n; return (n == 1 || n == 5 || (t0 && n >= 7 && n <= 9)) ? 'one' diff --git a/packages/plurals/ordinals.mjs b/packages/plurals/ordinals.mjs index 7c98942..ee2530a 100644 --- a/packages/plurals/ordinals.mjs +++ b/packages/plurals/ordinals.mjs @@ -108,6 +108,10 @@ export const kw = (n) => { : 'other'; }; export const ky = a; +export const lij = (n) => { + const s = String(n).split('.'), t0 = Number(s[0]) == n; + return (n == 11 || n == 8 || (t0 && n >= 80 && n <= 89) || (t0 && n >= 800 && n <= 899)) ? 'many' : 'other'; +}; export const lo = b; export const lt = a; export const lv = a; @@ -133,6 +137,7 @@ export const ne = (n) => { return (t0 && n >= 1 && n <= 4) ? 'one' : 'other'; }; export const nl = a; +export const no = a; export const or = (n) => { const s = String(n).split('.'), t0 = Number(s[0]) == n; return (n == 1 || n == 5 || (t0 && n >= 7 && n <= 9)) ? 'one' diff --git a/packages/plurals/pluralCategories.d.ts b/packages/plurals/pluralCategories.d.ts index 6727512..5d6828b 100644 --- a/packages/plurals/pluralCategories.d.ts +++ b/packages/plurals/pluralCategories.d.ts @@ -32,6 +32,7 @@ export const cs: {cardinal:["one","few","many","other"],ordinal:["other"]}; export const cy: {cardinal:["zero","one","two","few","many","other"],ordinal:["zero","one","two","few","many","other"]}; export const da: {cardinal:["one","other"],ordinal:["other"]}; export const de: {cardinal:["one","other"],ordinal:["other"]}; +export const doi: {cardinal:["one","other"],ordinal:["other"]}; export const dsb: {cardinal:["one","two","few","other"],ordinal:["other"]}; export const dv: {cardinal:["one","other"],ordinal:["other"]}; export const dz: {cardinal:["other"],ordinal:["other"]}; @@ -47,7 +48,7 @@ export const ff: {cardinal:["one","other"],ordinal:["other"]}; export const fi: {cardinal:["one","other"],ordinal:["other"]}; export const fil: {cardinal:["one","other"],ordinal:["one","other"]}; export const fo: {cardinal:["one","other"],ordinal:["other"]}; -export const fr: {cardinal:["one","other"],ordinal:["one","other"]}; +export const fr: {cardinal:["one","many","other"],ordinal:["one","other"]}; export const fur: {cardinal:["one","other"],ordinal:["other"]}; export const fy: {cardinal:["one","other"],ordinal:["other"]}; export const ga: {cardinal:["one","two","few","many","other"],ordinal:["one","other"]}; @@ -102,6 +103,7 @@ export const ky: {cardinal:["one","other"],ordinal:["other"]}; export const lag: {cardinal:["zero","one","other"],ordinal:["other"]}; export const lb: {cardinal:["one","other"],ordinal:["other"]}; export const lg: {cardinal:["one","other"],ordinal:["other"]}; +export const lij: {cardinal:["one","other"],ordinal:["many","other"]}; export const lkt: {cardinal:["other"],ordinal:["other"]}; export const ln: {cardinal:["one","other"],ordinal:["other"]}; export const lo: {cardinal:["other"],ordinal:["one","other"]}; diff --git a/packages/plurals/pluralCategories.js b/packages/plurals/pluralCategories.js index de6f63b..f2cdfb9 100644 --- a/packages/plurals/pluralCategories.js +++ b/packages/plurals/pluralCategories.js @@ -43,6 +43,7 @@ cs: c, cy: {cardinal:[z,o,t,f,m,x],ordinal:[z,o,t,f,m,x]}, da: a, de: a, +doi: a, dsb: {cardinal:[o,t,f,x],ordinal:[x]}, dv: a, dz: b, @@ -58,7 +59,7 @@ ff: a, fi: a, fil: d, fo: a, -fr: d, +fr: {cardinal:[o,m,x],ordinal:[o,x]}, fur: a, fy: a, ga: {cardinal:[o,t,f,m,x],ordinal:[o,x]}, @@ -113,6 +114,7 @@ ky: a, lag: {cardinal:[z,o,x],ordinal:[x]}, lb: a, lg: a, +lij: {cardinal:[o,x],ordinal:[m,x]}, lkt: b, ln: a, lo: {cardinal:[x],ordinal:[o,x]}, diff --git a/packages/plurals/pluralCategories.mjs b/packages/plurals/pluralCategories.mjs index 8324808..678c8a7 100644 --- a/packages/plurals/pluralCategories.mjs +++ b/packages/plurals/pluralCategories.mjs @@ -37,6 +37,7 @@ export const cs = c; export const cy = {cardinal:[z,o,t,f,m,x],ordinal:[z,o,t,f,m,x]}; export const da = a; export const de = a; +export const doi = a; export const dsb = {cardinal:[o,t,f,x],ordinal:[x]}; export const dv = a; export const dz = b; @@ -52,7 +53,7 @@ export const ff = a; export const fi = a; export const fil = d; export const fo = a; -export const fr = d; +export const fr = {cardinal:[o,m,x],ordinal:[o,x]}; export const fur = a; export const fy = a; export const ga = {cardinal:[o,t,f,m,x],ordinal:[o,x]}; @@ -107,6 +108,7 @@ export const ky = a; export const lag = {cardinal:[z,o,x],ordinal:[x]}; export const lb = a; export const lg = a; +export const lij = {cardinal:[o,x],ordinal:[m,x]}; export const lkt = b; export const ln = a; export const lo = {cardinal:[x],ordinal:[o,x]}; diff --git a/packages/plurals/plurals.d.ts b/packages/plurals/plurals.d.ts index e0094a3..8ecc5df 100644 --- a/packages/plurals/plurals.d.ts +++ b/packages/plurals/plurals.d.ts @@ -31,6 +31,7 @@ export const cs: (n: number | string, ord?: boolean) => "one" | "few" | "many" | export const cy: (n: number | string, ord?: boolean) => "zero" | "one" | "two" | "few" | "many" | "other"; export const da: (n: number | string, ord?: boolean) => "one" | "other"; export const de: (n: number | string, ord?: boolean) => "one" | "other"; +export const doi: (n: number | string, ord?: boolean) => "one" | "other"; export const dsb: (n: number | string, ord?: boolean) => "one" | "two" | "few" | "other"; export const dv: (n: number | string, ord?: boolean) => "one" | "other"; export const dz: (n: number | string, ord?: boolean) => "other"; @@ -46,7 +47,7 @@ export const ff: (n: number | string, ord?: boolean) => "one" | "other"; export const fi: (n: number | string, ord?: boolean) => "one" | "other"; export const fil: (n: number | string, ord?: boolean) => "one" | "other"; export const fo: (n: number | string, ord?: boolean) => "one" | "other"; -export const fr: (n: number | string, ord?: boolean) => "one" | "other"; +export const fr: (n: number | string, ord?: boolean) => "one" | "many" | "other"; export const fur: (n: number | string, ord?: boolean) => "one" | "other"; export const fy: (n: number | string, ord?: boolean) => "one" | "other"; export const ga: (n: number | string, ord?: boolean) => "one" | "two" | "few" | "many" | "other"; @@ -102,6 +103,7 @@ export const ky: (n: number | string, ord?: boolean) => "one" | "other"; export const lag: (n: number | string, ord?: boolean) => "zero" | "one" | "other"; export const lb: (n: number | string, ord?: boolean) => "one" | "other"; export const lg: (n: number | string, ord?: boolean) => "one" | "other"; +export const lij: (n: number | string, ord?: boolean) => "one" | "many" | "other"; export const lkt: (n: number | string, ord?: boolean) => "other"; export const ln: (n: number | string, ord?: boolean) => "one" | "other"; export const lo: (n: number | string, ord?: boolean) => "one" | "other"; diff --git a/packages/plurals/plurals.js b/packages/plurals/plurals.js index 42d3429..d1bed26 100644 --- a/packages/plurals/plurals.js +++ b/packages/plurals/plurals.js @@ -7,12 +7,16 @@ const b = (n, ord) => { return (n == 0 || n == 1) ? 'one' : 'other'; }; const c = (n, ord) => { + if (ord) return 'other'; + return n >= 0 && n <= 1 ? 'one' : 'other'; +}; +const d = (n, ord) => { const s = String(n).split('.'), v0 = !s[1]; if (ord) return 'other'; return n == 1 && v0 ? 'one' : 'other'; }; -const d = (n, ord) => 'other'; -const e = (n, ord) => { +const e = (n, ord) => 'other'; +const f = (n, ord) => { if (ord) return 'other'; return n == 1 ? 'one' : n == 2 ? 'two' @@ -25,16 +29,13 @@ const e = (n, ord) => { else if (typeof exports === 'object') module.exports = plurals; else root.plurals = plurals; }(this, { -_in: d, +_in: e, af: a, ak: b, -am: (n, ord) => { - if (ord) return 'other'; - return n >= 0 && n <= 1 ? 'one' : 'other'; -}, +am: c, an: a, @@ -71,7 +72,7 @@ as: (n, ord) => { asa: a, -ast: c, +ast: d, az: (n, ord) => { const s = String(n).split('.'), i = s[0], i10 = i.slice(-1), i100 = i.slice(-2), i1000 = i.slice(-3); @@ -99,7 +100,7 @@ bg: a, bho: b, -bm: d, +bm: e, bn: (n, ord) => { if (ord) return (n == 1 || n == 5 || n == 7 || n == 8 || n == 9 || n == 10) ? 'one' @@ -110,7 +111,7 @@ bn: (n, ord) => { return n >= 0 && n <= 1 ? 'one' : 'other'; }, -bo: d, +bo: e, br: (n, ord) => { const s = String(n).split('.'), t0 = Number(s[0]) == n, n10 = t0 && s[0].slice(-1), n100 = t0 && s[0].slice(-2), n1000000 = t0 && s[0].slice(-6); @@ -185,7 +186,9 @@ da: (n, ord) => { return n == 1 || !t0 && (i == 0 || i == 1) ? 'one' : 'other'; }, -de: c, +de: d, + +doi: c, dsb: (n, ord) => { const s = String(n).split('.'), i = s[0], f = s[1] || '', v0 = !s[1], i100 = i.slice(-2), f100 = f.slice(-2); @@ -198,7 +201,7 @@ dsb: (n, ord) => { dv: a, -dz: d, +dz: e, ee: a, @@ -217,21 +220,18 @@ eo: a, es: a, -et: c, +et: d, eu: a, -fa: (n, ord) => { - if (ord) return 'other'; - return n >= 0 && n <= 1 ? 'one' : 'other'; -}, +fa: c, ff: (n, ord) => { if (ord) return 'other'; return n >= 0 && n < 2 ? 'one' : 'other'; }, -fi: c, +fi: d, fil: (n, ord) => { const s = String(n).split('.'), i = s[0], f = s[1] || '', v0 = !s[1], i10 = i.slice(-1), f10 = f.slice(-1); @@ -242,13 +242,16 @@ fil: (n, ord) => { fo: a, fr: (n, ord) => { + const s = String(n).split('.'), i = s[0], v0 = !s[1], i1000000 = i.slice(-6); if (ord) return n == 1 ? 'one' : 'other'; - return n >= 0 && n < 2 ? 'one' : 'other'; + return n >= 0 && n < 2 ? 'one' + : i != 0 && i1000000 == 0 && v0 ? 'many' + : 'other'; }, fur: a, -fy: c, +fy: d, ga: (n, ord) => { const s = String(n).split('.'), t0 = Number(s[0]) == n; @@ -272,7 +275,7 @@ gd: (n, ord) => { : 'other'; }, -gl: c, +gl: d, gsw: a, @@ -346,15 +349,15 @@ hy: (n, ord) => { return n >= 0 && n < 2 ? 'one' : 'other'; }, -ia: c, +ia: d, -id: d, +id: e, -ig: d, +ig: e, -ii: d, +ii: e, -io: c, +io: d, is: (n, ord) => { const s = String(n).split('.'), i = s[0], t0 = Number(s[0]) == n, i10 = i.slice(-1), i100 = i.slice(-2); @@ -368,7 +371,7 @@ it: (n, ord) => { return n == 1 && v0 ? 'one' : 'other'; }, -iu: e, +iu: f, iw: (n, ord) => { const s = String(n).split('.'), i = s[0], v0 = !s[1], t0 = Number(s[0]) == n, n10 = t0 && s[0].slice(-1); @@ -379,19 +382,19 @@ iw: (n, ord) => { : 'other'; }, -ja: d, +ja: e, -jbo: d, +jbo: e, jgo: a, -ji: c, +ji: d, jmc: a, -jv: d, +jv: e, -jw: d, +jw: e, ka: (n, ord) => { const s = String(n).split('.'), i = s[0], i100 = i.slice(-2); @@ -410,9 +413,9 @@ kaj: a, kcg: a, -kde: d, +kde: e, -kea: d, +kea: e, kk: (n, ord) => { const s = String(n).split('.'), t0 = Number(s[0]) == n, n10 = t0 && s[0].slice(-1); @@ -424,14 +427,11 @@ kkj: a, kl: a, -km: d, +km: e, -kn: (n, ord) => { - if (ord) return 'other'; - return n >= 0 && n <= 1 ? 'one' : 'other'; -}, +kn: c, -ko: d, +ko: e, ks: a, @@ -473,7 +473,13 @@ lb: a, lg: a, -lkt: d, +lij: (n, ord) => { + const s = String(n).split('.'), v0 = !s[1], t0 = Number(s[0]) == n; + if (ord) return (n == 11 || n == 8 || (t0 && n >= 80 && n <= 89) || (t0 && n >= 800 && n <= 899)) ? 'many' : 'other'; + return n == 1 && v0 ? 'one' : 'other'; +}, + +lkt: e, ln: b, @@ -548,11 +554,11 @@ mt: (n, ord) => { : 'other'; }, -my: d, +my: e, nah: a, -naq: e, +naq: f, nb: a, @@ -564,7 +570,7 @@ ne: (n, ord) => { return n == 1 ? 'one' : 'other'; }, -nl: c, +nl: d, nn: a, @@ -572,7 +578,7 @@ nnh: a, no: a, -nqo: d, +nqo: e, nr: a, @@ -596,16 +602,13 @@ or: (n, ord) => { os: a, -osa: d, +osa: e, pa: b, pap: a, -pcm: (n, ord) => { - if (ord) return 'other'; - return n >= 0 && n <= 1 ? 'one' : 'other'; -}, +pcm: c, pl: (n, ord) => { const s = String(n).split('.'), i = s[0], v0 = !s[1], i10 = i.slice(-1), i100 = i.slice(-2); @@ -632,7 +635,7 @@ pt: (n, ord) => { return (i == 0 || i == 1) ? 'one' : 'other'; }, -pt_PT: c, +pt_PT: d, rm: a, @@ -646,7 +649,7 @@ ro: (n, ord) => { rof: a, -root: d, +root: e, ru: (n, ord) => { const s = String(n).split('.'), i = s[0], v0 = !s[1], i10 = i.slice(-1), i100 = i.slice(-2); @@ -659,11 +662,11 @@ ru: (n, ord) => { rwk: a, -sah: d, +sah: e, saq: a, -sat: e, +sat: f, sc: (n, ord) => { const s = String(n).split('.'), v0 = !s[1]; @@ -681,13 +684,13 @@ sd: a, sdh: a, -se: e, +se: f, seh: a, -ses: d, +ses: e, -sg: d, +sg: e, sh: (n, ord) => { const s = String(n).split('.'), i = s[0], f = s[1] || '', v0 = !s[1], i10 = i.slice(-1), i100 = i.slice(-2), f10 = f.slice(-1), f100 = f.slice(-2); @@ -729,15 +732,15 @@ sl: (n, ord) => { : 'other'; }, -sma: e, +sma: f, -smi: e, +smi: f, -smj: e, +smj: f, -smn: e, +smn: f, -sms: e, +sms: f, sn: a, @@ -765,7 +768,7 @@ ssy: a, st: a, -su: d, +su: e, sv: (n, ord) => { const s = String(n).split('.'), v0 = !s[1], t0 = Number(s[0]) == n, n10 = t0 && s[0].slice(-1), n100 = t0 && s[0].slice(-2); @@ -773,7 +776,7 @@ sv: (n, ord) => { return n == 1 && v0 ? 'one' : 'other'; }, -sw: c, +sw: d, syr: a, @@ -783,7 +786,7 @@ te: a, teo: a, -th: d, +th: e, ti: b, @@ -803,7 +806,7 @@ tl: (n, ord) => { tn: a, -to: d, +to: e, tr: a, @@ -826,7 +829,7 @@ uk: (n, ord) => { : 'other'; }, -ur: c, +ur: d, uz: a, @@ -845,22 +848,19 @@ wa: b, wae: a, -wo: d, +wo: e, xh: a, xog: a, -yi: c, +yi: d, -yo: d, +yo: e, -yue: d, +yue: e, -zh: d, +zh: e, -zu: (n, ord) => { - if (ord) return 'other'; - return n >= 0 && n <= 1 ? 'one' : 'other'; -} +zu: c })); diff --git a/packages/plurals/plurals.mjs b/packages/plurals/plurals.mjs index 6d59f38..5cf5e64 100644 --- a/packages/plurals/plurals.mjs +++ b/packages/plurals/plurals.mjs @@ -7,25 +7,26 @@ const b = (n, ord) => { return (n == 0 || n == 1) ? 'one' : 'other'; }; const c = (n, ord) => { + if (ord) return 'other'; + return n >= 0 && n <= 1 ? 'one' : 'other'; +}; +const d = (n, ord) => { const s = String(n).split('.'), v0 = !s[1]; if (ord) return 'other'; return n == 1 && v0 ? 'one' : 'other'; }; -const d = (n, ord) => 'other'; -const e = (n, ord) => { +const e = (n, ord) => 'other'; +const f = (n, ord) => { if (ord) return 'other'; return n == 1 ? 'one' : n == 2 ? 'two' : 'other'; }; -export const _in = d; +export const _in = e; export const af = a; export const ak = b; -export const am = (n, ord) => { - if (ord) return 'other'; - return n >= 0 && n <= 1 ? 'one' : 'other'; -}; +export const am = c; export const an = a; export const ar = (n, ord) => { const s = String(n).split('.'), t0 = Number(s[0]) == n, n100 = t0 && s[0].slice(-2); @@ -56,7 +57,7 @@ export const as = (n, ord) => { return n >= 0 && n <= 1 ? 'one' : 'other'; }; export const asa = a; -export const ast = c; +export const ast = d; export const az = (n, ord) => { const s = String(n).split('.'), i = s[0], i10 = i.slice(-1), i100 = i.slice(-2), i1000 = i.slice(-3); if (ord) return (i10 == 1 || i10 == 2 || i10 == 5 || i10 == 7 || i10 == 8) || (i100 == 20 || i100 == 50 || i100 == 70 || i100 == 80) ? 'one' @@ -77,7 +78,7 @@ export const bem = a; export const bez = a; export const bg = a; export const bho = b; -export const bm = d; +export const bm = e; export const bn = (n, ord) => { if (ord) return (n == 1 || n == 5 || n == 7 || n == 8 || n == 9 || n == 10) ? 'one' : (n == 2 || n == 3) ? 'two' @@ -86,7 +87,7 @@ export const bn = (n, ord) => { : 'other'; return n >= 0 && n <= 1 ? 'one' : 'other'; }; -export const bo = d; +export const bo = e; export const br = (n, ord) => { const s = String(n).split('.'), t0 = Number(s[0]) == n, n10 = t0 && s[0].slice(-1), n100 = t0 && s[0].slice(-2), n1000000 = t0 && s[0].slice(-6); if (ord) return 'other'; @@ -148,7 +149,8 @@ export const da = (n, ord) => { if (ord) return 'other'; return n == 1 || !t0 && (i == 0 || i == 1) ? 'one' : 'other'; }; -export const de = c; +export const de = d; +export const doi = c; export const dsb = (n, ord) => { const s = String(n).split('.'), i = s[0], f = s[1] || '', v0 = !s[1], i100 = i.slice(-2), f100 = f.slice(-2); if (ord) return 'other'; @@ -158,7 +160,7 @@ export const dsb = (n, ord) => { : 'other'; }; export const dv = a; -export const dz = d; +export const dz = e; export const ee = a; export const el = a; export const en = (n, ord) => { @@ -171,17 +173,14 @@ export const en = (n, ord) => { }; export const eo = a; export const es = a; -export const et = c; +export const et = d; export const eu = a; -export const fa = (n, ord) => { - if (ord) return 'other'; - return n >= 0 && n <= 1 ? 'one' : 'other'; -}; +export const fa = c; export const ff = (n, ord) => { if (ord) return 'other'; return n >= 0 && n < 2 ? 'one' : 'other'; }; -export const fi = c; +export const fi = d; export const fil = (n, ord) => { const s = String(n).split('.'), i = s[0], f = s[1] || '', v0 = !s[1], i10 = i.slice(-1), f10 = f.slice(-1); if (ord) return n == 1 ? 'one' : 'other'; @@ -189,11 +188,14 @@ export const fil = (n, ord) => { }; export const fo = a; export const fr = (n, ord) => { + const s = String(n).split('.'), i = s[0], v0 = !s[1], i1000000 = i.slice(-6); if (ord) return n == 1 ? 'one' : 'other'; - return n >= 0 && n < 2 ? 'one' : 'other'; + return n >= 0 && n < 2 ? 'one' + : i != 0 && i1000000 == 0 && v0 ? 'many' + : 'other'; }; export const fur = a; -export const fy = c; +export const fy = d; export const ga = (n, ord) => { const s = String(n).split('.'), t0 = Number(s[0]) == n; if (ord) return n == 1 ? 'one' : 'other'; @@ -214,7 +216,7 @@ export const gd = (n, ord) => { : ((t0 && n >= 3 && n <= 10) || (t0 && n >= 13 && n <= 19)) ? 'few' : 'other'; }; -export const gl = c; +export const gl = d; export const gsw = a; export const gu = (n, ord) => { if (ord) return n == 1 ? 'one' @@ -275,11 +277,11 @@ export const hy = (n, ord) => { if (ord) return n == 1 ? 'one' : 'other'; return n >= 0 && n < 2 ? 'one' : 'other'; }; -export const ia = c; -export const id = d; -export const ig = d; -export const ii = d; -export const io = c; +export const ia = d; +export const id = e; +export const ig = e; +export const ii = e; +export const io = d; export const is = (n, ord) => { const s = String(n).split('.'), i = s[0], t0 = Number(s[0]) == n, i10 = i.slice(-1), i100 = i.slice(-2); if (ord) return 'other'; @@ -290,7 +292,7 @@ export const it = (n, ord) => { if (ord) return (n == 11 || n == 8 || n == 80 || n == 800) ? 'many' : 'other'; return n == 1 && v0 ? 'one' : 'other'; }; -export const iu = e; +export const iu = f; export const iw = (n, ord) => { const s = String(n).split('.'), i = s[0], v0 = !s[1], t0 = Number(s[0]) == n, n10 = t0 && s[0].slice(-1); if (ord) return 'other'; @@ -299,13 +301,13 @@ export const iw = (n, ord) => { : v0 && (n < 0 || n > 10) && t0 && n10 == 0 ? 'many' : 'other'; }; -export const ja = d; -export const jbo = d; +export const ja = e; +export const jbo = e; export const jgo = a; -export const ji = c; +export const ji = d; export const jmc = a; -export const jv = d; -export const jw = d; +export const jv = e; +export const jw = e; export const ka = (n, ord) => { const s = String(n).split('.'), i = s[0], i100 = i.slice(-2); if (ord) return i == 1 ? 'one' @@ -319,8 +321,8 @@ export const kab = (n, ord) => { }; export const kaj = a; export const kcg = a; -export const kde = d; -export const kea = d; +export const kde = e; +export const kea = e; export const kk = (n, ord) => { const s = String(n).split('.'), t0 = Number(s[0]) == n, n10 = t0 && s[0].slice(-1); if (ord) return n10 == 6 || n10 == 9 || t0 && n10 == 0 && n != 0 ? 'many' : 'other'; @@ -328,12 +330,9 @@ export const kk = (n, ord) => { }; export const kkj = a; export const kl = a; -export const km = d; -export const kn = (n, ord) => { - if (ord) return 'other'; - return n >= 0 && n <= 1 ? 'one' : 'other'; -}; -export const ko = d; +export const km = e; +export const kn = c; +export const ko = e; export const ks = a; export const ksb = a; export const ksh = (n, ord) => { @@ -365,7 +364,12 @@ export const lag = (n, ord) => { }; export const lb = a; export const lg = a; -export const lkt = d; +export const lij = (n, ord) => { + const s = String(n).split('.'), v0 = !s[1], t0 = Number(s[0]) == n; + if (ord) return (n == 11 || n == 8 || (t0 && n >= 80 && n <= 89) || (t0 && n >= 800 && n <= 899)) ? 'many' : 'other'; + return n == 1 && v0 ? 'one' : 'other'; +}; +export const lkt = e; export const ln = b; export const lo = (n, ord) => { if (ord) return n == 1 ? 'one' : 'other'; @@ -425,9 +429,9 @@ export const mt = (n, ord) => { : (n100 >= 11 && n100 <= 19) ? 'many' : 'other'; }; -export const my = d; +export const my = e; export const nah = a; -export const naq = e; +export const naq = f; export const nb = a; export const nd = a; export const ne = (n, ord) => { @@ -435,11 +439,11 @@ export const ne = (n, ord) => { if (ord) return (t0 && n >= 1 && n <= 4) ? 'one' : 'other'; return n == 1 ? 'one' : 'other'; }; -export const nl = c; +export const nl = d; export const nn = a; export const nnh = a; export const no = a; -export const nqo = d; +export const nqo = e; export const nr = a; export const nso = b; export const ny = a; @@ -455,13 +459,10 @@ export const or = (n, ord) => { return n == 1 ? 'one' : 'other'; }; export const os = a; -export const osa = d; +export const osa = e; export const pa = b; export const pap = a; -export const pcm = (n, ord) => { - if (ord) return 'other'; - return n >= 0 && n <= 1 ? 'one' : 'other'; -}; +export const pcm = c; export const pl = (n, ord) => { const s = String(n).split('.'), i = s[0], v0 = !s[1], i10 = i.slice(-1), i100 = i.slice(-2); if (ord) return 'other'; @@ -483,7 +484,7 @@ export const pt = (n, ord) => { if (ord) return 'other'; return (i == 0 || i == 1) ? 'one' : 'other'; }; -export const pt_PT = c; +export const pt_PT = d; export const rm = a; export const ro = (n, ord) => { const s = String(n).split('.'), v0 = !s[1], t0 = Number(s[0]) == n, n100 = t0 && s[0].slice(-2); @@ -493,7 +494,7 @@ export const ro = (n, ord) => { : 'other'; }; export const rof = a; -export const root = d; +export const root = e; export const ru = (n, ord) => { const s = String(n).split('.'), i = s[0], v0 = !s[1], i10 = i.slice(-1), i100 = i.slice(-2); if (ord) return 'other'; @@ -503,9 +504,9 @@ export const ru = (n, ord) => { : 'other'; }; export const rwk = a; -export const sah = d; +export const sah = e; export const saq = a; -export const sat = e; +export const sat = f; export const sc = (n, ord) => { const s = String(n).split('.'), v0 = !s[1]; if (ord) return (n == 11 || n == 8 || n == 80 || n == 800) ? 'many' : 'other'; @@ -518,10 +519,10 @@ export const scn = (n, ord) => { }; export const sd = a; export const sdh = a; -export const se = e; +export const se = f; export const seh = a; -export const ses = d; -export const sg = d; +export const ses = e; +export const sg = e; export const sh = (n, ord) => { const s = String(n).split('.'), i = s[0], f = s[1] || '', v0 = !s[1], i10 = i.slice(-1), i100 = i.slice(-2), f10 = f.slice(-1), f100 = f.slice(-2); if (ord) return 'other'; @@ -557,11 +558,11 @@ export const sl = (n, ord) => { : v0 && (i100 == 3 || i100 == 4) || !v0 ? 'few' : 'other'; }; -export const sma = e; -export const smi = e; -export const smj = e; -export const smn = e; -export const sms = e; +export const sma = f; +export const smi = f; +export const smj = f; +export const smn = f; +export const sms = f; export const sn = a; export const so = a; export const sq = (n, ord) => { @@ -581,18 +582,18 @@ export const sr = (n, ord) => { export const ss = a; export const ssy = a; export const st = a; -export const su = d; +export const su = e; export const sv = (n, ord) => { const s = String(n).split('.'), v0 = !s[1], t0 = Number(s[0]) == n, n10 = t0 && s[0].slice(-1), n100 = t0 && s[0].slice(-2); if (ord) return (n10 == 1 || n10 == 2) && n100 != 11 && n100 != 12 ? 'one' : 'other'; return n == 1 && v0 ? 'one' : 'other'; }; -export const sw = c; +export const sw = d; export const syr = a; export const ta = a; export const te = a; export const teo = a; -export const th = d; +export const th = e; export const ti = b; export const tig = a; export const tk = (n, ord) => { @@ -606,7 +607,7 @@ export const tl = (n, ord) => { return v0 && (i == 1 || i == 2 || i == 3) || v0 && i10 != 4 && i10 != 6 && i10 != 9 || !v0 && f10 != 4 && f10 != 6 && f10 != 9 ? 'one' : 'other'; }; export const tn = a; -export const to = d; +export const to = e; export const tr = a; export const ts = a; export const tzm = (n, ord) => { @@ -623,7 +624,7 @@ export const uk = (n, ord) => { : v0 && i10 == 0 || v0 && (i10 >= 5 && i10 <= 9) || v0 && (i100 >= 11 && i100 <= 14) ? 'many' : 'other'; }; -export const ur = c; +export const ur = d; export const uz = a; export const ve = a; export const vi = (n, ord) => { @@ -634,14 +635,11 @@ export const vo = a; export const vun = a; export const wa = b; export const wae = a; -export const wo = d; +export const wo = e; export const xh = a; export const xog = a; -export const yi = c; -export const yo = d; -export const yue = d; -export const zh = d; -export const zu = (n, ord) => { - if (ord) return 'other'; - return n >= 0 && n <= 1 ? 'one' : 'other'; -}; +export const yi = d; +export const yo = e; +export const yue = e; +export const zh = e; +export const zu = c;