Merge "Typo fix"
[mediawiki.git] / resources / mediawiki.language / mediawiki.cldr.js
blobc3023cd5a0a63192b7db5b918cd6f507b1599999
1 /**
2  *  CLDR related utility methods.
3  */
4 ( function ( mw ) {
5         'use strict';
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         };
27         mw.cldr = cldr;
29 }( mediaWiki ) );