Fix symbol resolving with pluralization #636
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?
Fixes #635. See #635 for discussion of the history of attempts to fix it.
What approach did you choose and why?
Instead of removing the
count
param within the Symbol resolving code ofBackend::Base
(as done in #480, then reverted), we remove thecount
parameter within the lookup code ofBackend::Simple
.The impact of these changes
Resolution of Symbols that point to pluralization contexts will work for
Backend::Pluralization
(with ai18n.plural.rule
entry).Testing
Thankfully, each stage of the saga that lead to this PR, the tests for the failing cases were added:
Symbol
resolutionSymbol
resolution in defaults withcount
parameterSo we can have confidence that at least all the known cases are covered.
I added a test that is similar to the one added in #480, but while using the
Backend::Pluralization
and notBackend::Base
. This covers the case that was missing that would have caught the issue with the revert done in 1b5e345.Anecdotally, I've tested it with our usage of the
ruby-cldr
exported data, (which contains a lot of aliases/Symbol
s from the CLDR data), and with this patch lookups usingBackend::Pluralization
no longer fail.