0

本地化 yml 文件 *.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 使用值及其嵌套值定义键?

4

1 回答 1

1

您的缩进是错误的:body并且header应该在相同的深度:

errors:
  template:
    body:       "Body error message"
    header:
      one:    "1 error "
      other:  "%{count} errores"
于 2012-08-13T09:44:57.190 回答