Closed movermeyer closed 1 year ago
cc @radar this is ready for review
This looks good to me. Thanks @movermeyer!
Hey @radar, whenever you get some time, could we get a new release of ruby-i18n/i18n
? 🙏
I'm eagerly awaiting the time when I can start using these features.
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:other
plural categorySome 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
the only special cases, or can one introduce others? Perhaps2: I have a pair of cars
A: It might be allowed, depending on how you read the spec... but the spec only mentions0
and1
, the LDML DTD only considers0
and1
to be valid, and CLDR has only ever used0
and1
. 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.