Skip to content
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

Fix bug where translations missing errors shown #115

Merged
merged 4 commits into from
Apr 30, 2020

Conversation

peteryates
Copy link
Member

When Rails is configured with config.i18n.fallbacks = true the behaviour of I18n.exists? is unclear. It returns true when passed nil because fallbacks are considered.

This could be fixed by specifying fallback: false as a keyword arg to I18n.exists? but if we have no key there's no point in proceeding to the check stage.

When Rails is configured with `config.i18n.fallbacks = true`[0] the
behaviour of `I18n.exists?` is unclear[1]. It returns true when passed
`nil` because fallbacks are considered.

This could be fixed by specifying `fallback: false` as a keyword arg to
`I18n.exists?`[2] but if we have no key there's no point in proceeding to
the check stage.

[0] https://guides.rubyonrails.org/v6.0.0/configuring.html#configuring-i18n
[1] ruby-i18n/i18n#365
[2] ruby-i18n/i18n#482
@peteryates peteryates added the bug Something isn't working label Apr 30, 2020
@peteryates peteryates requested a review from aldavidson April 30, 2020 09:14
Who thinks '%w-literals should be delimited by [ and ]'?

Nobody, that's who.
@codeclimate
Copy link

codeclimate bot commented Apr 30, 2020

Code Climate has analyzed commit fd37895 and detected 0 issues on this pull request.

View more on Code Climate.

@peteryates peteryates merged commit 12e43d0 into master Apr 30, 2020
@peteryates peteryates deleted the fix-missing-translation-data-bug branch April 30, 2020 09:53
@peteryates peteryates removed the request for review from aldavidson April 30, 2020 12:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant