You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm creating an issue to capture the problem laid out in #480 by @Tietew
Using links/Symbols/aliases (whatever you call 'em) and pluralization (i.e., count) doesn't work.
autos: :carscars:
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.
Using Backend::Pluralization (with a i18n.plural.rule) fails to resolve pluralization values after following Symbols (this issue, originally from Exclude :count option on retrieve link #480)
What I tried to do
I'm creating an issue to capture the problem laid out in #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 (Preserve count option #503)Backend::Pluralization
(with ai18n.plural.rule
) fails to resolve pluralization values after following Symbols (this issue, originally from Exclude :count option on retrieve link #480)Backend::Base
fails to handle nested keys within a pluralization context (Translations returned as hash when model-inflection has nested keys #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
The text was updated successfully, but these errors were encountered: