-
-
Notifications
You must be signed in to change notification settings - Fork 409
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] I18n.exists? ignores scope on "Simple" backend #670
Comments
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! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 #365 and PR #482
- if this indeed qualifies as a bug, I can of course take care of the PR.
Thanks!
The text was updated successfully, but these errors were encountered: