aboutsummaryrefslogtreecommitdiffstats
path: root/railties/guides/source/i18n.textile
diff options
context:
space:
mode:
authorJaime Iniesta <jaimeiniesta@gmail.com>2010-11-16 22:25:20 +0100
committerXavier Noria <fxn@hashref.com>2010-11-21 03:29:43 +0100
commit3c645536448e1ba1fa81160162a1eefe03bb6787 (patch)
treef9e2b17d3d89b7e441fea8112b6d9a3e6d3ed1fc /railties/guides/source/i18n.textile
parent4a51328ae8d51f8d1a637780d5b82fd27261758f (diff)
downloadrails-3c645536448e1ba1fa81160162a1eefe03bb6787.tar.gz
rails-3c645536448e1ba1fa81160162a1eefe03bb6787.tar.bz2
rails-3c645536448e1ba1fa81160162a1eefe03bb6787.zip
i18n guide: it's activerecord.errors.messages.record_invalid (instead of 'invalid'), and messagges typo
Diffstat (limited to 'railties/guides/source/i18n.textile')
-rw-r--r--railties/guides/source/i18n.textile18
1 files changed, 9 insertions, 9 deletions
diff --git a/railties/guides/source/i18n.textile b/railties/guides/source/i18n.textile
index 12901e4dac..4f6ae5fbd2 100644
--- a/railties/guides/source/i18n.textile
+++ b/railties/guides/source/i18n.textile
@@ -464,24 +464,24 @@ I18n.t 'message'
The +translate+ method also takes a +:scope+ option which can contain one or more additional keys that will be used to specify a “namespace” or scope for a translation key:
<ruby>
-I18n.t :invalid, :scope => [:activerecord, :errors, :messages]
+I18n.t :record_invalid, :scope => [:activerecord, :errors, :messages]
</ruby>
-This looks up the +:invalid+ message in the Active Record error messages.
+This looks up the +:record_invalid+ message in the Active Record error messages.
Additionally, both the key and scopes can be specified as dot-separated keys as in:
<ruby>
-I18n.translate :"activerecord.errors.messages.invalid"
+I18n.translate "activerecord.errors.messages.record_invalid"
</ruby>
Thus the following calls are equivalent:
<ruby>
-I18n.t 'activerecord.errors.messages.invalid'
-I18n.t 'errors.messages.invalid', :scope => :active_record
-I18n.t :invalid, :scope => 'activerecord.errors.messages'
-I18n.t :invalid, :scope => [:activerecord, :errors, :messages]
+I18n.t 'activerecord.errors.messages.record_invalid'
+I18n.t 'errors.messages.record_invalid', :scope => :active_record
+I18n.t :record_invalid, :scope => 'activerecord.errors.messages'
+I18n.t :record_invalid, :scope => [:activerecord, :errors, :messages]
</ruby>
h5. Defaults
@@ -697,7 +697,7 @@ activerecord.errors.models.user.attributes.name.blank
activerecord.errors.models.user.blank
activerecord.errors.messages.blank
errors.attributes.name.blank
-errors.messagges.blank
+errors.messages.blank
</ruby>
When your models are additionally using inheritance then the messages are looked up in the inheritance chain.
@@ -719,7 +719,7 @@ activerecord.errors.models.user.attributes.title.blank
activerecord.errors.models.user.blank
activerecord.errors.messages.blank
errors.attributes.title.blank
-errors.messagges.blank
+errors.messages.blank
</ruby>
This way you can provide special translations for various error messages at different points in your models inheritance chain and in the attributes, models, or default scopes.