From 4971db37d48ed184f8f66a3b2ed3cf89235a660b Mon Sep 17 00:00:00 2001 From: Andy Staudacher Date: Wed, 18 Mar 2009 02:40:16 +0000 Subject: Fix for ticket 142: Choose plural form "other" for count == 0 (unless the locale has a specific plural form for zero) --- core/tests/I18n_Test.php | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'core/tests') diff --git a/core/tests/I18n_Test.php b/core/tests/I18n_Test.php index f0ed827d..3a5e24f4 100644 --- a/core/tests/I18n_Test.php +++ b/core/tests/I18n_Test.php @@ -96,4 +96,13 @@ class I18n_Test extends Unit_Test_Case { $result = $this->i18n->translate('Hello %name, how are you today?', array('foo' => 'bar')); $this->assert_equal('Hallo %name, wie geht es Dir heute?', $result); } + + public function translate_plural_zero_test() { + // te_ST has the same plural rules as en and de. + // For count 0, plural form "other" should be used. + $result = $this->i18n->translate(array('one' => 'One item has been added', + 'other' => '%count elements have been added'), + array('count' => 0)); + $this->assert_equal('0 Elemente wurden hinzugefuegt.', $result); + } } \ No newline at end of file -- cgit v1.2.3