Get closer to full CLDR pluralization support
What are you trying to accomplish?
A step towards CLDR pluralization. Ref: https://github.com/ruby-i18n/i18n/issues/629
Previously, I put forth a PR, that was reverted in #633 since dropping [incorrect] support for zero key is a breaking change.
This PR is the same as #630 (adding support for explicit 0/1 keys and basic lateral inheritance), but maintains the existing [incorrect] zero key behaviour.
What approach did you choose and why?
I brought back the changes from my first attempt, but also brought back the [incorrect] zero key behaviour:
- Added handling for CLDR's explicit 0 and 1 keys
- Added CLDR's lateral inheritance of using the
otherplural category
Some progress towards CLDR compatibility is better than none. Removal of the zero key behaviour will be done in a separate PR.
Q&A
Q: Are 0 & 1 they only special cases, or can one introduce others? Perhaps 2: I have a pair of cars
A: It might be allowed, depending on how you read the spec... but the spec only mentions 0 and 1, the LDML DTD only considers 0 and 1 to be valid, and CLDR has only ever used 0 and 1. I left support for arbitrary numbers out of this PR, as I figure that it would be better to be restrictive with what we accept right now. It's an easy change to accept other values if it turns out to be desirable.
The impact of these changes
Pluralization lookups will will support CLDR's data. Ref: #629 for details of why these changes are important.