When I submit a form with an error in it, it returns an error message. How can I translate these error messages with i18n? I already have translation for all the other texts in
The translation for the title would be:
nl:
activerecord:
errors:
template:
header:
one: "1 error prohibited this %{model} from being saved"
other: "%{count} errors prohibited this %{model} from being saved"
body: "There were problems with the following fields:"
For translating the error messages, Rails will use the following order of translations:
activerecord.errors.models.user.attributes.name.blank
activerecord.errors.models.user.blank
activerecord.errors.messages.blank
errors.attributes.name.blank
errors.messages.blank
So you could add:
nl:
activerecord:
errors:
models:
user:
attributes:
email:
blank: "foo blank in nl bar baz"
It's documented in the Rails Internationalization (I18n) API Guide, which might give you some more insight.