如何本地化活动记录错误消息

时间:2010-08-17 09:22:24

标签: ruby-on-rails activerecord

我试图找出如何在我的rails应用程序中本地化错误项目名称,当用户使用不正确的数据签名时出现...我想出了如何覆盖消息而不是消息的名称,如( “密码”,“登录”,“电子邮件”,......)

de:
  activerecord:
    errors:
      models:
        user:
          attributes:
            password_confirmation:
              blank: ""
            password:
              confirmation: ""
              blank:  ""
              too_short: ""
            login:
              taken: ""
              blank: ""
              too_short: ""
            email:
              taken: ""
              blank: ""
              too_short: ""
              invalid: ""
      template:
        header: ""
        body: ""

由于 马库斯

1 个答案:

答案 0 :(得分:5)

来自the i18n guide,这应该有效:

de:
  activerecord:
    attributes:
      user:
        login: Anmeldung
相关问题