As described in the Common Locale Data Repository (CLDR), add support for explicit "0" and "1" pluralization keys.
The explicit “0” and “1” cases are not defined by language-specific rules, and are available in any language where the content provides them.
The explicit “0” and “1” cases apply to the exact numeric values 0 and 1 respectively. These cases are typically used for plurals of items that do not have fractional value, like books or files.
The explicit “0” and “1” cases have precedence over the “zero” and “one” cases. For example, if for a particular element CLDR data includes values for both the “1” and “one” cases, then the “1” value is used for numeric values of exactly 1, while the “one” value is used for any other formatted numeric values matching the “one” plural rule for the language.
The key names should be strings, not integers.
Usage example: In English (which only defines language-specific rules for “one” and “other”) this can be used to have special behavior for 0:
count=“0”: no books
count=“one”: {0} book, e.g. “1 book”
count=“other”: {0} books, e.g. “3 books”
Typically, this is achieved by having completely separate keys for the explicit "0" and "1" use cases:
Overview
As described in the Common Locale Data Repository (CLDR), add support for explicit "0" and "1" pluralization keys.
Usage example: In English (which only defines language-specific rules for “one” and “other”) this can be used to have special behavior for 0:
Typically, this is achieved by having completely separate keys for the explicit "0" and "1" use cases:
This would then have to be handled explicitly in code:
Once the explicit handling of the "0" and "1" case is complete, the key definition becomes simpler:
The implementation in code also becomes simpler:
Type
Motivation
Provide simpler implementation of common pluralization use cases.
Checklist