Open jerko-culina opened 3 years ago
Additional information: In active record model I have:
validates :name, presence: true
Each time when I try to submit an error message on the empty field I am getting an error message in another language. Most interesting thing is that it is happening on the localhost!
After setting locale explicitly did not have an issue anymore!
before_action :set_locale
def set_locale
I18n.locale = I18n.default_locale
end
Seem like if you do not set locale explicitly it sets itself randomly!
Please provide us with a test application that reproduces the issue.
We ran into this issue with Rails 6.1 on production as well. Had to set I18n.locale explicitly for all requests, to prevent it from leaking over into other threads.
See also https://stackoverflow.com/questions/31649118/is-i18n-with-locale-threadsafe.
👋 Hello to everyone. Not sure if this is the right place, sorry if I am wrong.
I have an issue with I18n thread safety (at least I think it is about that) on production after deploying newly initialized rails 6.1. application. Our application consists of the API and admin dashboard. API is consumed by react app. Admin dashboard has been using by application administrators. On react side, we have support for over 10 languages, but on the admin dashboard, we only use English. After application deployment, administrators noticed that each time whey they refresh the admin dashboard they are getting the admin dashboard on another language.
I tried to debug it but without any success. Anyone any advice/idea?
Not sure what info I should provide but by looking in the gem file we have:
If more information is needed feel free to ask. Sorry if this is the wrong place, feel free to redirect me to right one.