本地化的Ruby on Rails的:在* .yml文件嵌套值
问题描述:
一个本地化阳明文件* .yml本地化的Ruby on Rails的:在* .yml文件嵌套值
errors:
template:
body: "Body error message"
header:
one: "1 error "
other: "%{count} errores"
出于某种原因,它抛出一个页面"(/home/alex/RubymineProjects/psg/config/locales/es.yml): did not find expected key while parsing a block mapping at line 248 column 7"
,这意味着对错误有什么不对的吧。
如果我删除"Body error message"
(只有值,而不是body
键),那么一切都很好,页面上没有错误。
出了什么问题?如何定义body
的键值及其嵌套值?
答
你的缩进是错误的:body
和header
应该是在同一深度:
errors:
template:
body: "Body error message"
header:
one: "1 error "
other: "%{count} errores"