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 'hr':
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;
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 % 100 >= 12 && f % 100 <= 14))
return Plural.Few;
@ -282,10 +281,10 @@ export function getPluralCase(locale: string, nLike: number | string): Plural {
return Plural.Other;
case 'dsb':
case 'hsb':
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 === Math.floor(i % 100) && i % 100 >= 3 && i % 100 <= 4 ||
f % 100 === Math.floor(f % 100) && f % 100 >= 3 && f % 100 <= 4))
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 === Math.floor(i % 100) && i % 100 >= 3 && i % 100 <= 4 ||
f % 100 === Math.floor(f % 100) && f % 100 >= 3 && f % 100 <= 4)
return Plural.Few;
return Plural.Other;
case 'ff':
@ -295,9 +294,9 @@ export function getPluralCase(locale: string, nLike: number | string): Plural {
if (i === 0 || i === 1) return Plural.One;
return Plural.Other;
case 'fil':
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))))
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))
return Plural.One;
return Plural.Other;
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;
return Plural.Other;
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;
case 'ksh':
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 ||
v === 2 && f % 100 === Math.floor(f % 100) && f % 100 >= 11 && f % 100 <= 19)
return Plural.Zero;
if (n % 10 === 1 &&
(!(n % 100 === 11) ||
v === 2 && f % 10 === 1 && (!(f % 100 === 11) || !(v === 2) && f % 10 === 1)))
if (n % 10 === 1 && !(n % 100 === 11) || v === 2 && f % 10 === 1 && !(f % 100 === 11) ||
!(v === 2) && f % 10 === 1)
return Plural.One;
return Plural.Other;
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;
case 'mt':
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 &&
!(i % 100 >= 12 && i % 100 <= 14))
return Plural.Few;
if (v === 0 && !(i === 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 && i % 100 === Math.floor(i % 100) && i % 100 >= 12 && i % 100 <= 14)))
if (v === 0 && !(i === 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 && i % 100 === Math.floor(i % 100) && i % 100 >= 12 && i % 100 <= 14)
return Plural.Many;
return Plural.Other;
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 &&
!(i % 100 >= 12 && i % 100 <= 14))
return Plural.Few;
if (v === 0 && (i % 10 === 0 ||
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 &&
i % 100 <= 14)))
if (v === 0 && i % 10 === 0 ||
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 && i % 100 <= 14)
return Plural.Many;
return Plural.Other;
case 'shi':
@ -411,8 +406,7 @@ export function getPluralCase(locale: string, nLike: number | string): Plural {
case 'sl':
if (v === 0 && i % 100 === 1) return Plural.One;
if (v === 0 && i % 100 === 2) return Plural.Two;
if (v === 0 &&
(i % 100 === Math.floor(i % 100) && i % 100 >= 3 && i % 100 <= 4 || !(v === 0)))
if (v === 0 && i % 100 === Math.floor(i % 100) && i % 100 >= 3 && i % 100 <= 4 || !(v === 0))
return Plural.Few;
return Plural.Other;
case 'tzm':

View File

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

12
npm-shrinkwrap.json generated
View File

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

View File

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