suely
suely

Reputation: 434

how can I change the message "Password doesn't match confirmation"

i know that in config/en.yml I can change the message "this email is already been taken" changing the en.yml file :

en: hello: "Hello world" activerecord: errors: messages: taken: "este mail ya sido utilizado"

but how can I change the message "Password doesn't match confirmation" I tried with password_confirmation and other combinations but don't works! thanks in advance.

Upvotes: 6

Views: 7441

Answers (2)

user2235801
user2235801

Reputation:

In Rails 4.0.2, I found this string with:

I18n.translate("errors.messages.confirmation")
  => "doesn't match %{attribute}"

I then modified it by putting this in my locale file:

en:
  errors:
    messages:
      confirmation: "%{attribute}s don't match - please check"

Upvotes: 2

Gazler
Gazler

Reputation: 84150

Those error messages belong to activerecord.

Just create a new language file with that structure and replace what you need.

activerecord:
  errors:
    messages:
      confirmation: "does not match"

You shouldn't change en.yml as that is for english language strings. You should make a new one for the language you require. You can read about i18n at http://guides.rubyonrails.org/i18n.html

Upvotes: 14

Related Questions