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:

committed by
Victor Berchet

parent
18bf77204e
commit
535d9da6b6
@ -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() {
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user