r57776 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r57775‎ | r57776 | r57777 >
Date:16:48, 15 October 2009
Author:siebrand
Status:ok
Tags:
Comment:
* actual plural support for 'proofreadpage_pages'
* remove unused global $wgContLang
* remove superfluous newlines and trailing whitespace
Modified paths:
  • /trunk/extensions/ProofreadPage/SpecialProofreadPages.php (modified) (history)

Diff [purge]

Index: trunk/extensions/ProofreadPage/SpecialProofreadPages.php
@@ -46,7 +46,7 @@
4747 if ( preg_match( "/^$index_namespace:(.*)$/", $result->getTitle(), $m ) ) {
4848 array_push( $searchList, str_replace( ' ' , '_' , $m[1] ) );
4949 }
50 - }
 50+ }
5151 }
5252 }
5353 $cnl = new ProofreadPagesQuery( $searchList );
@@ -54,10 +54,7 @@
5555 }
5656 }
5757
58 -
59 -
6058 class ProofreadPagesQuery extends QueryPage {
61 -
6259 function ProofreadPagesQuery( $searchList ) {
6360 $this->searchList = $searchList;
6461 }
@@ -109,7 +106,7 @@
110107 }
111108
112109 function formatResult( $skin, $result ) {
113 - global $wgLang, $wgContLang;
 110+ global $wgLang;
114111
115112 $index_namespace = pr_index_ns();
116113 $title = Title::newFromText( $index_namespace.":".$result->title );
@@ -133,9 +130,11 @@
134131 $q4 = $result->pr_q4;
135132 $num_void = $size-$q1-$q2-$q3-$q4-$q0;
136133 $void_cell = $num_void ? "<td align=center style='border-style:dotted;background:#ffffff;border-width:1px;' width=\"{$num_void}\"></td>" : "";
137 -
138 - $pages = wfMsg( 'proofreadpage_pages', $size );
139134
 135+ // FIXME: consider using $size in 'proofreadpage_pages' instead of glueing it together in $output
 136+ $pages = wfMsgExt( 'proofreadpage_pages', 'parsemag', $size );
 137+ $size = $wgLang->formatNum( $size );
 138+
140139 $output = "<table style=\"line-height:70%;\" border=0 cellpadding=5 cellspacing=0 >
141140 <tr valign=\"bottom\">
142141 <td style=\"white-space:nowrap;overflow:hidden;\">{$plink} [$size $pages]</td>
@@ -153,6 +152,6 @@
154153 </td>
155154 </tr></table>";
156155
157 - return $output;
 156+ return $output;
158157 }
159158 }

Status & tagging log