Skip to content

Commit

Permalink
add cyrillyc tests without Intl rules
Browse files Browse the repository at this point in the history
  • Loading branch information
Maksim Sinelnikov committed Sep 25, 2024
1 parent efeaec9 commit 7dfa068
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion src/core/prelude/i18n/spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ describe('core/prelude/i18n', () => {
});

describe('pluralization for cyrillic language', () => {
it('russian language', () => {
it('russian language with Intl', () => {
const
cyrillicRules = new Intl.PluralRules('ru'),
forms = {
Expand All @@ -110,5 +110,21 @@ describe('core/prelude/i18n', () => {
expect(resolveTemplate(forms, {count: 12}, {pluralRules: cyrillicRules})).toBe('12 яблок');
expect(resolveTemplate(forms, {count: 22}, {pluralRules: cyrillicRules})).toBe('22 яблока');
});

it('russian language without Intl', () => {
const
forms = {
one: '{count} яблоко',
few: '{count} яблока',
many: '{count} яблок',
zero: '{count} яблок'
};

expect(resolveTemplate(forms, {count: 1})).toBe('1 яблоко');
expect(resolveTemplate(forms, {count: 2})).toBe('2 яблока');
expect(resolveTemplate(forms, {count: 0})).toBe('0 яблок');
expect(resolveTemplate(forms, {count: 12})).toBe('12 яблок');
expect(resolveTemplate(forms, {count: 22})).toBe('22 яблок');
});
});
});

0 comments on commit 7dfa068

Please sign in to comment.