ComponentsUtilities

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).

Features3APIThemingAccessibility

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.

key 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.

1 unread message

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 day1 день
2 2 days2 дні
5 5 days5 днів
11 11 days11 днів
21 21 days21 день
22 22 days22 дні
25 25 days25 днів