r77571 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r77570‎ | r77571 | r77572 >
Date:10:40, 2 December 2010
Author:raymond
Status:ok
Tags:
Comment:
Use 'parentheses' message instead of hardcoded ()
Paranoia: Apply formatNum on raw number. Add the 'percent' character afterwards
Modified paths:
  • /trunk/extensions/FlaggedRevs/specialpages/ValidationStatistics_body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/FlaggedRevs/specialpages/ValidationStatistics_body.php
@@ -96,18 +96,22 @@
9797
9898 $percRev = intval( $row->total ) == 0
9999 ? '-' // devision by zero
100 - : $wgLang->formatnum( wfMsgExt( 'percent', array( 'escapenoentities' ),
101 - sprintf( '%4.2f', 100 * intval( $row->reviewed ) / intval( $row->total ) ) )
 100+ : wfMsg( 'parentheses',
 101+ wfMsgExt( 'percent', array( 'escapenoentities' ),
 102+ $wgLang->formatnum( sprintf( '%4.2f', 100 * intval( $row->reviewed ) / intval( $row->total ) ) )
 103+ )
102104 );
103105 $percLatest = intval( $row->total ) == 0
104106 ? '-' // devision by zero
105 - : $wgLang->formatnum( wfMsgExt( 'percent', array( 'escapenoentities' ),
106 - sprintf( '%4.2f', 100 * intval( $row->synced ) / intval( $row->total ) ) )
 107+ : wfMsg( 'parentheses',
 108+ wfMsgExt( 'percent', array( 'escapenoentities' ),
 109+ $wgLang->formatnum( sprintf( '%4.2f', 100 * intval( $row->synced ) / intval( $row->total ) ) )
 110+ )
107111 );
108112 $percSynced = intval( $row->reviewed ) == 0
109113 ? '-' // devision by zero
110 - : $wgLang->formatnum( wfMsgExt( 'percent', array( 'escapenoentities' ),
111 - sprintf( '%4.2f', 100 * intval( $row->synced ) / intval( $row->reviewed ) ) )
 114+ : wfMsgExt( 'percent', array( 'escapenoentities' ),
 115+ $wgLang->formatnum( sprintf( '%4.2f', 100 * intval( $row->synced ) / intval( $row->reviewed ) ) )
112116 );
113117 $outdated = intval( $row->reviewed ) - intval( $row->synced );
114118 $outdated = $wgLang->formatnum( max( 0, $outdated ) ); // lag between queries
@@ -122,11 +126,11 @@
123127 "</td>
124128 <td>" .
125129 htmlspecialchars( $wgLang->formatnum( $row->reviewed ) .
126 - $wgContLang->getDirMark() ) . " <i>($percRev)</i>
 130+ $wgContLang->getDirMark() ) . " <i>$percRev</i>
127131 </td>
128132 <td>" .
129133 htmlspecialchars( $wgLang->formatnum( $row->synced ) .
130 - $wgContLang->getDirMark() ) . " <i>($percLatest)</i>
 134+ $wgContLang->getDirMark() ) . " <i>$percLatest</i>
131135 </td>
132136 <td>" .
133137 $percSynced .

Status & tagging log