Plurals and Select (ICU)
Handle plurals and gendered text.
Why Plain Placeholders Are Not Enough
"You have 1 messages" is wrong English. Languages have different plural rules (some have several plural forms), and gendered or category-based wording. Angular handles this with ICU message format: plural and select expressions.
The plural Expression
An ICU plural chooses wording based on a number. You list cases by plural category and provide text for each.
<p i18n>{count, plural,
=0 {No messages}
=1 {One message}
other {{{count}} messages}
}</p>All lessons in this course
- Marking Text for Translation
- Extracting and Translating Messages
- Plurals and Select (ICU)
- Building Localized Bundles