From: Santhosh Thottingal Date: Thu, 14 Feb 2013 05:49:55 +0000 (+0530) Subject: Update plural rules from CLDR, and correct Armenian plural rules X-Git-Tag: 1.31.0-rc.0~20700 X-Git-Url: http://git.cyclocoop.org/?a=commitdiff_plain;h=1f650cb9b71308c7b757727b660ee9714f9a2c31;p=lhc%2Fweb%2Fwiklou.git Update plural rules from CLDR, and correct Armenian plural rules * Upgrade to revision 8007, Contains minor change - Armenian(hy) is added * Remove MW custom plural logic from LanguageHy.php * Add qunit test case * Correct phpunit testcase Change-Id: If78436fa1597e6f3b7f050c5eede4521018904c0 --- diff --git a/languages/classes/LanguageHy.php b/languages/classes/LanguageHy.php index 9c15595123..507981318c 100644 --- a/languages/classes/LanguageHy.php +++ b/languages/classes/LanguageHy.php @@ -77,19 +77,6 @@ class LanguageHy extends Language { return $word; } - /** - * @param $count int - * @param $forms array - * - * @return string - */ - function convertPlural( $count, $forms ) { - if ( !count( $forms ) ) { return ''; } - $forms = $this->preConvertPlural( $forms, 2 ); - - return ( abs( $count ) <= 1 ) ? $forms[0] : $forms[1]; - } - /** * Armenian numeric format is "12 345,67" but "1234,56" * diff --git a/languages/data/plurals.xml b/languages/data/plurals.xml index a2992c847d..d1a403dc9a 100644 --- a/languages/data/plurals.xml +++ b/languages/data/plurals.xml @@ -1,8 +1,8 @@ - - + + @@ -18,7 +18,7 @@ n is 2 n is not 0 AND n mod 10 is 0 - + n is 1 diff --git a/tests/phpunit/languages/LanguageHyTest.php b/tests/phpunit/languages/LanguageHyTest.php index ea6e255642..0ff04c3016 100644 --- a/tests/phpunit/languages/LanguageHyTest.php +++ b/tests/phpunit/languages/LanguageHyTest.php @@ -16,7 +16,7 @@ class LanguageHyTest extends LanguageClassesTestCase { function providerPlural() { return array ( - array( 'one', 0 ), + array( 'other', 0 ), array( 'one', 1 ), array( 'other', 2 ), array( 'other', 200 ), diff --git a/tests/qunit/suites/resources/mediawiki/mediawiki.cldr.test.js b/tests/qunit/suites/resources/mediawiki/mediawiki.cldr.test.js index b745fb44c6..779a0ed48d 100644 --- a/tests/qunit/suites/resources/mediawiki/mediawiki.cldr.test.js +++ b/tests/qunit/suites/resources/mediawiki/mediawiki.cldr.test.js @@ -37,6 +37,11 @@ [ 1, [ 'one', 'other' ], 'one', 'Hungarian plural test- 1 is one' ], [ 2, [ 'one', 'other' ], 'other', 'Hungarian plural test- 2 is other' ] ], + hy: [ + [ 0, [ 'one', 'other' ], 'other', 'Armenian plural test- 0 is other' ], + [ 1, [ 'one', 'other' ], 'one', 'Armenian plural test- 1 is one' ], + [ 2, [ 'one', 'other' ], 'other', 'Armenian plural test- 2 is other' ] + ], ar: [ [ 0, [ 'zero', 'one', 'two', 'few', 'many', 'other' ], 'zero', 'Arabic plural test - 0 is zero' ], [ 1, [ 'zero', 'one', 'two', 'few', 'many', 'other' ], 'one', 'Arabic plural test - 1 is one' ],