Skip to content

Commit 05c56de

Browse files
authored
Ignore many plural rule for cs, lt, sk (#4475)
1 parent aac9bce commit 05c56de

2 files changed

Lines changed: 31 additions & 0 deletions

File tree

translate/src/utils/message/getEmptyMessage.test.js

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,4 +214,29 @@ describe('getEmptyMessage', () => {
214214
215215
`);
216216
});
217+
218+
for (const code of ['cs', 'lt', 'sk']) {
219+
it(`handles plural messages for locales with a decimal-only many (${code})`, () => {
220+
const source = parseEntry(
221+
'fluent',
222+
ftl`
223+
selector-multi =
224+
{ $num ->
225+
[one] ONE
226+
*[other] OTHER
227+
}
228+
`,
229+
);
230+
const entry = getEmptyMessageEntry(source, { code });
231+
expect(serializeEntry(entry)).toBe(ftl`
232+
selector-multi =
233+
{ $num ->
234+
[one] { "" }
235+
[few] { "" }
236+
*[other] { "" }
237+
}
238+
239+
`);
240+
});
241+
}
217242
});

translate/src/utils/message/getPluralCategories.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,12 @@ export function getPluralCategories(code: string): Intl.LDMLPluralRule[] {
2222
case 'uk': // Ukrainian
2323
return ['one', 'few', 'many'];
2424

25+
// For the following, deliberately ignore the `many` rule for fractions
26+
case 'cs': // Czech
27+
case 'lt': // Lithuanian
28+
case 'sk': // Slovak
29+
return ['one', 'few', 'other'];
30+
2531
// For the following Romance languages,
2632
// deliberately ignore the `many` rule for millions.
2733
case 'ca': // Catalan

0 commit comments

Comments
 (0)