r107810 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r107809‎ | r107810 | r107811 >
Date:09:21, 2 January 2012
Author:santhosh
Status:ok
Tags:i18nreview 
Comment:
Use strict comparison for length property.
Follow up r107808
Modified paths:
  • /trunk/phase3/resources/mediawiki.language/mediawiki.language.js (modified) (history)

Diff [purge]

Index: trunk/phase3/resources/mediawiki.language/mediawiki.language.js
@@ -22,7 +22,7 @@
2323 'procPLURAL': function( template ) {
2424 if ( template.title && template.parameters && mw.language.convertPlural ) {
2525 // Check if we have forms to replace
26 - if ( template.parameters.length == 0 ) {
 26+ if ( template.parameters.length === 0 ) {
2727 return '';
2828 }
2929 // Restore the count into a Number ( if it got converted earlier )
@@ -44,7 +44,7 @@
4545 * @return string Correct form for quantifier in this language
4646 */
4747 'convertPlural': function( count, forms ){
48 - if ( !forms || forms.length == 0 ) {
 48+ if ( !forms || forms.length === 0 ) {
4949 return '';
5050 }
5151 return ( parseInt( count, 10 ) == 1 ) ? forms[0] : forms[1];
@@ -109,7 +109,7 @@
110110 * @return string
111111 */
112112 'gender': function( gender, forms ) {
113 - if ( !forms || forms.length == 0 ) {
 113+ if ( !forms || forms.length === 0 ) {
114114 return '';
115115 }
116116 forms = mw.language.preConvertPlural( forms, 2 );
@@ -119,7 +119,7 @@
120120 if ( gender === 'female' ) {
121121 return forms[1];
122122 }
123 - return ( forms.length == 3 ) ? forms[2] : forms[0];
 123+ return ( forms.length === 3 ) ? forms[2] : forms[0];
124124 },
125125
126126 // Digit Transform Table, populated by language classes where applicable

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r107808Add gender support. This method is useful only if we have parser that can und...santhosh09:08, 2 January 2012

Status & tagging log