Using links/Symbols/aliases (whatever you call 'em) and pluralization (i.e., count) doesn't work.
autos: :cars
cars:
porsche:
one: "I have %{count} Porsche π"
other: "I have %{count} Porsches π"
I18n.t(:'autos.porsche', count: 1)
What I expected to happen
"I have 1 Porsche π"
What actually happened
I18n::InvalidPluralizationData: translation data {:porsche=>{:one=>"I have %{count} Porsche π", :other=>"I have %{count} Porsches π"}} can not be used with :count => 1. key 'one' is missing.
What is happening?
The issue is occurring in the lookup of the linked data.
Since all the original parameters are passed into the sublookup, including count, it is attempting to perform the pluralization lookup prior to returning the resolved value and failing.
History of this issue
This was noticed by #480 and the fix was to exclude the count parameter within the Symbol resolving code.
503 implicitly changed the definition of what was permitted in a translation file (namely, it broke nested keys within pluralization contexts), causing and #510 and #514.
Using Backend::Pluralization (with a i18n.plural.rule) fails to resolve pluralization values after following Symbols (this issue, originally from #480)
Using Backend::Base fails to handle nested keys within a pluralization context (#514)
Q&A
Q: Why wasn't this noticed by the tests when the changes to Backend::Pluralization were reverted?
A: There was no test with both symbol resolution and pluralization in the Backend::Pluralization tests.
The #480 changes were reverted, but not the #503 changes, so the test added in #480 for Backend::Base didn't start failing.
Versions of i18n, rails, and anything else you think is necessary
What I tried to do
I'm creating an issue to capture the problem laid out in https://github.com/ruby-i18n/i18n/pull/480 by @Tietew
Using links/Symbols/aliases (whatever you call 'em) and pluralization (i.e.,
count
) doesn't work.What I expected to happen
What actually happened
What is happening?
The issue is occurring in the lookup of the linked data.
Since all the original parameters are passed into the sublookup, including
count
, it is attempting to perform the pluralization lookup prior to returning the resolved value and failing.History of this issue
count
parameter within the Symbol resolving code.default
and an attempt was made to fix it in a different way (#503)503 implicitly changed the definition of what was permitted in a translation file (namely, it broke nested keys within pluralization contexts), causing and #510 and #514.
503 was partially reverted in https://github.com/ruby-i18n/i18n/commit/1b5e34553003ca3b42b842769e86c98d5e3b71d4, leaving us in the state we have today:
Backend::Pluralization
(with ai18n.plural.rule
) fails to resolve pluralization values after following Symbols (this issue, originally from #480)Backend::Base
fails to handle nested keys within a pluralization context (#514)Q&A
Q: Why wasn't this noticed by the tests when the changes to
Backend::Pluralization
were reverted?A: There was no test with both symbol resolution and pluralization in the
Backend::Pluralization
tests.The #480 changes were reverted, but not the #503 changes, so the test added in #480 for
Backend::Base
didn't start failing.Versions of i18n, rails, and anything else you think is necessary