Update plural rules to CLDR 24
authorSanthosh Thottingal <santhosh.thottingal@gmail.com>
Wed, 1 Jan 2014 09:05:39 +0000 (14:35 +0530)
committerSanthosh Thottingal <santhosh.thottingal@gmail.com>
Fri, 3 Jan 2014 06:23:10 +0000 (11:53 +0530)
commit1441f511a204107554439d73f2401dbb99d8ccad
treea6e272c322e72705fed707311da1bde79cb70f4a
parent38f267f402295b770d1ac14239fc576162e477ca
Update plural rules to CLDR 24

Updated plurals.xml with new data from CLDR 24.

This data is according to UTS #35 Rev 33.

Update the CLDRPluralRuleParser.js to version 1.1 from upstream
https://github.com/santhoshtr/CLDRPluralRuleParser

Changes to the plural rules:

* Hebrew override removed since CLDR 24 matches with MW plural rules.

* Updated the syntax of overridden rules to TR35 Rev 33 for
  Lower Sorbian (dsb), Upper Sorbian (hsb), Belarusian in Taraskievica
  orthography (be_tarask), Old Church Slavonic (cu), Bhojpuri (bho),
  Samogitian (sgs).

* Removed Manx (gv) override. See I46ab3dadc7fe08c1e60bbd81a1ee841e166e9608.

* Removed the overriden convertPlural method for Serbian from LanguageSr.php,
  since CLDR 24 matches with MW rules. Updated and added more tests.
  Tests updated for Serbocroatian (sh), too. Old CLDR versions had 4 plural
  rules and MW had only 3. In CLDR 24, the form 'many' was removed and it
  became identical to the MW. Same for Bosnian (bs) and Croatian (hr).
  Also for variants sr-ec and sr-el

* Macedonian (mk) used to count 11 as 'other' form.
  CLDR 24 counts it as 'one'.
  Not overriding, using CLDR 24 here.
  Updated the tests. MW will not override this.

* Armenian (hy) used to count 0 as 'other'.
  Now it is 'one' form.
  Updated the tests. MW will not override this.

* Latvian (lv) used to count only 0 as 'zero' form, but CLDR 24, any number
  satisifying the following formula is counted as zero:
  n % 10 = 0 or n % 100 = 11..19 or v = 2 and f % 100 = 11..19
  Examples: 0, 10~20, 30, 40, 50, 60, 100.
  Updated the tests accordingly. Not overriding it in MW.
  Users will see different plural form for the above numbers.

* Removed Ukranian custom plural rule since it match with MW

* Russian (ru) plural rules have a major change.
  The 'few' form is merged with the 'other' form.
  The current forms are 'one', 'many', 'other'.
  In MW ru plural rules were overridden using convertPlural methdod
  in LanguagesRu.php with 3 forms.
  Effectively forms[1] and forms[2] are swapped.
  This will affect the messages, and such messages
  must be reviewed and updated. This change is not included in this patch and
  wil be done separately.

Russian is the only remaining language class with convertPlural method overridden.

Notable impact on the exising messages:

* For languages ru, uk, be_tarask, sr, For the special case
  of two plural forms and first mapped to 1 and rest to the other form, syntax like
  {{plural:$1|1=one|other}} should be used.

For further information regarding each of the above language changes, see
1. http://unicode.org/cldr/trac/ticket/3727
2. http://goo.gl/H2HEz

CLDR 24 can handle fractions. Ideally it should start working
in MW without any code changes, but MW language test suite
does not have enough tests to confirm.

Followup: e571717e06667228ec8d689be067e00bdd06d34d

Bug: 56931
Change-Id: I9930b290d004667a3bb09e5c1663ec2c9c27d8a6
20 files changed:
languages/classes/LanguageBe_tarask.php
languages/classes/LanguageHr.php [deleted file]
languages/classes/LanguageSr.php
languages/classes/LanguageSr_ec.php [deleted file]
languages/classes/LanguageSr_el.php [deleted file]
languages/classes/LanguageUk.php
languages/data/plurals-mediawiki.xml
languages/data/plurals.xml [changed mode: 0644->0755]
resources/mediawiki.libs/CLDRPluralRuleParser.js
tests/phpunit/languages/LanguageBe_taraskTest.php
tests/phpunit/languages/LanguageBsTest.php
tests/phpunit/languages/LanguageHrTest.php
tests/phpunit/languages/LanguageHyTest.php
tests/phpunit/languages/LanguageLvTest.php
tests/phpunit/languages/LanguageMkTest.php
tests/phpunit/languages/LanguageRuTest.php
tests/phpunit/languages/LanguageSgsTest.php
tests/phpunit/languages/LanguageShTest.php
tests/phpunit/languages/LanguageSrTest.php
tests/phpunit/languages/LanguageUkTest.php