Merge "Drop zh-tw message "saveprefs""
[lhc/web/wiklou.git] / resources / src / mediawiki.language / mediawiki.cldr.js
1 ( function ( mw ) {
2 'use strict';
3
4 /**
5 * Namespace for CLDR-related utility methods.
6 *
7 * @class
8 * @singleton
9 */
10 mw.cldr = {
11 /**
12 * Get the plural form index for the number.
13 *
14 * In case none of the rules passed, we return `pluralRules.length` -
15 * that means it is the "other" form.
16 *
17 * @param {number} number
18 * @param {Array} pluralRules
19 * @return {number} plural form index
20 */
21 getPluralForm: function ( number, pluralRules ) {
22 var i;
23 for ( i = 0; i < pluralRules.length; i++ ) {
24 if ( mw.libs.pluralRuleParser( pluralRules[ i ], number ) ) {
25 break;
26 }
27 }
28 return i;
29 }
30 };
31
32 }( mediaWiki ) );