Ruby on rails Mongoid+;ActiveModel验证&x2B;I18n,未正确转换属性
我正在尝试国际化我的Ruby on rails Mongoid+;ActiveModel验证&x2B;I18n,未正确转换属性,ruby-on-rails,ruby,internationalization,mongoid,activemodel,Ruby On Rails,Ruby,Internationalization,Mongoid,Activemodel,我正在尝试国际化我的预订模型的属性 从我的fr.yml: attributes: &attributes booking: first_name: 'Prénom' last_name: 'Nom' email: "Email" phone: 'Téléphone' activemodel: errors: <<: *errors attributes: <<
预订
模型的属性
从我的fr.yml:
attributes: &attributes
booking:
first_name: 'Prénom'
last_name: 'Nom'
email: "Email"
phone: 'Téléphone'
activemodel:
errors:
<<: *errors
attributes:
<<: *attributes
但是:
但是,在我的web服务器上,错误仍然是英语+法语,例如:
“名字doitêtrerempli(e)”
我错过了什么?我正在使用mongoid、ruby 2.0.0和rails 3.2.11
请注意,我正在使用model.errors.full_messages
检索错误消息。修复了它:
mongoid:
attributes:
<<: *attributes
mongoid:
属性:
2.0.0p0 :013 > Booking.human_attribute_name('first_name')
=> "First name"
mongoid:
attributes:
<<: *attributes