diff options
author | José Valim <jose.valim@gmail.com> | 2010-01-07 01:04:25 +0100 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2010-01-07 15:31:49 +0100 |
commit | 190ce3ab37966957997cd18772d1260bf121c2e0 (patch) | |
tree | 55598ff271dea3c93b54823f9f5f2ec96b9cfef2 /activerecord/lib | |
parent | a323b83acfe6e02812ec3b7b4ce912b07c85220e (diff) | |
download | rails-190ce3ab37966957997cd18772d1260bf121c2e0.tar.gz rails-190ce3ab37966957997cd18772d1260bf121c2e0.tar.bz2 rails-190ce3ab37966957997cd18772d1260bf121c2e0.zip |
Errors messages are now moved from :activerecord.errors to simply :errors on I18n yml files.
Diffstat (limited to 'activerecord/lib')
-rw-r--r-- | activerecord/lib/active_record/locale/en.yml | 39 | ||||
-rw-r--r-- | activerecord/lib/active_record/validations.rb | 2 |
2 files changed, 9 insertions, 32 deletions
diff --git a/activerecord/lib/active_record/locale/en.yml b/activerecord/lib/active_record/locale/en.yml index e33d389f8c..75cdedb442 100644 --- a/activerecord/lib/active_record/locale/en.yml +++ b/activerecord/lib/active_record/locale/en.yml @@ -1,33 +1,9 @@ en: - activerecord: - errors: - # model.errors.full_messages format. - format: "{{attribute}} {{message}}" - - # The values :model, :attribute and :value are always available for interpolation - # The value :count is available when applicable. Can be used for pluralization. - messages: - inclusion: "is not included in the list" - exclusion: "is reserved" - invalid: "is invalid" - confirmation: "doesn't match confirmation" - accepted: "must be accepted" - empty: "can't be empty" - blank: "can't be blank" - too_long: "is too long (maximum is {{count}} characters)" - too_short: "is too short (minimum is {{count}} characters)" - wrong_length: "is the wrong length (should be {{count}} characters)" - taken: "has already been taken" - not_a_number: "is not a number" - greater_than: "must be greater than {{count}}" - greater_than_or_equal_to: "must be greater than or equal to {{count}}" - equal_to: "must be equal to {{count}}" - less_than: "must be less than {{count}}" - less_than_or_equal_to: "must be less than or equal to {{count}}" - odd: "must be odd" - even: "must be even" - record_invalid: "Validation failed: {{errors}}" - # Append your own errors here or at the model/attributes scope. + errors: + messages: + taken: "has already been taken" + record_invalid: "Validation failed: {{errors}}" + # Append your own errors here or at the model/attributes scope. # You can define own errors for models or model attributes. # The values :model, :attribute and :value are always available for interpolation. @@ -42,7 +18,9 @@ en: # Will define custom blank validation message for User model and # custom blank validation message for login attribute of User model. #models: - + + # ActiveRecord models configuration + #activerecord: # Translate model names. Used in Model.human_name(). #models: # For example, @@ -55,4 +33,3 @@ en: # user: # login: "Handle" # will translate User attribute "login" as "Handle" - diff --git a/activerecord/lib/active_record/validations.rb b/activerecord/lib/active_record/validations.rb index 12c1f23763..d5adcba3ba 100644 --- a/activerecord/lib/active_record/validations.rb +++ b/activerecord/lib/active_record/validations.rb @@ -11,7 +11,7 @@ module ActiveRecord def initialize(record) @record = record errors = @record.errors.full_messages.join(I18n.t('support.array.words_connector', :default => ', ')) - super(I18n.t('activerecord.errors.messages.record_invalid', :errors => errors)) + super(I18n.t('errors.messages.record_invalid', :errors => errors)) end end |