Plural
Plural forms by the language rules: one file, 3 файли, 5 файлів. The pipes follow the tectra locale, also when it changes at runtime.
Part of @tectra-ng/utils (npm install @tectra-ng/utils, also included in tectra-ng).
Translation keys
txPluralForm gives one, few or many — the suffix of a translation key. Switch the language and the count to see the forms change.
files.few → 3 файлиMessage
txPlural takes an ICU message: =0 for an exact value, the language categories, # for the count. Without a locale argument it follows the tectra locale.
Forms map
A map of forms instead of a message: few and many matter for Ukrainian, English uses one and other.
| 0 | no days | жодного дня |
| 1 | 1 day | 1 день |
| 2 | 2 days | 2 дні |
| 5 | 5 days | 5 днів |
| 11 | 11 days | 11 днів |
| 21 | 21 days | 21 день |
| 22 | 22 days | 22 дні |
| 25 | 25 days | 25 днів |