Skip to main content

ICU MessageFormat

ICU MessageFormat is a flexible yet powerful syntax to express all nuances of grammar for each language.


Simple text

Example: Refresh inbox


Example: Attachment {name} saved


Using language specific plural forms (one, other):

{count, plural, one {Message} other {Messages}}

Using exact matches (=0):

{count, plural, =0 {No messages}
one {# message}
other {# messages}}

Offsetting plural form:

{count, plural, offset:1
=0 {Nobody read this message}
=1 {Only you read this message}
one {You and # friend read this message}
other {You and # friends read this message}


{gender, select, male {He replied to your message}
female {She replied to your message}
other {They replied to your message}}


{count, selectOrdinal, one {#st message}
two {#nd message}
few {#rd message}
other {#th message}}

Further reading