aboutsummaryrefslogtreecommitdiffstats
path: root/guides/source/i18n.md
diff options
context:
space:
mode:
authorSadjow Leão <sadjow@gmail.com>2013-08-13 00:06:03 -0300
committerSadjow Leão <sadjow@gmail.com>2013-08-13 00:06:03 -0300
commit23c5d6d9ad704e488e685c34e158255a7d3278f5 (patch)
treee2993bdcfc61757b2f77c30b3627bcf1406a0370 /guides/source/i18n.md
parentc7ac0a5b28e1403371e4c65666ec92dd2bf0e0d6 (diff)
downloadrails-23c5d6d9ad704e488e685c34e158255a7d3278f5.tar.gz
rails-23c5d6d9ad704e488e685c34e158255a7d3278f5.tar.bz2
rails-23c5d6d9ad704e488e685c34e158255a7d3278f5.zip
Add plural form example for AR I18n section [ci skip]
Diffstat (limited to 'guides/source/i18n.md')
-rw-r--r--guides/source/i18n.md13
1 files changed, 13 insertions, 0 deletions
diff --git a/guides/source/i18n.md b/guides/source/i18n.md
index facfb96d98..e4214fd74e 100644
--- a/guides/source/i18n.md
+++ b/guides/source/i18n.md
@@ -731,6 +731,19 @@ en:
Then `User.model_name.human` will return "Dude" and `User.human_attribute_name("login")` will return "Handle".
+You can also set a plural form for model names, adding as following:
+
+```ruby
+en:
+ activerecord:
+ models:
+ user:
+ one: Dude
+ other: Dudes
+```
+
+Then `User.model_name.human(:count => 2)` will return "Dudes". With `:count => 1` or without params will return "Dude".
+
#### 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.