From f333661ec28211b11fad0665b99aad6b0fd23260 Mon Sep 17 00:00:00 2001 From: Sven Fuchs Date: Tue, 16 Dec 2008 15:52:28 +0100 Subject: explain changes of pluralization feature --- railties/doc/guides/source/i18n.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'railties') 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' } -- cgit v1.2.3