diff options
author | Sven Fuchs <svenfuchs@artweb-design.de> | 2008-12-16 15:52:28 +0100 |
---|---|---|
committer | Sven Fuchs <svenfuchs@artweb-design.de> | 2008-12-16 15:52:28 +0100 |
commit | f333661ec28211b11fad0665b99aad6b0fd23260 (patch) | |
tree | a4949bd06831575c84236989b524d9aa3ab45991 /railties | |
parent | f388babc729174c305902be38cee01011eb0aa18 (diff) | |
download | rails-f333661ec28211b11fad0665b99aad6b0fd23260.tar.gz rails-f333661ec28211b11fad0665b99aad6b0fd23260.tar.bz2 rails-f333661ec28211b11fad0665b99aad6b0fd23260.zip |
explain changes of pluralization feature
Diffstat (limited to 'railties')
-rw-r--r-- | railties/doc/guides/source/i18n.txt | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/railties/doc/guides/source/i18n.txt b/railties/doc/guides/source/i18n.txt index be8510cb12..a65fda8d77 100644 --- a/railties/doc/guides/source/i18n.txt +++ b/railties/doc/guides/source/i18n.txt @@ -278,13 +278,13 @@ If a translation uses :default or :scope as a interpolation variable an I18n::Re === Pluralization -TODO explain what this is good for +In English there's only a singular and a plural form for a given string, e.g. "1 message" and "2 messages". Other languages (http://www.unicode.org/cldr/data/charts/supplemental/language_plural_rules.html#ar[Arabic], http://www.unicode.org/cldr/data/charts/supplemental/language_plural_rules.html#ja[Japanese], http://www.unicode.org/cldr/data/charts/supplemental/language_plural_rules.html#ru[Russian] and many more) have different grammars that have additional or less http://www.unicode.org/cldr/data/charts/supplemental/language_plural_rules.html[plural forms]. Thus, the I18n API provides a flexible pluralization feature. The :count interpolation variable has a special role in that it both is interpolated to the translation and used to pick a pluralization from the translations according to the pluralization rules defined by CLDR: [source, ruby] ------------------------------------------------------- -I18n.backend.store_translations :en, :inbox => { # TODO change this +I18n.backend.store_translations :en, :inbox => { :one => '1 message', :other => '{{count}} messages' } |