-
Notifications
You must be signed in to change notification settings - Fork 25
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
Improve the localization concern, moving to around_action #133
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
andyduong1920
force-pushed
the
chore/improve-localization
branch
from
November 11, 2019 02:08
9da1f76
to
e4686d8
Compare
olivierobert
changed the base branch from
chore/upgrade-rails-6-0-1
to
develop
November 11, 2019 08:11
@anduonghien rebase required |
olivierobert
changed the title
Chore/ Improve the localization concern, moving to around_action
Improve the localization concern, moving to around_action
Nov 11, 2019
andyduong1920
force-pushed
the
chore/improve-localization
branch
2 times, most recently
from
November 11, 2019 14:07
45d76f4
to
6ff10f9
Compare
Rebase @olivierobert |
Tolsee
reviewed
Feb 10, 2020
yutna
approved these changes
Feb 10, 2020
andyduong1920
force-pushed
the
chore/improve-localization
branch
from
February 10, 2020 15:21
6ff10f9
to
a19b173
Compare
andyduong1920
force-pushed
the
chore/improve-localization
branch
from
February 12, 2020 05:29
a19b173
to
ce2e119
Compare
hoangmirs
approved these changes
Feb 12, 2020
Open on another PR #241 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes #127
What happened
Insight
Switch the locale by using before_action isn't safe, the locale doesn't set return correctly on some request randomly (I faced with that issue on a project).
Here is a similar issue: ruby-i18n/i18n#381
And the official Rails guide also prefer to using around_action to switch the locale https://guides.rubyonrails.org/i18n.html#managing-the-locale-across-requests (rails/rails#34356)
I also add the configuration for the I18n as since from Rails I18n 1.1.0, the config
config.i18n.fallbacks = true
(was generated by Rails) isn't correct anymore https://github.com/ruby-i18n/i18n/releases/tag/v1.1.0Proof Of Work