aboutsummaryrefslogtreecommitdiffstats
path: root/activemodel/lib
diff options
context:
space:
mode:
authorJosé Valim <jose.valim@gmail.com>2010-04-30 18:40:24 +0200
committerJosé Valim <jose.valim@gmail.com>2010-05-01 12:54:52 +0200
commit13867a3f5f3e2248660a942956985a4eacacb283 (patch)
treebb6bc41d0f5bff725e379b712cb75751a9813a3f /activemodel/lib
parentefba1d4227514a6ce4880910a6531b0a6c3c75aa (diff)
downloadrails-13867a3f5f3e2248660a942956985a4eacacb283.tar.gz
rails-13867a3f5f3e2248660a942956985a4eacacb283.tar.bz2
rails-13867a3f5f3e2248660a942956985a4eacacb283.zip
Use %{} syntax in I18n (faster) instead of {{}}.
Diffstat (limited to 'activemodel/lib')
-rw-r--r--activemodel/lib/active_model/errors.rb2
-rw-r--r--activemodel/lib/active_model/locale/en.yml18
2 files changed, 10 insertions, 10 deletions
diff --git a/activemodel/lib/active_model/errors.rb b/activemodel/lib/active_model/errors.rb
index e6c86c7843..14afc5265f 100644
--- a/activemodel/lib/active_model/errors.rb
+++ b/activemodel/lib/active_model/errors.rb
@@ -223,7 +223,7 @@ module ActiveModel
else
attr_name = attribute.to_s.gsub('.', '_').humanize
attr_name = @base.class.human_attribute_name(attribute, :default => attr_name)
- options = { :default => "{{attribute}} {{message}}", :attribute => attr_name }
+ options = { :default => "%{attribute} %{message}", :attribute => attr_name }
messages.each do |m|
full_messages << I18n.t(:"errors.format", options.merge(:message => m))
diff --git a/activemodel/lib/active_model/locale/en.yml b/activemodel/lib/active_model/locale/en.yml
index d05c04967c..602a530dc0 100644
--- a/activemodel/lib/active_model/locale/en.yml
+++ b/activemodel/lib/active_model/locale/en.yml
@@ -1,7 +1,7 @@
en:
errors:
# The default format use in full error messages.
- format: "{{attribute}} {{message}}"
+ 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.
@@ -13,15 +13,15 @@ en:
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)"
+ 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)"
not_a_number: "is not a number"
not_an_integer: "must be an integer"
- 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}}"
+ 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"