1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Clarify i18n active[model/record] key differences

I spent a decent amount of time the other day trying to figure out why my active model including class wasn't generating the properly localized validation messages, and a note like this would have saved me a lot of time.
This commit is contained in:
James Coleman 2015-11-02 08:45:28 -05:00 committed by Xavier Noria
parent f87774bb8b
commit 8c9e95f970

View file

@ -805,6 +805,8 @@ en:
Then `User.human_attribute_name("gender.female")` will return "Female".
NOTE: If you are using a class which includes `ActiveModel` and does not inherit from `ActiveRecord::Base`, replace `activerecord` with `activemodel` in the above key paths.
#### Error Message Scopes
Active Record validation error messages can also be translated easily. Active Record gives you a couple of namespaces where you can place your message translations in order to provide different messages and translation for certain models, attributes, and/or validations. It also transparently takes single table inheritance into account.