使用default_locale时的“translation_missing”

时间:2013-02-25 17:46:18

标签: ruby-on-rails ruby-on-rails-3 actionview actionviewhelper rails-i18n

我正在尝试使用语言环境以西班牙语显示文本,但它一直使用英语作为默认值。我的代码:

# config/application.rb
config.i18n.default_locale = :es

# config/locales/es.yml
es:
  sections:
    fashion: Moda

# haml template
= t("sections.fashion")

在视图中生成以下html:<span class="translation_missing" title="translation missing: en.sections.fashion">Fashion</span>。我错过了什么吗? 提前致谢

1 个答案:

答案 0 :(得分:0)

尝试安装gem:rails-i18n

就我而言,这是解决方案。

https://github.com/svenfuchs/rails-i18n