Get closer to full CLDR pluralization support #634
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What are you trying to accomplish?
A step towards CLDR pluralization. Ref: #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 mentions
0
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.