diff options
Diffstat (limited to 'activemodel/lib/active_model')
-rw-r--r-- | activemodel/lib/active_model/errors.rb | 6 | ||||
-rw-r--r-- | activemodel/lib/active_model/locale/en.yml | 3 |
2 files changed, 6 insertions, 3 deletions
diff --git a/activemodel/lib/active_model/errors.rb b/activemodel/lib/active_model/errors.rb index 262a1ef22b..abc084a74b 100644 --- a/activemodel/lib/active_model/errors.rb +++ b/activemodel/lib/active_model/errors.rb @@ -105,11 +105,11 @@ module ActiveModel else attr_name = attribute.to_s.gsub('.', '_').humanize attr_name = @base.class.human_attribute_name(attribute, :default => attr_name) - options = { :default => ' ', :scope => @base.class.i18n_scope } - prefix = attr_name + I18n.t(:"errors.format.separator", options) + options = { :default => "{{attribute}} {{message}}", :attribute => attr_name, + :scope => @base.class.i18n_scope } messages.each do |m| - full_messages << "#{prefix}#{m}" + full_messages << I18n.t(:"errors.format", options.merge(:message => m)) end end end diff --git a/activemodel/lib/active_model/locale/en.yml b/activemodel/lib/active_model/locale/en.yml index 0c2cf9ea33..1cdb897f13 100644 --- a/activemodel/lib/active_model/locale/en.yml +++ b/activemodel/lib/active_model/locale/en.yml @@ -1,6 +1,9 @@ en: activemodel: 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: |