r113349 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r113348‎ | r113349 | r113350 >
Date:08:34, 8 March 2012
Author:santhosh
Status:resolved (Comments)
Tags:
Comment:
* Minor whitespace fix in mediawiki.language.js
* Use mw.language.getData in all language js files instead of directling accessing from mw.language.data based on the fixes in r112991
Modified paths:
  • /branches/jsgrammar/resources/mediawiki.language/languages/bs.js (modified) (history)
  • /branches/jsgrammar/resources/mediawiki.language/languages/dsb.js (modified) (history)
  • /branches/jsgrammar/resources/mediawiki.language/languages/fi.js (modified) (history)
  • /branches/jsgrammar/resources/mediawiki.language/languages/ga.js (modified) (history)
  • /branches/jsgrammar/resources/mediawiki.language/languages/he.js (modified) (history)
  • /branches/jsgrammar/resources/mediawiki.language/languages/hsb.js (modified) (history)
  • /branches/jsgrammar/resources/mediawiki.language/languages/hu.js (modified) (history)
  • /branches/jsgrammar/resources/mediawiki.language/languages/hy.js (modified) (history)
  • /branches/jsgrammar/resources/mediawiki.language/languages/la.js (modified) (history)
  • /branches/jsgrammar/resources/mediawiki.language/languages/os.js (modified) (history)
  • /branches/jsgrammar/resources/mediawiki.language/languages/ru.js (modified) (history)
  • /branches/jsgrammar/resources/mediawiki.language/languages/sl.js (modified) (history)
  • /branches/jsgrammar/resources/mediawiki.language/languages/uk.js (modified) (history)
  • /branches/jsgrammar/resources/mediawiki.language/mediawiki.language.js (modified) (history)

Diff [purge]

Index: branches/jsgrammar/resources/mediawiki.language/mediawiki.language.js
@@ -68,7 +68,7 @@
6969 procPLURAL: function ( template ) {
7070 var count;
7171
72 - if ( template.title && template.parameters ) {
 72+ if ( template.title && template.parameters ) {
7373 // Check if we have forms to replace
7474 if ( template.parameters.length === 0 ) {
7575 return '';
Index: branches/jsgrammar/resources/mediawiki.language/languages/bs.js
@@ -20,8 +20,9 @@
2121 };
2222
2323 mediaWiki.language.convertGrammar = function( word, form ) {
24 - var grammarForms = mw.language.data[ 'bs' ].get( 'grammarForms' );
 24+ var grammarForms = mw.language.getData( 'bs', 'grammarForms' );
2525 if ( grammarForms && grammarForms[form] ) {
 26+ if ( grammarForms && grammarForms[form] ) {
2627 return grammarForms[form][word] ;
2728 }
2829 switch ( form ) {
Index: branches/jsgrammar/resources/mediawiki.language/languages/dsb.js
@@ -18,7 +18,7 @@
1919 };
2020
2121 mediaWiki.language.convertGrammar = function( word, form ) {
22 - var grammarForms = mw.language.data[ 'dsb' ].get( 'grammarForms' );
 22+ var grammarForms = mw.language.getData( 'dsb', 'grammarForms' );
2323 if ( grammarForms && grammarForms[form] ) {
2424 return grammarForms[form][word] ;
2525 }
Index: branches/jsgrammar/resources/mediawiki.language/languages/hu.js
@@ -4,7 +4,7 @@
55 */
66
77 mediaWiki.language.convertGrammar = function( word, form ) {
8 - var grammarForms = mw.language.data[ 'hu' ].get( 'grammarForms' );
 8+ var grammarForms =mw.language.getData( 'hu', 'grammarForms' );
99 if ( grammarForms && grammarForms[form] ) {
1010 return grammarForms[form][word] ;
1111 }
Index: branches/jsgrammar/resources/mediawiki.language/languages/hsb.js
@@ -19,7 +19,7 @@
2020
2121
2222 mediaWiki.language.convertGrammar = function( word, form ) {
23 - var grammarForms = mw.language.data[ 'hsb' ].get( 'grammarForms' );
 23+ var grammarForms =mw.language.getData( 'hsb', 'grammarForms' );
2424 if ( grammarForms && grammarForms[form] ) {
2525 return grammarForms[form][word] ;
2626 }
Index: branches/jsgrammar/resources/mediawiki.language/languages/uk.js
@@ -23,7 +23,7 @@
2424 };
2525
2626 mediaWiki.language.convertGrammar = function( word, form ) {
27 - var grammarForms = mw.language.data[ 'uk' ].get( 'grammarForms' );
 27+ var grammarForms = mw.language.getData( 'uk', 'grammarForms' );
2828 if ( grammarForms && grammarForms[form] ) {
2929 return grammarForms[form][word] ;
3030 }
Index: branches/jsgrammar/resources/mediawiki.language/languages/hy.js
@@ -8,7 +8,7 @@
99 };
1010
1111 mediaWiki.language.convertGrammar = function( word, form ) {
12 - var grammarForms = mw.language.data[ 'hy' ].get( 'grammarForms' );
 12+ var grammarForms = mw.language.getData( 'hy', 'grammarForms' );
1313 if ( grammarForms && grammarForms[form] ) {
1414 return grammarForms[form][word] ;
1515 }
Index: branches/jsgrammar/resources/mediawiki.language/languages/os.js
@@ -5,7 +5,7 @@
66
77
88 mediaWiki.language.convertGrammar = function( word, form ) {
9 - var grammarForms = mw.language.data[ 'os' ].get( 'grammarForms' );
 9+ var grammarForms = mw.language.getData( 'os', 'grammarForms' );
1010 if ( grammarForms && grammarForms[form] ) {
1111 return grammarForms[form][word] ;
1212 }
Index: branches/jsgrammar/resources/mediawiki.language/languages/ru.js
@@ -23,7 +23,7 @@
2424 };
2525
2626 mediaWiki.language.convertGrammar = function( word, form ) {
27 - var grammarForms = mw.language.data[ 'ru' ].get( 'grammarForms' );
 27+ var grammarForms = mw.language.getData( 'ru', 'grammarForms' );
2828 if ( grammarForms && grammarForms[form] ) {
2929 return grammarForms[form][word] ;
3030 }
Index: branches/jsgrammar/resources/mediawiki.language/languages/sl.js
@@ -20,7 +20,7 @@
2121 };
2222
2323 mediaWiki.language.convertGrammar = function( word, form ) {
24 - var grammarForms = mw.language.data[ 'sl' ].get( 'grammarForms' );
 24+ var grammarForms = mw.language.getData( 'sl', 'grammarForms' );
2525 if ( grammarForms && grammarForms[form] ) {
2626 return grammarForms[form][word] ;
2727 }
Index: branches/jsgrammar/resources/mediawiki.language/languages/ga.js
@@ -15,7 +15,7 @@
1616
1717
1818 mediaWiki.language.convertGrammar = function( word, form ) {
19 - var grammarForms = mw.language.data[ 'ga' ].get( 'grammarForms' );
 19+ var grammarForms = mw.language.getData( 'ga', 'grammarForms' );
2020 if ( grammarForms && grammarForms[form] ) {
2121 return grammarForms[form][word] ;
2222 }
Index: branches/jsgrammar/resources/mediawiki.language/languages/la.js
@@ -4,7 +4,7 @@
55 */
66
77 mediaWiki.language.convertGrammar = function( word, form ) {
8 - var grammarForms = mw.language.data[ 'la' ].get( 'grammarForms' );
 8+ var grammarForms = mw.language.getData( 'la', 'grammarForms' );
99 if ( grammarForms && grammarForms[form] ) {
1010 return grammarForms[form][word] ;
1111 }
Index: branches/jsgrammar/resources/mediawiki.language/languages/he.js
@@ -14,7 +14,7 @@
1515 };
1616
1717 mediaWiki.language.convertGrammar = function( word, form ) {
18 - var grammarForms = mw.language.data[ 'he' ].get( 'grammarForms' );
 18+ var grammarForms = mw.language.getData( 'he', 'grammarForms' );
1919 if ( grammarForms && grammarForms[form] ) {
2020 return grammarForms[form][word] ;
2121 }
Index: branches/jsgrammar/resources/mediawiki.language/languages/fi.js
@@ -4,7 +4,7 @@
55 */
66
77 mediaWiki.language.convertGrammar = function( word, form ) {
8 - var grammarForms = mw.language.data[ 'fi' ].get( 'grammarForms' );
 8+ var grammarForms = mw.language.getData( 'fi', 'grammarForms' );
99 if ( grammarForms && grammarForms[form] ) {
1010 return grammarForms[form][word] ;
1111 }

Follow-up revisions

RevisionCommit summaryAuthorDate
r113354Remove duplicated line added in r113349 by mistake.santhosh10:18, 8 March 2012
r113355Whitespace fixes. Ping r113349santhosh10:20, 8 March 2012

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r112991[JSGrammar] Various minor tips, tricks and clean up....krinkle23:56, 4 March 2012

Comments

#Comment by Krinkle (talk | contribs)   10:10, 8 March 2012
-	var grammarForms = mw.language.data[ 'hu' ].get( 'grammarForms' );
+	var grammarForms =mw.language.getData( 'hu', 'grammarForms' );

-	var grammarForms = mw.language.data[ 'ru' ].get( 'grammarForms' );
+		var grammarForms = mw.language.getData( 'ru', 'grammarForms' );

minor whitespace and indention nag.

Index: branches/jsgrammar/resources/mediawiki.language/languages/bs.js
—	—	@@ -20,8 +20,9 @@
mediaWiki.language.convertGrammar = function( word, form ) {
-	var grammarForms = mw.language.data[ 'bs' ].get( 'grammarForms' );
+	var grammarForms = mw.language.getData( 'bs', 'grammarForms' );
	if ( grammarForms && grammarForms[form] ) {
+	if ( grammarForms && grammarForms[form] ) {
		return grammarForms[form][word] ;
	}
	switch ( form ) {

Duplicated if-statement, throwing exception SyntaxError: Unexpected end of input (marking fixme).

Status & tagging log