email_address
email_address copied to clipboard
Use I18n strings if available
Tries to call I18n.t!("email_address.#{name}")
at error_message()
.
This could raise exceptions in two cases:
-
I18n
doesn't exist (because you are not on Rails) - The key was not found on i18n YAML files for the current locale
Both cases are caught by the rescue clause, which returns a string based on existing
@errors
. Now it's possible to define translations inside your Rails app in the regular way.