Heroku 和 i18n 问题 [英] Heroku and i18n Problems

查看:29
本文介绍了Heroku 和 i18n 问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我无法让 i18n 在 heroku 上工作.我设置:

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

I18n.default_locale = :de

在我的环境中.rb并且翻译在 config/locales/de.yml在我的本地机器上完美运行,但在 Heroku 上却不是这样.在heroku上,一切都是英文的.我认为我不需要像 i18n gem 这样的特殊 gem,因为我的本地机器上也没有它.也许有人对此有解决方案?

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?

推荐答案

尝试在 config.environment.rb 中像这样设置默认本地:

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 和 i18n 问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆