Heroku和国际问题 [英] Heroku and i18n Problems
本文介绍了Heroku和国际问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我无法让i18n在heroku上工作。
我设置:
pre $ I18n.default_locale =:de
pre>
在我的environment.rb
和翻译是在config / locales / de.yml
在我的本地机器上完美工作,但不是这样在Heroku上。
在heroku上,所有内容都是英文的。
我不认为我需要像i18n宝石这样的特殊宝石,因为我没有在我的本地机器上。
也许有人有解决这个问题的方法吗?解决方案
.rb:
Rails :: Initializer.run do | config |
#...
config.i18n.default_locale =:de
end
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/locales/de.yml works perfect on my local machines but not so on Heroku. On heroku everything is in english. I don't think I need a special gem like i18n gem, cause I don't have it on my local machine either. Maybe someone has a solution to this?
解决方案
Try to set the default local like this in your config.environment.rb:
Rails::Initializer.run do |config|
# ...
config.i18n.default_locale = :de
end
这篇关于Heroku和国际问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文