Index: trunk/phase3/resources/mediawiki.language/mediawiki.language.js |
— | — | @@ -28,7 +28,7 @@ |
29 | 29 | // Restore the count into a Number ( if it got converted earlier ) |
30 | 30 | var count = mw.language.convertNumber( template.title, true ); |
31 | 31 | // Do convertPlural call |
32 | | - return mw.language.convertPlural( parseInt( count ), template.parameters ); |
| 32 | + return mw.language.convertPlural( parseInt( count, 10 ), template.parameters ); |
33 | 33 | } |
34 | 34 | // Could not process plural return first form or nothing |
35 | 35 | if ( template.parameters[0] ) { |
— | — | @@ -47,7 +47,7 @@ |
48 | 48 | if ( !forms || forms.length == 0 ) { |
49 | 49 | return ''; |
50 | 50 | } |
51 | | - return ( parseInt( count ) == 1 ) ? forms[0] : forms[1]; |
| 51 | + return ( parseInt( count, 10 ) == 1 ) ? forms[0] : forms[1]; |
52 | 52 | }, |
53 | 53 | /** |
54 | 54 | * Pads an array to a specific length by copying the last one element. |
— | — | @@ -68,16 +68,16 @@ |
69 | 69 | * @param {number} number Value to be converted |
70 | 70 | * @param {boolean} integer Convert the return value to an integer |
71 | 71 | */ |
72 | | - 'convertNumber': function( number, integer ) { |
| 72 | + 'convertNumber': function( num, integer ) { |
73 | 73 | if ( !mw.language.digitTransformTable ) { |
74 | | - return number; |
| 74 | + return num; |
75 | 75 | } |
76 | 76 | // Set the target Transform table: |
77 | 77 | var transformTable = mw.language.digitTransformTable; |
78 | 78 | // Check if the "restore" to Latin number flag is set: |
79 | 79 | if ( integer ) { |
80 | | - if ( parseInt( number ) == number ) { |
81 | | - return number; |
| 80 | + if ( parseInt( num, 10 ) == num ) { |
| 81 | + return num; |
82 | 82 | } |
83 | 83 | var tmp = []; |
84 | 84 | for ( var i in transformTable ) { |
— | — | @@ -85,7 +85,7 @@ |
86 | 86 | } |
87 | 87 | transformTable = tmp; |
88 | 88 | } |
89 | | - var numberString = '' + number; |
| 89 | + var numberString = '' + num; |
90 | 90 | var convertedNumber = ''; |
91 | 91 | for ( var i = 0; i < numberString.length; i++ ) { |
92 | 92 | if ( transformTable[ numberString[i] ] ) { |
— | — | @@ -99,4 +99,4 @@ |
100 | 100 | // Digit Transform Table, populated by language classes where applicable |
101 | 101 | 'digitTransformTable': null |
102 | 102 | }; |
103 | | -} )( jQuery, mediaWiki ); |
\ No newline at end of file |
| 103 | +} )( jQuery, mediaWiki ); |