如何覆盖“电子邮件已经被使用”? [英] How do I override 'Email has already been taken'?
本文介绍了如何覆盖“电子邮件已经被使用”?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想用更有意义的内容替换这个错误消息,以帮助用户了解下一步做什么。不幸的是,我似乎找不到我的来源的任何地方;
I would like to replace this error message with something more instructive, to help the user understand what to do next. Unfortunately I can't seem to find this anywhere in my source; where is it coming from and how can I amend it?
推荐答案
查看 config / locales / YOUR_LOCALE .yml
并设置以下密钥:
errors:
messages:
taken: "has already been taken"
您可以在这里找到多种语言的翻译文件: https://github.com/svenfuchs/rails-i18n/tree/master/rails / locale
You can find translated files for multiple languages here: https://github.com/svenfuchs/rails-i18n/tree/master/rails/locale
这篇关于如何覆盖“电子邮件已经被使用”?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文