heroku I18n locale is different from default_locale, works fine locally

前端 未结 2 1412
旧巷少年郎
旧巷少年郎 2021-01-15 16:33

So, everything works fine locally, but at heroku it changes to :en

Fire up console on both environments:

Heroku:

heroku console --app myapp         


        
相关标签:
2条回答
  • 2021-01-15 16:58

    It helped setting locale directly.

    config.i18n.default_locale = :nb
    #Adding the below makes it work as expected at heroku
    config.i18n.locale = :nb 
    

    If you have a better solution, please let me know and you'll get upvote and accepted answer.

    0 讨论(0)
  • 2021-01-15 17:06

    What version of Ruby on Rails are you using? I'm not positive about 2.x, but in Rails 3 you can set the default locale in config/application.rb using config.i18n.default_locale = :en. (This is the line, commented out by default.)

    0 讨论(0)
提交回复
热议问题