新手问题 ruby 汉化问题

xiaoxiao · June 15, 2013 · Last by xiaoxiao replied at June 15, 2013 · 2198 hits

我在 locales 中添加了 zh.yml 文件内容如下 zh: add: "添加" add_all: "添加全部" 然后在 application.rb 中添加了 config.i18n.default_locale = :zh 在 view 中使用<%= t(:add) %> 为什么会出现错误 can not load translations from C:/Users/yang/Desktop/windowextapp/config/locales/zh.yml, expected it to return a hash, but does not 求助,我的 rails 是 3.2.13 ruby 1.9.3

yaml 要缩进 http://www.yaml.org/start.html http://www.yaml.org/refcard.html

zh:
  add: "添加"
  add_all: "添加全部"
You need to Sign in before reply, if you don't have an account, please Sign up first.