我在哪里可以更改“已接收电子邮件”?错误信息? [英] Where can I change the "Email has already been taken" error message?

查看:176
本文介绍了我在哪里可以更改“已接收电子邮件”?错误信息?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要自定义消息错误:电子邮件已经被接收用于电子邮件,我正在使用Ruby 1.9.2,Rails 3.1.3,Devise 1.5.3。 ,我尝试在以下位置更改消息: config / locales / devise.en.yml 和我的
config / locales / en.yml ,但是不起作用!

I need customize the message error: Email has already been taken for email, I'm working with Ruby 1.9.2, Rails 3.1.3, Devise 1.5.3, I tried change the message in: config/locales/devise.en.yml and in my config/locales/en.yml but it doesn't works!

在我的模型/用户中,我有:

validates_uniqueness_of :email, :message => "este mail ya sido utilizado"

它显示该消息,但同时显示:电子邮件已经被占用

It shows that message but it also shows: Email has already been taken.

推荐答案

我从没使用过Devise,但我认为消息是ActiveRecord错误消息(并非特定于Devise gem)。如果您打算使用非英语语言环境,我建议您更改默认语言环境,而不要在EN中添加非英语内容。

I never used Devise, but I think the "taken" message is an ActiveRecord error message (not specific to the Devise gem). If you plan on using a non-english locale I would advice you to change the default locale instead of adding non-english content to the EN one.

sp:
  activerecord:
    errors:
      messages:
        taken: "este %{model} ya sido utilizado"

这篇关于我在哪里可以更改“已接收电子邮件”?错误信息?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆