如何完全更改"密码与确认不匹配"错误消息activerecord

use*_*430 0 activerecord ruby-on-rails

阳明海运

en   
  activerecord:
    errors: 
      models: 
        user:
          confirmation: "Passwords do not match"
Run Code Online (Sandbox Code Playgroud)

但我明白了

"密码密码不匹配"

我怎么能摆脱"密码"?

Raj*_*tan 5

试试这个:

# config/locales/en.yml
en:
  activerecord:
    attributes:
      user:
        password_confirmation: "Passwords"
    errors:
      models:
        user:
          attributes:
            password_confirmation:
              confirmation: " do not match!"
Run Code Online (Sandbox Code Playgroud)