http://guides.rubyonrails.org/i18n.html#translations-for-active-record-models
app/models/user.rb
# ...
validates_format_of :password, :with => PASSWORD_FORMAT,
# ...
config/locales/en.yml
en:
activerecord:
errors:
models:
user:
attributes:
password:
invalid: 'Must include uppercase & number'
- for
validates_presence_of
keyword you can useblank
- for
validates_length_of
keyword you can usetoo_short
ortoo_long
- for
validates_uniqueness_of
keyword you can usetaken