In development mode all work fine. But not in production mode on heroku.
When I select a locale and I refresh the page, it displays language by default half the time and the language I selected otherwise. I do not know what to do. I tried to clear the cache with Rails.cache.clear command, but it does not work. I guess the problem is with the cache system. I'm new to ruby on rails. Someone would have an idea how to fix this?
to understand my problem, you can go to my website, select the French language and refresh the page several times. Once the page is in French. Another time in English.
https://releaseit.herokuapp.com/
my application_controller:
before_action :set_locale
def set_locale
if params[:locale].in? %W(en fr)
I18n.locale = params[:locale]
end
end
The config files are same as here: https://github.com/starterkits/rails4-starterkit/tree/master/config
Sorry for my english (I am french and i use google translator)