2012-08-22 13:15:44 +00:00
|
|
|
/**
|
2018-05-04 02:28:10 +00:00
|
|
|
* cldrpluralparser.js
|
|
|
|
|
* A parser engine for CLDR plural rules.
|
|
|
|
|
*
|
|
|
|
|
* Copyright 2012-2014 Santhosh Thottingal and other contributors
|
|
|
|
|
* Released under the MIT license
|
|
|
|
|
* http://opensource.org/licenses/MIT
|
|
|
|
|
*
|
|
|
|
|
* @source https://github.com/santhoshtr/CLDRPluralRuleParser
|
|
|
|
|
* @author Santhosh Thottingal <santhosh.thottingal@gmail.com>
|
|
|
|
|
* @author Timo Tijhof
|
|
|
|
|
* @author Amir Aharoni
|
|
|
|
|
*/
|
|
|
|
|
|
2012-08-22 13:15:44 +00:00
|
|
|
/**
|
|
|
|
|
* Evaluates a plural rule in CLDR syntax for a number
|
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
2014-01-01 09:05:39 +00:00
|
|
|
* @param {string} rule
|
|
|
|
|
* @param {integer} number
|
|
|
|
|
* @return {boolean} true if evaluation passed, false if evaluation failed.
|
2012-08-22 13:15:44 +00:00
|
|
|
*/
|
|
|
|
|
|
2018-05-04 02:28:10 +00:00
|
|
|
// UMD returnExports https://github.com/umdjs/umd/blob/master/returnExports.js
|
|
|
|
|
(function(root, factory) {
|
|
|
|
|
if (typeof define === 'function' && define.amd) {
|
|
|
|
|
// AMD. Register as an anonymous module.
|
|
|
|
|
define(factory);
|
|
|
|
|
} else if (typeof exports === 'object') {
|
2018-10-04 21:17:30 +00:00
|
|
|
/* global module */
|
2018-05-04 02:28:10 +00:00
|
|
|
// Node. Does not work with strict CommonJS, but
|
|
|
|
|
// only CommonJS-like environments that support module.exports,
|
|
|
|
|
// like Node.
|
|
|
|
|
module.exports = factory();
|
|
|
|
|
} else {
|
|
|
|
|
// Browser globals (root is window)
|
|
|
|
|
root.pluralRuleParser = factory();
|
|
|
|
|
}
|
|
|
|
|
}(this, function() {
|
|
|
|
|
|
2012-08-22 13:15:44 +00:00
|
|
|
function pluralRuleParser(rule, number) {
|
2014-09-22 10:41:06 +00:00
|
|
|
'use strict';
|
|
|
|
|
|
2012-08-22 13:15:44 +00:00
|
|
|
/*
|
|
|
|
|
Syntax: see http://unicode.org/reports/tr35/#Language_Plural_Rules
|
|
|
|
|
-----------------------------------------------------------------
|
|
|
|
|
condition = and_condition ('or' and_condition)*
|
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
2014-01-01 09:05:39 +00:00
|
|
|
('@integer' samples)?
|
|
|
|
|
('@decimal' samples)?
|
2012-08-22 13:15:44 +00:00
|
|
|
and_condition = relation ('and' relation)*
|
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
2014-01-01 09:05:39 +00:00
|
|
|
relation = is_relation | in_relation | within_relation
|
2012-08-22 13:15:44 +00:00
|
|
|
is_relation = expr 'is' ('not')? value
|
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
2014-01-01 09:05:39 +00:00
|
|
|
in_relation = expr (('not')? 'in' | '=' | '!=') range_list
|
2012-08-22 13:15:44 +00:00
|
|
|
within_relation = expr ('not')? 'within' range_list
|
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
2014-01-01 09:05:39 +00:00
|
|
|
expr = operand (('mod' | '%') value)?
|
|
|
|
|
operand = 'n' | 'i' | 'f' | 't' | 'v' | 'w'
|
2012-08-22 13:15:44 +00:00
|
|
|
range_list = (range | value) (',' range_list)*
|
|
|
|
|
value = digit+
|
|
|
|
|
digit = 0|1|2|3|4|5|6|7|8|9
|
|
|
|
|
range = value'..'value
|
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
2014-01-01 09:05:39 +00:00
|
|
|
samples = sampleRange (',' sampleRange)* (',' ('…'|'...'))?
|
|
|
|
|
sampleRange = decimalValue '~' decimalValue
|
|
|
|
|
decimalValue = value ('.' value)?
|
2012-08-22 13:15:44 +00:00
|
|
|
*/
|
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
2014-01-01 09:05:39 +00:00
|
|
|
|
2014-09-22 10:41:06 +00:00
|
|
|
// We don't evaluate the samples section of the rule. Ignore it.
|
2014-02-28 21:13:02 +00:00
|
|
|
rule = rule.split('@')[0].replace(/^\s*/, '').replace(/\s*$/, '');
|
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
2014-01-01 09:05:39 +00:00
|
|
|
|
|
|
|
|
if (!rule.length) {
|
2014-09-22 10:41:06 +00:00
|
|
|
// Empty rule or 'other' rule.
|
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
2014-01-01 09:05:39 +00:00
|
|
|
return true;
|
|
|
|
|
}
|
2014-09-22 10:41:06 +00:00
|
|
|
|
|
|
|
|
// Indicates the current position in the rule as we parse through it.
|
2012-08-22 13:15:44 +00:00
|
|
|
// Shared among all parsing functions below.
|
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
2014-01-01 09:05:39 +00:00
|
|
|
var pos = 0,
|
|
|
|
|
operand,
|
|
|
|
|
expression,
|
|
|
|
|
relation,
|
|
|
|
|
result,
|
|
|
|
|
whitespace = makeRegexParser(/^\s+/),
|
|
|
|
|
value = makeRegexParser(/^\d+/),
|
|
|
|
|
_n_ = makeStringParser('n'),
|
|
|
|
|
_i_ = makeStringParser('i'),
|
|
|
|
|
_f_ = makeStringParser('f'),
|
|
|
|
|
_t_ = makeStringParser('t'),
|
|
|
|
|
_v_ = makeStringParser('v'),
|
|
|
|
|
_w_ = makeStringParser('w'),
|
|
|
|
|
_is_ = makeStringParser('is'),
|
|
|
|
|
_isnot_ = makeStringParser('is not'),
|
|
|
|
|
_isnot_sign_ = makeStringParser('!='),
|
|
|
|
|
_equal_ = makeStringParser('='),
|
|
|
|
|
_mod_ = makeStringParser('mod'),
|
|
|
|
|
_percent_ = makeStringParser('%'),
|
|
|
|
|
_not_ = makeStringParser('not'),
|
|
|
|
|
_in_ = makeStringParser('in'),
|
|
|
|
|
_within_ = makeStringParser('within'),
|
|
|
|
|
_range_ = makeStringParser('..'),
|
|
|
|
|
_comma_ = makeStringParser(','),
|
|
|
|
|
_or_ = makeStringParser('or'),
|
|
|
|
|
_and_ = makeStringParser('and');
|
2012-08-22 13:15:44 +00:00
|
|
|
|
|
|
|
|
function debug() {
|
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
2014-01-01 09:05:39 +00:00
|
|
|
// console.log.apply(console, arguments);
|
2012-08-22 13:15:44 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
debug('pluralRuleParser', rule, number);
|
|
|
|
|
|
|
|
|
|
// Try parsers until one works, if none work return null
|
|
|
|
|
function choice(parserSyntax) {
|
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
2014-01-01 09:05:39 +00:00
|
|
|
return function() {
|
2014-09-22 10:41:06 +00:00
|
|
|
var i, result;
|
|
|
|
|
|
|
|
|
|
for (i = 0; i < parserSyntax.length; i++) {
|
|
|
|
|
result = parserSyntax[i]();
|
|
|
|
|
|
2012-08-22 13:15:44 +00:00
|
|
|
if (result !== null) {
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
}
|
2014-09-22 10:41:06 +00:00
|
|
|
|
2012-08-22 13:15:44 +00:00
|
|
|
return null;
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Try several parserSyntax-es in a row.
|
|
|
|
|
// All must succeed; otherwise, return null.
|
|
|
|
|
// This is the only eager one.
|
|
|
|
|
function sequence(parserSyntax) {
|
2014-09-22 10:41:06 +00:00
|
|
|
var i, parserRes,
|
|
|
|
|
originalPos = pos,
|
|
|
|
|
result = [];
|
|
|
|
|
|
|
|
|
|
for (i = 0; i < parserSyntax.length; i++) {
|
|
|
|
|
parserRes = parserSyntax[i]();
|
|
|
|
|
|
|
|
|
|
if (parserRes === null) {
|
2012-08-22 13:15:44 +00:00
|
|
|
pos = originalPos;
|
2014-09-22 10:41:06 +00:00
|
|
|
|
2012-08-22 13:15:44 +00:00
|
|
|
return null;
|
|
|
|
|
}
|
2014-09-22 10:41:06 +00:00
|
|
|
|
|
|
|
|
result.push(parserRes);
|
2012-08-22 13:15:44 +00:00
|
|
|
}
|
2014-09-22 10:41:06 +00:00
|
|
|
|
2012-08-22 13:15:44 +00:00
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Run the same parser over and over until it fails.
|
|
|
|
|
// Must succeed a minimum of n times; otherwise, return null.
|
|
|
|
|
function nOrMore(n, p) {
|
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
2014-01-01 09:05:39 +00:00
|
|
|
return function() {
|
2014-09-22 10:41:06 +00:00
|
|
|
var originalPos = pos,
|
|
|
|
|
result = [],
|
|
|
|
|
parsed = p();
|
|
|
|
|
|
2012-08-22 13:15:44 +00:00
|
|
|
while (parsed !== null) {
|
|
|
|
|
result.push(parsed);
|
|
|
|
|
parsed = p();
|
|
|
|
|
}
|
2014-09-22 10:41:06 +00:00
|
|
|
|
2012-08-22 13:15:44 +00:00
|
|
|
if (result.length < n) {
|
|
|
|
|
pos = originalPos;
|
2014-09-22 10:41:06 +00:00
|
|
|
|
2012-08-22 13:15:44 +00:00
|
|
|
return null;
|
|
|
|
|
}
|
2014-09-22 10:41:06 +00:00
|
|
|
|
2012-08-22 13:15:44 +00:00
|
|
|
return result;
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
2014-09-22 10:41:06 +00:00
|
|
|
// Helpers - just make parserSyntax out of simpler JS builtin types
|
2012-08-22 13:15:44 +00:00
|
|
|
function makeStringParser(s) {
|
|
|
|
|
var len = s.length;
|
2014-09-22 10:41:06 +00:00
|
|
|
|
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
2014-01-01 09:05:39 +00:00
|
|
|
return function() {
|
2012-08-22 13:15:44 +00:00
|
|
|
var result = null;
|
2014-09-22 10:41:06 +00:00
|
|
|
|
2012-08-22 13:15:44 +00:00
|
|
|
if (rule.substr(pos, len) === s) {
|
|
|
|
|
result = s;
|
|
|
|
|
pos += len;
|
|
|
|
|
}
|
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
2014-01-01 09:05:39 +00:00
|
|
|
|
2012-08-22 13:15:44 +00:00
|
|
|
return result;
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function makeRegexParser(regex) {
|
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
2014-01-01 09:05:39 +00:00
|
|
|
return function() {
|
2012-08-22 13:15:44 +00:00
|
|
|
var matches = rule.substr(pos).match(regex);
|
2014-09-22 10:41:06 +00:00
|
|
|
|
2012-08-22 13:15:44 +00:00
|
|
|
if (matches === null) {
|
|
|
|
|
return null;
|
|
|
|
|
}
|
2014-09-22 10:41:06 +00:00
|
|
|
|
2012-08-22 13:15:44 +00:00
|
|
|
pos += matches[0].length;
|
2014-09-22 10:41:06 +00:00
|
|
|
|
2012-08-22 13:15:44 +00:00
|
|
|
return matches[0];
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
2014-09-22 10:41:06 +00:00
|
|
|
/**
|
|
|
|
|
* Integer digits of n.
|
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
2014-01-01 09:05:39 +00:00
|
|
|
*/
|
|
|
|
|
function i() {
|
|
|
|
|
var result = _i_();
|
2014-09-22 10:41:06 +00:00
|
|
|
|
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
2014-01-01 09:05:39 +00:00
|
|
|
if (result === null) {
|
|
|
|
|
debug(' -- failed i', parseInt(number, 10));
|
2014-09-22 10:41:06 +00:00
|
|
|
|
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
2014-01-01 09:05:39 +00:00
|
|
|
return result;
|
|
|
|
|
}
|
2014-09-22 10:41:06 +00:00
|
|
|
|
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
2014-01-01 09:05:39 +00:00
|
|
|
result = parseInt(number, 10);
|
|
|
|
|
debug(' -- passed i ', result);
|
2014-09-22 10:41:06 +00:00
|
|
|
|
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
2014-01-01 09:05:39 +00:00
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
2014-09-22 10:41:06 +00:00
|
|
|
/**
|
|
|
|
|
* Absolute value of the source number (integer and decimals).
|
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
2014-01-01 09:05:39 +00:00
|
|
|
*/
|
2012-08-22 13:15:44 +00:00
|
|
|
function n() {
|
|
|
|
|
var result = _n_();
|
2014-09-22 10:41:06 +00:00
|
|
|
|
2012-08-22 13:15:44 +00:00
|
|
|
if (result === null) {
|
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
2014-01-01 09:05:39 +00:00
|
|
|
debug(' -- failed n ', number);
|
2014-09-22 10:41:06 +00:00
|
|
|
|
2012-08-22 13:15:44 +00:00
|
|
|
return result;
|
|
|
|
|
}
|
2014-09-22 10:41:06 +00:00
|
|
|
|
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
2014-01-01 09:05:39 +00:00
|
|
|
result = parseFloat(number, 10);
|
|
|
|
|
debug(' -- passed n ', result);
|
2014-09-22 10:41:06 +00:00
|
|
|
|
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
2014-01-01 09:05:39 +00:00
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
2014-09-22 10:41:06 +00:00
|
|
|
/**
|
|
|
|
|
* Visible fractional digits in n, with trailing zeros.
|
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
2014-01-01 09:05:39 +00:00
|
|
|
*/
|
|
|
|
|
function f() {
|
|
|
|
|
var result = _f_();
|
2014-09-22 10:41:06 +00:00
|
|
|
|
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
2014-01-01 09:05:39 +00:00
|
|
|
if (result === null) {
|
|
|
|
|
debug(' -- failed f ', number);
|
2014-09-22 10:41:06 +00:00
|
|
|
|
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
2014-01-01 09:05:39 +00:00
|
|
|
return result;
|
|
|
|
|
}
|
2014-09-22 10:41:06 +00:00
|
|
|
|
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
2014-01-01 09:05:39 +00:00
|
|
|
result = (number + '.').split('.')[1] || 0;
|
|
|
|
|
debug(' -- passed f ', result);
|
2014-09-22 10:41:06 +00:00
|
|
|
|
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
2014-01-01 09:05:39 +00:00
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
2014-09-22 10:41:06 +00:00
|
|
|
/**
|
|
|
|
|
* Visible fractional digits in n, without trailing zeros.
|
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
2014-01-01 09:05:39 +00:00
|
|
|
*/
|
|
|
|
|
function t() {
|
|
|
|
|
var result = _t_();
|
2014-09-22 10:41:06 +00:00
|
|
|
|
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
2014-01-01 09:05:39 +00:00
|
|
|
if (result === null) {
|
|
|
|
|
debug(' -- failed t ', number);
|
2014-09-22 10:41:06 +00:00
|
|
|
|
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
2014-01-01 09:05:39 +00:00
|
|
|
return result;
|
|
|
|
|
}
|
2014-09-22 10:41:06 +00:00
|
|
|
|
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
2014-01-01 09:05:39 +00:00
|
|
|
result = (number + '.').split('.')[1].replace(/0$/, '') || 0;
|
|
|
|
|
debug(' -- passed t ', result);
|
2014-09-22 10:41:06 +00:00
|
|
|
|
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
2014-01-01 09:05:39 +00:00
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
2014-09-22 10:41:06 +00:00
|
|
|
/**
|
|
|
|
|
* Number of visible fraction digits in n, with trailing zeros.
|
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
2014-01-01 09:05:39 +00:00
|
|
|
*/
|
|
|
|
|
function v() {
|
|
|
|
|
var result = _v_();
|
2014-09-22 10:41:06 +00:00
|
|
|
|
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
2014-01-01 09:05:39 +00:00
|
|
|
if (result === null) {
|
|
|
|
|
debug(' -- failed v ', number);
|
2014-09-22 10:41:06 +00:00
|
|
|
|
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
2014-01-01 09:05:39 +00:00
|
|
|
return result;
|
|
|
|
|
}
|
2014-09-22 10:41:06 +00:00
|
|
|
|
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
2014-01-01 09:05:39 +00:00
|
|
|
result = (number + '.').split('.')[1].length || 0;
|
|
|
|
|
debug(' -- passed v ', result);
|
2014-09-22 10:41:06 +00:00
|
|
|
|
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
2014-01-01 09:05:39 +00:00
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
2014-09-22 10:41:06 +00:00
|
|
|
/**
|
|
|
|
|
* Number of visible fraction digits in n, without trailing zeros.
|
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
2014-01-01 09:05:39 +00:00
|
|
|
*/
|
|
|
|
|
function w() {
|
|
|
|
|
var result = _w_();
|
2014-09-22 10:41:06 +00:00
|
|
|
|
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
2014-01-01 09:05:39 +00:00
|
|
|
if (result === null) {
|
|
|
|
|
debug(' -- failed w ', number);
|
2014-09-22 10:41:06 +00:00
|
|
|
|
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
2014-01-01 09:05:39 +00:00
|
|
|
return result;
|
|
|
|
|
}
|
2014-09-22 10:41:06 +00:00
|
|
|
|
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
2014-01-01 09:05:39 +00:00
|
|
|
result = (number + '.').split('.')[1].replace(/0$/, '').length || 0;
|
|
|
|
|
debug(' -- passed w ', result);
|
2014-09-22 10:41:06 +00:00
|
|
|
|
2012-08-22 13:15:44 +00:00
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
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
2014-01-01 09:05:39 +00:00
|
|
|
// operand = 'n' | 'i' | 'f' | 't' | 'v' | 'w'
|
|
|
|
|
operand = choice([n, i, f, t, v, w]);
|
|
|
|
|
|
|
|
|
|
// expr = operand (('mod' | '%') value)?
|
|
|
|
|
expression = choice([mod, operand]);
|
2012-08-22 13:15:44 +00:00
|
|
|
|
|
|
|
|
function mod() {
|
2014-09-22 10:41:06 +00:00
|
|
|
var result = sequence(
|
|
|
|
|
[operand, whitespace, choice([_mod_, _percent_]), whitespace, value]
|
|
|
|
|
);
|
|
|
|
|
|
2012-08-22 13:15:44 +00:00
|
|
|
if (result === null) {
|
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
2014-01-01 09:05:39 +00:00
|
|
|
debug(' -- failed mod');
|
2014-09-22 10:41:06 +00:00
|
|
|
|
2012-08-22 13:15:44 +00:00
|
|
|
return null;
|
|
|
|
|
}
|
2014-09-22 10:41:06 +00:00
|
|
|
|
2018-10-04 21:17:30 +00:00
|
|
|
debug(' -- passed ', parseInt(result[0], 10), result[2], parseInt(result[4], 10));
|
2014-09-22 10:41:06 +00:00
|
|
|
|
2018-10-04 21:17:30 +00:00
|
|
|
return parseFloat(result[0]) % parseInt(result[4], 10);
|
2012-08-22 13:15:44 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function not() {
|
|
|
|
|
var result = sequence([whitespace, _not_]);
|
2014-09-22 10:41:06 +00:00
|
|
|
|
2012-08-22 13:15:44 +00:00
|
|
|
if (result === null) {
|
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
2014-01-01 09:05:39 +00:00
|
|
|
debug(' -- failed not');
|
2014-09-22 10:41:06 +00:00
|
|
|
|
2012-08-22 13:15:44 +00:00
|
|
|
return null;
|
|
|
|
|
}
|
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
2014-01-01 09:05:39 +00:00
|
|
|
|
|
|
|
|
return result[1];
|
2012-08-22 13:15:44 +00:00
|
|
|
}
|
|
|
|
|
|
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
2014-01-01 09:05:39 +00:00
|
|
|
// is_relation = expr 'is' ('not')? value
|
2012-08-22 13:15:44 +00:00
|
|
|
function is() {
|
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
2014-01-01 09:05:39 +00:00
|
|
|
var result = sequence([expression, whitespace, choice([_is_]), whitespace, value]);
|
2014-09-22 10:41:06 +00:00
|
|
|
|
2012-08-22 13:15:44 +00:00
|
|
|
if (result !== null) {
|
2018-10-04 21:17:30 +00:00
|
|
|
debug(' -- passed is :', result[0], ' == ', parseInt(result[4], 10));
|
2014-09-22 10:41:06 +00:00
|
|
|
|
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
2014-01-01 09:05:39 +00:00
|
|
|
return result[0] === parseInt(result[4], 10);
|
|
|
|
|
}
|
2014-09-22 10:41:06 +00:00
|
|
|
|
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
2014-01-01 09:05:39 +00:00
|
|
|
debug(' -- failed is');
|
2014-09-22 10:41:06 +00:00
|
|
|
|
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
2014-01-01 09:05:39 +00:00
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// is_relation = expr 'is' ('not')? value
|
|
|
|
|
function isnot() {
|
2014-09-22 10:41:06 +00:00
|
|
|
var result = sequence(
|
|
|
|
|
[expression, whitespace, choice([_isnot_, _isnot_sign_]), whitespace, value]
|
|
|
|
|
);
|
|
|
|
|
|
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
2014-01-01 09:05:39 +00:00
|
|
|
if (result !== null) {
|
2018-10-04 21:17:30 +00:00
|
|
|
debug(' -- passed isnot: ', result[0], ' != ', parseInt(result[4], 10));
|
2014-09-22 10:41:06 +00:00
|
|
|
|
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
2014-01-01 09:05:39 +00:00
|
|
|
return result[0] !== parseInt(result[4], 10);
|
|
|
|
|
}
|
2014-09-22 10:41:06 +00:00
|
|
|
|
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
2014-01-01 09:05:39 +00:00
|
|
|
debug(' -- failed isnot');
|
2014-09-22 10:41:06 +00:00
|
|
|
|
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
2014-01-01 09:05:39 +00:00
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function not_in() {
|
2014-09-22 10:41:06 +00:00
|
|
|
var i, range_list,
|
|
|
|
|
result = sequence([expression, whitespace, _isnot_sign_, whitespace, rangeList]);
|
|
|
|
|
|
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
2014-01-01 09:05:39 +00:00
|
|
|
if (result !== null) {
|
2018-10-04 21:17:30 +00:00
|
|
|
debug(' -- passed not_in: ', result[0], ' != ', result[4]);
|
2014-09-22 10:41:06 +00:00
|
|
|
range_list = result[4];
|
|
|
|
|
|
|
|
|
|
for (i = 0; i < range_list.length; i++) {
|
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
2014-01-01 09:05:39 +00:00
|
|
|
if (parseInt(range_list[i], 10) === parseInt(result[0], 10)) {
|
|
|
|
|
return false;
|
|
|
|
|
}
|
2012-08-22 13:15:44 +00:00
|
|
|
}
|
2014-09-22 10:41:06 +00:00
|
|
|
|
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
2014-01-01 09:05:39 +00:00
|
|
|
return true;
|
2012-08-22 13:15:44 +00:00
|
|
|
}
|
2014-09-22 10:41:06 +00:00
|
|
|
|
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
2014-01-01 09:05:39 +00:00
|
|
|
debug(' -- failed not_in');
|
2014-09-22 10:41:06 +00:00
|
|
|
|
2012-08-22 13:15:44 +00:00
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
|
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
2014-01-01 09:05:39 +00:00
|
|
|
// range_list = (range | value) (',' range_list)*
|
2012-08-22 13:15:44 +00:00
|
|
|
function rangeList() {
|
2014-09-22 10:41:06 +00:00
|
|
|
var result = sequence([choice([range, value]), nOrMore(0, rangeTail)]),
|
|
|
|
|
resultList = [];
|
|
|
|
|
|
2012-08-22 13:15:44 +00:00
|
|
|
if (result !== null) {
|
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
2014-01-01 09:05:39 +00:00
|
|
|
resultList = resultList.concat(result[0]);
|
2014-09-22 10:41:06 +00:00
|
|
|
|
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
2014-01-01 09:05:39 +00:00
|
|
|
if (result[1][0]) {
|
|
|
|
|
resultList = resultList.concat(result[1][0]);
|
|
|
|
|
}
|
2014-09-22 10:41:06 +00:00
|
|
|
|
2012-08-22 13:15:44 +00:00
|
|
|
return resultList;
|
|
|
|
|
}
|
2014-09-22 10:41:06 +00:00
|
|
|
|
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
2014-01-01 09:05:39 +00:00
|
|
|
debug(' -- failed rangeList');
|
2014-09-22 10:41:06 +00:00
|
|
|
|
2012-08-22 13:15:44 +00:00
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function rangeTail() {
|
|
|
|
|
// ',' range_list
|
|
|
|
|
var result = sequence([_comma_, rangeList]);
|
2014-09-22 10:41:06 +00:00
|
|
|
|
2012-08-22 13:15:44 +00:00
|
|
|
if (result !== null) {
|
|
|
|
|
return result[1];
|
|
|
|
|
}
|
2014-09-22 10:41:06 +00:00
|
|
|
|
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
2014-01-01 09:05:39 +00:00
|
|
|
debug(' -- failed rangeTail');
|
2014-09-22 10:41:06 +00:00
|
|
|
|
2012-08-22 13:15:44 +00:00
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
|
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
2014-01-01 09:05:39 +00:00
|
|
|
// range = value'..'value
|
2012-08-22 13:15:44 +00:00
|
|
|
function range() {
|
2014-09-22 10:41:06 +00:00
|
|
|
var i, array, left, right,
|
|
|
|
|
result = sequence([value, _range_, value]);
|
|
|
|
|
|
2012-08-22 13:15:44 +00:00
|
|
|
if (result !== null) {
|
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
2014-01-01 09:05:39 +00:00
|
|
|
debug(' -- passed range');
|
2014-09-22 10:41:06 +00:00
|
|
|
|
|
|
|
|
array = [];
|
|
|
|
|
left = parseInt(result[0], 10);
|
|
|
|
|
right = parseInt(result[2], 10);
|
|
|
|
|
|
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
2014-01-01 09:05:39 +00:00
|
|
|
for (i = left; i <= right; i++) {
|
2012-08-22 13:15:44 +00:00
|
|
|
array.push(i);
|
|
|
|
|
}
|
2014-09-22 10:41:06 +00:00
|
|
|
|
2012-08-22 13:15:44 +00:00
|
|
|
return array;
|
|
|
|
|
}
|
2014-09-22 10:41:06 +00:00
|
|
|
|
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
2014-01-01 09:05:39 +00:00
|
|
|
debug(' -- failed range');
|
2014-09-22 10:41:06 +00:00
|
|
|
|
2012-08-22 13:15:44 +00:00
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function _in() {
|
2014-09-22 10:41:06 +00:00
|
|
|
var result, range_list, i;
|
|
|
|
|
|
2012-08-22 13:15:44 +00:00
|
|
|
// in_relation = expr ('not')? 'in' range_list
|
2014-09-22 10:41:06 +00:00
|
|
|
result = sequence(
|
|
|
|
|
[expression, nOrMore(0, not), whitespace, choice([_in_, _equal_]), whitespace, rangeList]
|
|
|
|
|
);
|
|
|
|
|
|
2012-08-22 13:15:44 +00:00
|
|
|
if (result !== null) {
|
2018-10-04 21:17:30 +00:00
|
|
|
debug(' -- passed _in:', result);
|
2014-09-22 10:41:06 +00:00
|
|
|
|
|
|
|
|
range_list = result[5];
|
|
|
|
|
|
|
|
|
|
for (i = 0; i < range_list.length; i++) {
|
2018-10-04 21:17:30 +00:00
|
|
|
if (parseInt(range_list[i], 10) === parseFloat(result[0])) {
|
2012-08-22 13:15:44 +00:00
|
|
|
return (result[1][0] !== 'not');
|
|
|
|
|
}
|
|
|
|
|
}
|
2014-09-22 10:41:06 +00:00
|
|
|
|
2012-08-22 13:15:44 +00:00
|
|
|
return (result[1][0] === 'not');
|
|
|
|
|
}
|
2014-09-22 10:41:06 +00:00
|
|
|
|
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
2014-01-01 09:05:39 +00:00
|
|
|
debug(' -- failed _in ');
|
2014-09-22 10:41:06 +00:00
|
|
|
|
2012-08-22 13:15:44 +00:00
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
|
2014-09-22 10:41:06 +00:00
|
|
|
/**
|
|
|
|
|
* The difference between "in" and "within" is that
|
|
|
|
|
* "in" only includes integers in the specified range,
|
|
|
|
|
* while "within" includes all values.
|
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
2014-01-01 09:05:39 +00:00
|
|
|
*/
|
2012-08-22 13:15:44 +00:00
|
|
|
function within() {
|
2014-09-22 10:41:06 +00:00
|
|
|
var range_list, result;
|
|
|
|
|
|
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
2014-01-01 09:05:39 +00:00
|
|
|
// within_relation = expr ('not')? 'within' range_list
|
2014-09-22 10:41:06 +00:00
|
|
|
result = sequence(
|
|
|
|
|
[expression, nOrMore(0, not), whitespace, _within_, whitespace, rangeList]
|
|
|
|
|
);
|
|
|
|
|
|
2012-08-22 13:15:44 +00:00
|
|
|
if (result !== null) {
|
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
2014-01-01 09:05:39 +00:00
|
|
|
debug(' -- passed within');
|
2014-09-22 10:41:06 +00:00
|
|
|
|
|
|
|
|
range_list = result[5];
|
|
|
|
|
|
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
2014-01-01 09:05:39 +00:00
|
|
|
if ((result[0] >= parseInt(range_list[0], 10)) &&
|
|
|
|
|
(result[0] < parseInt(range_list[range_list.length - 1], 10))) {
|
2014-09-22 10:41:06 +00:00
|
|
|
|
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
2014-01-01 09:05:39 +00:00
|
|
|
return (result[1][0] !== 'not');
|
|
|
|
|
}
|
2014-09-22 10:41:06 +00:00
|
|
|
|
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
2014-01-01 09:05:39 +00:00
|
|
|
return (result[1][0] === 'not');
|
2012-08-22 13:15:44 +00:00
|
|
|
}
|
2014-09-22 10:41:06 +00:00
|
|
|
|
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
2014-01-01 09:05:39 +00:00
|
|
|
debug(' -- failed within ');
|
2014-09-22 10:41:06 +00:00
|
|
|
|
2012-08-22 13:15:44 +00:00
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
|
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
2014-01-01 09:05:39 +00:00
|
|
|
// relation = is_relation | in_relation | within_relation
|
|
|
|
|
relation = choice([is, not_in, isnot, _in, within]);
|
2012-08-22 13:15:44 +00:00
|
|
|
|
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
2014-01-01 09:05:39 +00:00
|
|
|
// and_condition = relation ('and' relation)*
|
2012-08-22 13:15:44 +00:00
|
|
|
function and() {
|
2014-09-22 10:41:06 +00:00
|
|
|
var i,
|
|
|
|
|
result = sequence([relation, nOrMore(0, andTail)]);
|
|
|
|
|
|
2012-08-22 13:15:44 +00:00
|
|
|
if (result) {
|
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
2014-01-01 09:05:39 +00:00
|
|
|
if (!result[0]) {
|
|
|
|
|
return false;
|
|
|
|
|
}
|
2014-09-22 10:41:06 +00:00
|
|
|
|
|
|
|
|
for (i = 0; i < result[1].length; i++) {
|
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
2014-01-01 09:05:39 +00:00
|
|
|
if (!result[1][i]) {
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
}
|
2014-09-22 10:41:06 +00:00
|
|
|
|
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
2014-01-01 09:05:39 +00:00
|
|
|
return true;
|
2012-08-22 13:15:44 +00:00
|
|
|
}
|
2014-09-22 10:41:06 +00:00
|
|
|
|
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
2014-01-01 09:05:39 +00:00
|
|
|
debug(' -- failed and');
|
2014-09-22 10:41:06 +00:00
|
|
|
|
2012-08-22 13:15:44 +00:00
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
|
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
2014-01-01 09:05:39 +00:00
|
|
|
// ('and' relation)*
|
|
|
|
|
function andTail() {
|
|
|
|
|
var result = sequence([whitespace, _and_, whitespace, relation]);
|
2014-09-22 10:41:06 +00:00
|
|
|
|
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
2014-01-01 09:05:39 +00:00
|
|
|
if (result !== null) {
|
2018-10-04 21:17:30 +00:00
|
|
|
debug(' -- passed andTail', result);
|
2014-09-22 10:41:06 +00:00
|
|
|
|
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
2014-01-01 09:05:39 +00:00
|
|
|
return result[3];
|
2012-08-22 13:15:44 +00:00
|
|
|
}
|
2014-09-22 10:41:06 +00:00
|
|
|
|
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
2014-01-01 09:05:39 +00:00
|
|
|
debug(' -- failed andTail');
|
2014-09-22 10:41:06 +00:00
|
|
|
|
2012-08-22 13:15:44 +00:00
|
|
|
return null;
|
|
|
|
|
|
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
2014-01-01 09:05:39 +00:00
|
|
|
}
|
|
|
|
|
// ('or' and_condition)*
|
|
|
|
|
function orTail() {
|
|
|
|
|
var result = sequence([whitespace, _or_, whitespace, and]);
|
2014-09-22 10:41:06 +00:00
|
|
|
|
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
2014-01-01 09:05:39 +00:00
|
|
|
if (result !== null) {
|
2018-10-04 21:17:30 +00:00
|
|
|
debug(' -- passed orTail: ', result[3]);
|
2014-09-22 10:41:06 +00:00
|
|
|
|
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
2014-01-01 09:05:39 +00:00
|
|
|
return result[3];
|
|
|
|
|
}
|
2014-09-22 10:41:06 +00:00
|
|
|
|
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
2014-01-01 09:05:39 +00:00
|
|
|
debug(' -- failed orTail');
|
2012-08-22 13:15:44 +00:00
|
|
|
|
2014-09-22 10:41:06 +00:00
|
|
|
return null;
|
2012-09-15 03:20:04 +00:00
|
|
|
}
|
|
|
|
|
|
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
2014-01-01 09:05:39 +00:00
|
|
|
// condition = and_condition ('or' and_condition)*
|
|
|
|
|
function condition() {
|
2014-09-22 10:41:06 +00:00
|
|
|
var i,
|
|
|
|
|
result = sequence([and, nOrMore(0, orTail)]);
|
|
|
|
|
|
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
2014-01-01 09:05:39 +00:00
|
|
|
if (result) {
|
2014-09-22 10:41:06 +00:00
|
|
|
for (i = 0; i < result[1].length; i++) {
|
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
2014-01-01 09:05:39 +00:00
|
|
|
if (result[1][i]) {
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
}
|
2012-09-15 03:20:04 +00:00
|
|
|
|
2014-09-22 10:41:06 +00:00
|
|
|
return result[0];
|
2012-09-15 03:20:04 +00:00
|
|
|
}
|
2014-09-22 10:41:06 +00:00
|
|
|
|
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
2014-01-01 09:05:39 +00:00
|
|
|
return false;
|
2012-08-22 13:15:44 +00:00
|
|
|
}
|
|
|
|
|
|
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
2014-01-01 09:05:39 +00:00
|
|
|
result = condition();
|
2014-09-22 10:41:06 +00:00
|
|
|
|
|
|
|
|
/**
|
2012-08-22 13:15:44 +00:00
|
|
|
* For success, the pos must have gotten to the end of the rule
|
|
|
|
|
* and returned a non-null.
|
2014-09-22 10:41:06 +00:00
|
|
|
* n.b. This is part of language infrastructure,
|
|
|
|
|
* so we do not throw an internationalizable message.
|
2012-08-22 13:15:44 +00:00
|
|
|
*/
|
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
2014-01-01 09:05:39 +00:00
|
|
|
if (result === null) {
|
|
|
|
|
throw new Error('Parse error at position ' + pos.toString() + ' for rule: ' + rule);
|
2012-08-22 13:15:44 +00:00
|
|
|
}
|
|
|
|
|
|
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
2014-01-01 09:05:39 +00:00
|
|
|
if (pos !== rule.length) {
|
2018-10-04 21:17:30 +00:00
|
|
|
debug('Warning: Rule not parsed completely. Parser stopped at ', rule.substr(0, pos), ' for rule: ', rule);
|
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
2014-01-01 09:05:39 +00:00
|
|
|
}
|
2012-08-22 13:15:44 +00:00
|
|
|
|
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
2014-01-01 09:05:39 +00:00
|
|
|
return result;
|
2012-08-22 13:15:44 +00:00
|
|
|
}
|
|
|
|
|
|
2018-05-04 02:28:10 +00:00
|
|
|
return pluralRuleParser;
|
2012-08-22 13:15:44 +00:00
|
|
|
|
2018-05-04 02:28:10 +00:00
|
|
|
}));
|