Closed nakwa closed 1 year ago
Looks like definitely a bug for me. Please, do open a PR.
Thanks for opening this. Easier for me to keep track of the conversation with a number next to the title. I remember numbers.
Agree that this looks like a bug to me. The #671 PR will probably fix it. I'm waiting for that to run through CI before I merge.
Awesome, thanks!
What I tried to do
Hi there, I am trying to validate a translation key existence using
I18n.exists?
running onI18n::Backend::Simple
config/application.rb (Rails)
No other language file is defined, hence using
fr
should fallback toen
.What I expected to happen
rails c
What actually happened
rails c
I suspect the reason to be this line in the
I18n::Backend::Fallbacks
class whereexists?
callssuper
without passing down**options
:Patching the method seems to produce the intended result :
However I am not sure to understand if this behavior was implemented on purpose or not.
Versions of i18n, rails, and anything else you think is necessary
For reference: ActiveRecord (ActiveModel) is notably using I18n scope to translate model names https://github.com/rails/rails/blob/main/activemodel/lib/active_model/naming.rb#L204 (I was tweaking around model_name, that how I ran into this issue).
Also probably worth referencing: issue https://github.com/ruby-i18n/i18n/issues/365 and PR https://github.com/ruby-i18n/i18n/pull/482
- if this indeed qualifies as a bug, I can of course take care of the PR.
Thanks!