fix(common): always use 'other' case for locales with no plural rules (#16990)

Locales with no rules were using the wrong plural rule instead of the default.
This commit is contained in:
Olivier Combe
2017-05-30 19:46:36 +02:00
committed by Victor Berchet
parent 18bf77204e
commit 535d9da6b6
3 changed files with 38 additions and 56 deletions

View File

@ -119,6 +119,16 @@ export function main() {
expect(l10n.getPluralCategory(24)).toEqual('few');
expect(l10n.getPluralCategory(25)).toEqual('other');
});
it('should return the default value for a locale with no rule', () => {
const l10n = new NgLocaleLocalization('zgh');
expect(l10n.getPluralCategory(0)).toEqual('other');
expect(l10n.getPluralCategory(1)).toEqual('other');
expect(l10n.getPluralCategory(3)).toEqual('other');
expect(l10n.getPluralCategory(5)).toEqual('other');
expect(l10n.getPluralCategory(10)).toEqual('other');
});
});
describe('getPluralCategory', () => {
@ -157,4 +167,4 @@ export function main() {
});
});
});
}
}