Intermediate Localization Eng. #icu#plural-rules#i18n

ICU MessageFormat — Advanced Patterns Vocabulary

5 exercises — 5 exercises practising ICU MessageFormat plural rules, select expressions, nested patterns, and date/number format skeletons.

0 / 5 completed
Quick reference: ICU MessageFormat
  • Plural pattern — {count, plural, one {# item} other {# items}} — handles grammatical plural forms by language
  • Select pattern — {gender, select, male {He commented} female {She commented} other {They commented}} — case matching on a value
  • CLDR plural categories — zero, one, two, few, many, other — different languages use different subsets; Arabic uses all 6
1 / 5

A developer asks: "Why do we need ICU MessageFormat for plurals? Can't we just do count === 1 ? 'item' : 'items'?" Which explanation is correct?