To have the zh-CN.yml file, this can be downloaded on GitHub, someone else made
Gem for i18n Installation
Config. i18n. default_locale = "ZH-CN"
Add
Zh-CN:
Activerecord:
Attributes:
Product:
Title: "title"
Description: "Description"
Image_url: "image"
Because I guess it is related to the marked red below, there is a corresponding messages, but there is no attributes. After querying the information, I found that it is indeed the problem. The above product is my model, title is the name of the field corresponding to my database.
Errors:
Format :! '% {Attribute }%{ message }'
Messages:
Accepted: Must be acceptable
However, there is another problem:
- 3 errors prohibited this product from being saved:
This article from the "monkey riding Tree" blog, please be sure to keep this source http://qihoushangshu.blog.51cto.com/7872138/1549782
Ruby on Rails verification information changed to Chinese