You may encode your plural strings in ICU Formatting. If encoded in ICU Message Format, your string must follow a particular pattern as described below. 

Example:

You have {count, plural, one {one item} other {{count} items}} in your cart.

Supported ICU Message syntax has the following structure.

{ argument name, argument type, keyword { message } keyword { message } }

1. Your plural text should be encased in curly braces `{}`.

2. count is an argument name. This argument can appear in your plural encoding and will be replaced by an actual number at the time of rendering.

3. plural is the argument type. only plural or selectordinal argument type is supported.

4. one is the key word. only zero, one, two, few, many, other keywords are supported even though ICU message syntax allows explicit numbers such as 0 or 1. Use of explicit numbers are discouraged. Due to complex language plural rules keyword one is not equal to explicit number 1. 

5. {one item} is the message that needs to be rendered. It doesn't include any placeholders but it can.

6. {{count} items} is another message that needs to be rendered. It includes a named placeholder {count}. Optionally you can substitute {count} placeholder with the pound/hashtag symbol such as follows: {# items}.



If you encode your plurals in ICU message format, your placeholders must also be formatted by ICU message syntax.

ICU Placeholder:

{count, plural, one {{count} item found.} other {{count} items found.}}

In the above example `{count}` is the placeholder and it will be replaced by an actual number when the text is rendered on screen such as follows:


Generic
Generic

See Also:

ICU Message Formatting

Format.Js - Intl MessageFormat

Class MessageFormat - Java Docs

Class PluralFormat - Java Docs