fix(common): use correct ICU plural for locale mk (#24659)

PR Close #24659
This commit is contained in:
Olivier Combe
2018-06-25 17:17:56 +02:00
committed by Jason Aden
parent abed2cd52c
commit 39c8baea31
4 changed files with 55 additions and 38 deletions

View File

@ -2947,7 +2947,7 @@ export const locale_lv = [
function plural_mk(n: number): number {
let i = Math.floor(Math.abs(n)), v = n.toString().replace(/^[^.]*\.?/, '').length,
f = parseInt(n.toString().replace(/^[^.]*\.?/, ''), 10) || 0;
if (v === 0 && i % 10 === 1 || f % 10 === 1) return 1;
if (v === 0 && i % 10 === 1 && !(i % 100 === 11) || f % 10 === 1 && !(f % 100 === 11)) return 1;
return 5;
}

View File

@ -14,7 +14,7 @@ const u = undefined;
function plural(n: number): number {
let i = Math.floor(Math.abs(n)), v = n.toString().replace(/^[^.]*\.?/, '').length,
f = parseInt(n.toString().replace(/^[^.]*\.?/, ''), 10) || 0;
if (v === 0 && i % 10 === 1 || f % 10 === 1) return 1;
if (v === 0 && i % 10 === 1 && !(i % 100 === 11) || f % 10 === 1 && !(f % 100 === 11)) return 1;
return 5;
}