Merge "(bug 37158) display personal menu on top of page tabs on Vector"
[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 {Array} pluralRules
14 * @return {number} plural form index
15 */
16 getPluralForm: function ( number, pluralRules ) {
17 var i;
18 for ( i = 0; i < pluralRules.length; i++ ) {
19 if ( mw.libs.pluralRuleParser( pluralRules[i], number ) ) {
20 break;
21 }
22 }
23 return i;
24 }
25 };
26
27 mw.cldr = cldr;
28
29 }( mediaWiki ) );