修改Devise重置密码错误文本 [英] Modify Devise reset password error text
本文介绍了修改Devise重置密码错误文本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
使用Devise GEM,当用户密码重置时,可以设置新密码。如果输入的密码不匹配,或者密码太短,您将收到默认邮件:
Using the Devise GEM, when a user password is reset they are allowed to set a new password. If the entered passwords do not match or if the password is too short, you get default messages:
•密码与确认不匹配
•Password doesn't match confirmation
•密码太短(最少为8个字符)
•Password is too short (minimum is 8 characters)
在哪里可以更改这些错误消息的文本?
How/where can I change the text of these error messages?
推荐答案
将此添加到您的config / localals / en.yml并更改它到你想要的
Add this to your config/locals/en.yml and change it to what you want
en:
activerecord:
errors:
models:
user:
attributes:
password:
confirmation: "Password does not match"
too_short: "Password is too short (minimum is %{count} characters)"
这篇关于修改Devise重置密码错误文本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文