fix(i18n): update NgLocalLocalization (#10771)

ref https://github.com/papandreou/node-cldr/issues/31
This commit is contained in:
Victor Berchet 2016-08-13 05:43:36 -07:00 committed by vikerman
parent 33ced7088f
commit 4df48b202c
4 changed files with 29 additions and 35 deletions

View File

@ -255,11 +255,10 @@ export function getPluralCase(locale: string, nLike: number | string): Plural {
case 'bs': case 'bs':
case 'hr': case 'hr':
case 'sr': case 'sr':
// https://github.com/papandreou/node-cldr/issues/31 if (v === 0 && i % 10 === 1 && !(i % 100 === 11) || f % 10 === 1 && !(f % 100 === 11))
if (v === 0 && i % 10 === 1 && (!(i % 100 === 11)) || f % 10 === 1 && !(f % 100 === 11))
return Plural.One; return Plural.One;
if (v === 0 && i % 10 === Math.floor(i % 10) && i % 10 >= 2 && i % 10 <= 4 && if (v === 0 && i % 10 === Math.floor(i % 10) && i % 10 >= 2 && i % 10 <= 4 &&
(!(i % 100 >= 12 && i % 100 <= 14)) || !(i % 100 >= 12 && i % 100 <= 14) ||
f % 10 === Math.floor(f % 10) && f % 10 >= 2 && f % 10 <= 4 && f % 10 === Math.floor(f % 10) && f % 10 >= 2 && f % 10 <= 4 &&
!(f % 100 >= 12 && f % 100 <= 14)) !(f % 100 >= 12 && f % 100 <= 14))
return Plural.Few; return Plural.Few;
@ -282,10 +281,10 @@ export function getPluralCase(locale: string, nLike: number | string): Plural {
return Plural.Other; return Plural.Other;
case 'dsb': case 'dsb':
case 'hsb': case 'hsb':
if (v === 0 && (i % 100 === 1 || f % 100 === 1)) return Plural.One; if (v === 0 && i % 100 === 1 || f % 100 === 1) return Plural.One;
if (v === 0 && (i % 100 === 2 || f % 100 === 2)) return Plural.Two; if (v === 0 && i % 100 === 2 || f % 100 === 2) return Plural.Two;
if (v === 0 && (i % 100 === Math.floor(i % 100) && i % 100 >= 3 && i % 100 <= 4 || if (v === 0 && i % 100 === Math.floor(i % 100) && i % 100 >= 3 && i % 100 <= 4 ||
f % 100 === Math.floor(f % 100) && f % 100 >= 3 && f % 100 <= 4)) f % 100 === Math.floor(f % 100) && f % 100 >= 3 && f % 100 <= 4)
return Plural.Few; return Plural.Few;
return Plural.Other; return Plural.Other;
case 'ff': case 'ff':
@ -295,9 +294,9 @@ export function getPluralCase(locale: string, nLike: number | string): Plural {
if (i === 0 || i === 1) return Plural.One; if (i === 0 || i === 1) return Plural.One;
return Plural.Other; return Plural.Other;
case 'fil': case 'fil':
if (v === 0 && (i === 1 || i === 2 || i === 3 || if (v === 0 && (i === 1 || i === 2 || i === 3) ||
v === 0 && (!(i % 10 === 4 || i % 10 === 6 || i % 10 === 9) || v === 0 && !(i % 10 === 4 || i % 10 === 6 || i % 10 === 9) ||
!(v === 0) && !(f % 10 === 4 || f % 10 === 6 || f % 10 === 9)))) !(v === 0) && !(f % 10 === 4 || f % 10 === 6 || f % 10 === 9))
return Plural.One; return Plural.One;
return Plural.Other; return Plural.Other;
case 'ga': case 'ga':
@ -325,7 +324,7 @@ export function getPluralCase(locale: string, nLike: number | string): Plural {
if (v === 0 && !(n >= 0 && n <= 10) && n % 10 === 0) return Plural.Many; if (v === 0 && !(n >= 0 && n <= 10) && n % 10 === 0) return Plural.Many;
return Plural.Other; return Plural.Other;
case 'is': case 'is':
if (t === 0 && i % 10 === 1 && (!(i % 100 === 11) || !(t === 0))) return Plural.One; if (t === 0 && i % 10 === 1 && !(i % 100 === 11) || !(t === 0)) return Plural.One;
return Plural.Other; return Plural.Other;
case 'ksh': case 'ksh':
if (n === 0) return Plural.Zero; if (n === 0) return Plural.Zero;
@ -354,13 +353,12 @@ export function getPluralCase(locale: string, nLike: number | string): Plural {
if (n % 10 === 0 || n % 100 === Math.floor(n % 100) && n % 100 >= 11 && n % 100 <= 19 || if (n % 10 === 0 || n % 100 === Math.floor(n % 100) && n % 100 >= 11 && n % 100 <= 19 ||
v === 2 && f % 100 === Math.floor(f % 100) && f % 100 >= 11 && f % 100 <= 19) v === 2 && f % 100 === Math.floor(f % 100) && f % 100 >= 11 && f % 100 <= 19)
return Plural.Zero; return Plural.Zero;
if (n % 10 === 1 && if (n % 10 === 1 && !(n % 100 === 11) || v === 2 && f % 10 === 1 && !(f % 100 === 11) ||
(!(n % 100 === 11) || !(v === 2) && f % 10 === 1)
v === 2 && f % 10 === 1 && (!(f % 100 === 11) || !(v === 2) && f % 10 === 1)))
return Plural.One; return Plural.One;
return Plural.Other; return Plural.Other;
case 'mk': case 'mk':
if (v === 0 && (i % 10 === 1 || f % 10 === 1)) return Plural.One; if (v === 0 && i % 10 === 1 || f % 10 === 1) return Plural.One;
return Plural.Other; return Plural.Other;
case 'mt': case 'mt':
if (n === 1) return Plural.One; if (n === 1) return Plural.One;
@ -373,11 +371,9 @@ export function getPluralCase(locale: string, nLike: number | string): Plural {
if (v === 0 && i % 10 === Math.floor(i % 10) && i % 10 >= 2 && i % 10 <= 4 && if (v === 0 && i % 10 === Math.floor(i % 10) && i % 10 >= 2 && i % 10 <= 4 &&
!(i % 100 >= 12 && i % 100 <= 14)) !(i % 100 >= 12 && i % 100 <= 14))
return Plural.Few; return Plural.Few;
if (v === 0 && !(i === 1) && if (v === 0 && !(i === 1) && i % 10 === Math.floor(i % 10) && i % 10 >= 0 && i % 10 <= 1 ||
(i % 10 === Math.floor(i % 10) && i % 10 >= 0 && i % 10 <= 1 || v === 0 && i % 10 === Math.floor(i % 10) && i % 10 >= 5 && i % 10 <= 9 ||
v === 0 && v === 0 && i % 100 === Math.floor(i % 100) && i % 100 >= 12 && i % 100 <= 14)
(i % 10 === Math.floor(i % 10) && i % 10 >= 5 && i % 10 <= 9 ||
v === 0 && i % 100 === Math.floor(i % 100) && i % 100 >= 12 && i % 100 <= 14)))
return Plural.Many; return Plural.Many;
return Plural.Other; return Plural.Other;
case 'pt': case 'pt':
@ -395,10 +391,9 @@ export function getPluralCase(locale: string, nLike: number | string): Plural {
if (v === 0 && i % 10 === Math.floor(i % 10) && i % 10 >= 2 && i % 10 <= 4 && if (v === 0 && i % 10 === Math.floor(i % 10) && i % 10 >= 2 && i % 10 <= 4 &&
!(i % 100 >= 12 && i % 100 <= 14)) !(i % 100 >= 12 && i % 100 <= 14))
return Plural.Few; return Plural.Few;
if (v === 0 && (i % 10 === 0 || if (v === 0 && i % 10 === 0 ||
v === 0 && (i % 10 === Math.floor(i % 10) && i % 10 >= 5 && i % 10 <= 9 || v === 0 && i % 10 === Math.floor(i % 10) && i % 10 >= 5 && i % 10 <= 9 ||
v === 0 && i % 100 === Math.floor(i % 100) && i % 100 >= 11 && v === 0 && i % 100 === Math.floor(i % 100) && i % 100 >= 11 && i % 100 <= 14)
i % 100 <= 14)))
return Plural.Many; return Plural.Many;
return Plural.Other; return Plural.Other;
case 'shi': case 'shi':
@ -411,8 +406,7 @@ export function getPluralCase(locale: string, nLike: number | string): Plural {
case 'sl': case 'sl':
if (v === 0 && i % 100 === 1) return Plural.One; if (v === 0 && i % 100 === 1) return Plural.One;
if (v === 0 && i % 100 === 2) return Plural.Two; if (v === 0 && i % 100 === 2) return Plural.Two;
if (v === 0 && if (v === 0 && i % 100 === Math.floor(i % 100) && i % 100 >= 3 && i % 100 <= 4 || !(v === 0))
(i % 100 === Math.floor(i % 100) && i % 100 >= 3 && i % 100 <= 4 || !(v === 0)))
return Plural.Few; return Plural.Few;
return Plural.Other; return Plural.Other;
case 'tzm': case 'tzm':

View File

@ -1661,7 +1661,7 @@
} }
}, },
"cldr": { "cldr": {
"version": "3.5.0", "version": "3.5.2",
"dependencies": { "dependencies": {
"uglify-js": { "uglify-js": {
"version": "1.3.3" "version": "1.3.3"
@ -4408,7 +4408,7 @@
"version": "2.0.1" "version": "2.0.1"
}, },
"pegjs": { "pegjs": {
"version": "0.7.0" "version": "0.9.0"
}, },
"pify": { "pify": {
"version": "2.3.0" "version": "2.3.0"

12
npm-shrinkwrap.json generated
View File

@ -2599,9 +2599,9 @@
} }
}, },
"cldr": { "cldr": {
"version": "3.5.0", "version": "3.5.2",
"from": "cldr@latest", "from": "cldr@>=3.5.0 <4.0.0",
"resolved": "https://registry.npmjs.org/cldr/-/cldr-3.5.0.tgz", "resolved": "https://registry.npmjs.org/cldr/-/cldr-3.5.2.tgz",
"dependencies": { "dependencies": {
"uglify-js": { "uglify-js": {
"version": "1.3.3", "version": "1.3.3",
@ -7019,9 +7019,9 @@
"resolved": "https://registry.npmjs.org/pbkdf2-compat/-/pbkdf2-compat-2.0.1.tgz" "resolved": "https://registry.npmjs.org/pbkdf2-compat/-/pbkdf2-compat-2.0.1.tgz"
}, },
"pegjs": { "pegjs": {
"version": "0.7.0", "version": "0.9.0",
"from": "pegjs@0.7.0", "from": "pegjs@0.9.0",
"resolved": "https://registry.npmjs.org/pegjs/-/pegjs-0.7.0.tgz" "resolved": "https://registry.npmjs.org/pegjs/-/pegjs-0.9.0.tgz"
}, },
"pify": { "pify": {
"version": "2.3.0", "version": "2.3.0",

View File

@ -47,7 +47,7 @@
"canonical-path": "0.0.2", "canonical-path": "0.0.2",
"chokidar": "^1.1.0", "chokidar": "^1.1.0",
"clang-format": "^1.0.32", "clang-format": "^1.0.32",
"cldr": "^3.5.0", "cldr": "^3.5.2",
"conventional-changelog": "^1.1.0", "conventional-changelog": "^1.1.0",
"cors": "^2.7.1", "cors": "^2.7.1",
"firefox-profile": "^0.3.4", "firefox-profile": "^0.3.4",