0Pricing
Angular Academy · Lesson

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

  1. Marking Text for Translation
  2. Extracting and Translating Messages
  3. Plurals and Select (ICU)
  4. Building Localized Bundles
← Back to Angular Academy