r64872 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r64871‎ | r64872 | r64873 >
Date:12:16, 10 April 2010
Author:raymond
Status:ok
Tags:
Comment:
* Add formatNum for proper localisation
* Align numbers right
Modified paths:
  • /trunk/extensions/CentralAuth/SpecialCentralAuth.php (modified) (history)

Diff [purge]

Index: trunk/extensions/CentralAuth/SpecialCentralAuth.php
@@ -246,6 +246,7 @@
247247 }
248248
249249 function prettyTimespan( $span ) {
 250+ global $wgLang;
250251 $units = array(
251252 'seconds' => 60,
252253 'minutes' => 60,
@@ -254,10 +255,13 @@
255256 'months' => 12,
256257 'years' => 1 );
257258 foreach( $units as $unit => $chunk ) {
 259+ // Used messaged (to make sure that grep finds them):
 260+ // 'centralauth-seconds-ago', 'centralauth-minutes-ago', 'centralauth-hours-ago'
 261+ // 'centralauth-days-ago', 'centralauth-months-ago', 'centralauth-years-ago'
258262 if( $span < 2*$chunk ) {
259 - return wfMsgExt( "centralauth-$unit-ago", 'parsemag', $span );
 263+ return wfMsgExt( "centralauth-$unit-ago", 'parsemag', $wgLang->formatNum( $span ) );
260264 }
261 - $span = intval( $span / $chunk );
 265+ $span = $wgLang->formatNum( intval( $span / $chunk ) );
262266 }
263267 return wfMsgExt( "centralauth-$unit-ago", 'parsemag', $span );
264268 }
@@ -272,7 +276,7 @@
273277 'id' => $globalUser->getId(),
274278 'registered' => $wgLang->timeanddate( $reg ) . " ($age)",
275279 'home' => $this->determineHomeWiki(),
276 - 'editcount' => $this->evaluateTotalEditcount(),
 280+ 'editcount' => $wgLang->formatNum( $this->evaluateTotalEditcount() ),
277281 'locked' => $globalUser->isLocked() ? wfMsg( 'centralauth-admin-yes' ) : wfMsg( 'centralauth-admin-no' ),
278282 'hidden' => $this->formatHiddenLevel( $globalUser->getHiddenLevel() ) );
279283 $out = '<fieldset id="mw-centralauth-info">';
@@ -366,7 +370,7 @@
367371 '<td>' . htmlspecialchars( $wgLang->timeanddate( $row['attachedTimestamp'] ) ) . '</td>' .
368372 '<td style="text-align: center">' . $this->formatMergeMethod( $row['attachedMethod'] ) . '</td>' .
369373 '<td>' . $this->formatBlockStatus( $row ) . '</td>' .
370 - '<td>' . $this->formatEditcount( $row ) . '</td>' .
 374+ '<td style="text-align: right">' . $this->formatEditcount( $row ) . '</td>' .
371375 '</tr>';
372376 }
373377
@@ -406,10 +410,11 @@
407411 }
408412
409413 function formatEditcount( $row ) {
 414+ global $wgLang;
410415 return $this->foreignLink(
411416 $row['wiki'],
412417 'Special:Contributions/' . $this->mUserName,
413 - intval( $row['editCount'] ),
 418+ $wgLang->formatNum( intval( $row['editCount'] ) ),
414419 'contributions' );
415420 }
416421

Follow-up revisions

RevisionCommit summaryAuthorDate
r82386Bug 27430 - Special:CentralAuth shouldn't use always minutes:...raymond09:55, 18 February 2011

Status & tagging log