Skip to content

Commit

Permalink
feat: Update to CLDR 39
Browse files Browse the repository at this point in the history
  • Loading branch information
eemeli committed Aug 26, 2021
1 parent 8c6a553 commit ed2bdbc
Show file tree
Hide file tree
Showing 15 changed files with 208 additions and 170 deletions.
18 changes: 9 additions & 9 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
4 changes: 3 additions & 1 deletion packages/plurals/cardinals.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand All @@ -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";
Expand Down Expand Up @@ -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";
Expand Down
11 changes: 10 additions & 1 deletion packages/plurals/cardinals.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -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,

Expand Down Expand Up @@ -341,6 +348,8 @@ lb: a,

lg: a,

lij: d,

lkt: e,

ln: b,
Expand Down
9 changes: 8 additions & 1 deletion packages/plurals/cardinals.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -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) => {
Expand Down Expand Up @@ -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;
Expand Down
2 changes: 2 additions & 0 deletions packages/plurals/ordinals.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand All @@ -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";
Expand Down
7 changes: 7 additions & 0 deletions packages/plurals/ordinals.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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'
Expand Down
5 changes: 5 additions & 0 deletions packages/plurals/ordinals.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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'
Expand Down
4 changes: 3 additions & 1 deletion packages/plurals/pluralCategories.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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"]};
Expand All @@ -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"]};
Expand Down Expand Up @@ -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"]};
Expand Down
4 changes: 3 additions & 1 deletion packages/plurals/pluralCategories.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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]},
Expand Down Expand Up @@ -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]},
Expand Down
4 changes: 3 additions & 1 deletion packages/plurals/pluralCategories.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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]};
Expand Down Expand Up @@ -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]};
Expand Down
4 changes: 3 additions & 1 deletion packages/plurals/plurals.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand All @@ -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";
Expand Down Expand Up @@ -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";
Expand Down
Loading

0 comments on commit ed2bdbc

Please sign in to comment.