Heroku and i18n Problems

后端 未结 2 1896
谎友^
谎友^ 2020-12-20 07:08

I\'m having trouble getting i18n to work on heroku. I set:

I18n.default_locale = :de

in my environment.rb and the translation is in config

相关标签:
2条回答
  • 2020-12-20 07:27

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

    application_controller.rb

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

    cheers

    0 讨论(0)
  • Try to set the default local like this in your config.environment.rb:

    Rails::Initializer.run do |config|
      # ...
      config.i18n.default_locale = :de
    end
    
    0 讨论(0)
提交回复
热议问题