Localization RubyonRails中的本地化:在*.yml文件中嵌套值

Localization RubyonRails中的本地化:在*.yml文件中嵌套值,localization,ruby-on-rails-3.2,Localization,Ruby On Rails 3.2,本地化yml文件*.yml errors: template: body: "Body error message" header: one: "1 error " other: "%{count} errores" 出于某种原因,它在页面”(/home/alex/RubymineProjects/psg/config/locales/es.yml)上抛出错误:在第248行第7列“处解析块映射时未找

本地化yml文件*.yml

errors:
    template:
      body:       "Body error message"
        header:
          one:    "1 error "
          other:  "%{count} errores"
出于某种原因,它在页面
”(/home/alex/RubymineProjects/psg/config/locales/es.yml)上抛出错误:在第248行第7列“
处解析块映射时未找到预期的键,这意味着其中有错误

如果我删除
“Body error message”
(只有值,而不是
Body
键),则一切正常,页面上没有错误


怎么了?如何使用值及其嵌套值定义键
正文

您的缩进错误:
正文
标题
的深度应相同:

errors:
  template:
    body:       "Body error message"
    header:
      one:    "1 error "
      other:  "%{count} errores"