Problems with Heroku and i18n

I'm having trouble getting the i18n to work on the hero. I have installed:

I18n.default_locale = :de 

in my .rb environment and the translation located in config / locales / de.yml works fine on my local machines, but not so on Heroku. Heroka is all in English. I don’t think I need a special gem like the i18n gem, because I don’t have it either on my local machine. Maybe someone has a solution?

+1
source share
2 answers

Try setting a local default value like this in the config.environment.rb file:

 Rails::Initializer.run do |config| # ... config.i18n.default_locale = :de end 
+1
source

The only solution I found for me, on heroku, was installing it manually in the application controller.

application_controller.rb

 before_filter :set_locale def set_locale I18n.locale = 'fr-QC' || I18n.default_locale end 

amuses

+1
source

Source: https://habr.com/ru/post/899931/


All Articles