Merge "Update migrateUserGroup to deal with primary key issue"
[lhc/web/wiklou.git] / resources / mediawiki.language / mediawiki.cldr.js
1 /**
2 * CLDR related utility methods
3 */
4 ( function( mw ) {
5 "use strict";
6
7 var cldr = {
8 /**
9 * For the number, get the plural for index
10 * In case none of the rules passed, we return pluralRules.length
11 * That means it is the "other" form.
12 * @param number
13 * @param pluralRules
14 * @return plural form index
15 */
16 getPluralForm: function( number, pluralRules ) {
17 var pluralFormIndex = 0;
18 for ( pluralFormIndex = 0; pluralFormIndex < pluralRules.length; pluralFormIndex++ ) {
19 if ( mw.libs.pluralRuleParser( pluralRules[pluralFormIndex], number ) ) {
20 break;
21 }
22 }
23 return pluralFormIndex;
24 }
25 };
26
27 mw.cldr = cldr;
28 } )( mediaWiki );