r44761 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r44760‎ | r44761 | r44762 >
Date:09:57, 18 December 2008
Author:raymond
Status:ok
Tags:
Comment:
* Localize some more text
* Use formatnum
* Introduce an own special page group for contribution
Modified paths:
  • /trunk/extensions/ContributionReporting/ContributionReporting.i18n.php (modified) (history)
  • /trunk/extensions/ContributionReporting/ContributionReporting.php (modified) (history)
  • /trunk/extensions/ContributionReporting/ContributionStatistics_body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/ContributionReporting/ContributionReporting.php
@@ -38,6 +38,10 @@
3939 $wgSpecialPages['ContributionTotal'] = 'ContributionTotal';
4040 $wgSpecialPages['ContributionStatistics'] = 'SpecialContributionStatistics';
4141 $wgSpecialPages['FundraiserStatistics'] = 'SpecialFundraiserStatistics';
 42+$wgSpecialPageGroups['ContributionHistory'] = 'contribution';
 43+$wgSpecialPageGroups['ContributionTotal'] = 'contribution';
 44+$wgSpecialPageGroups['ContributionStatistics'] = 'contribution';
 45+$wgSpecialPageGroups['FundraiserStatistics'] = 'contribution';
4246
4347 // Shortcut to this extension directory
4448 $dir = dirname( __FILE__ ) . '/';
Index: trunk/extensions/ContributionReporting/ContributionReporting.i18n.php
@@ -49,7 +49,12 @@
5050 'contribstats-max' => 'Maximum (USD)',
5151 'contribstats-percentage-ytd' => 'Percentage (YTD)',
5252 'contribstats-total-ytd' => 'Total (YTD)',
53 -
 53+ 'contribstats-value-exactly' => 'Exactly $1',
 54+ 'contribstats-value-under' => 'Under $1',
 55+ 'contribstats-value-from' => 'From $1 - $2',
 56+ 'contribstats-value-over' => 'Over $1',
 57+ 'contribstats-percentage' => '$1%',
 58+
5459 // Fundraiser statistics
5560 'fundraiserstatistics' => 'Fundraiser statistics',
5661 'fundraiserstats-date' => 'Date',
@@ -63,6 +68,8 @@
6469 'fundraiserstats-tab-contributions' => 'Number of contributions',
6570 'fundraiserstats-tab-averages' => 'Averages (USD)',
6671 'fundraiserstats-tab-maximums' => 'Maximums (USD)',
 72+
 73+ 'specialpages-group-contribution' => 'Contributions/Fundraiser',
6774 );
6875
6976 /** Message documentation (Message documentation)
Index: trunk/extensions/ContributionReporting/ContributionStatistics_body.php
@@ -244,12 +244,12 @@
245245 $factor = $numContributions > 0 ? 100.0 / $numContributions : 0;
246246
247247 $list = array(
248 - 'Exactly 30.00' => array( 30 ),
249 - 'Exactly 75.00' => array( 75 ),
250 - 'Exactly 100.00' => array( 100 ),
251 - 'Under 99.00' => array( 0, 99.99 ),
252 - 'From 100.00 - 999.99' => array( 100, 999.99 ),
253 - 'Over 1000.00' => array( 1000, 999999999999.99 ),
 248+ wfMsg( 'contribstats-value-exactly', $wgLang->formatNum( 30 ) ) => array( 30 ),
 249+ wfMsg( 'contribstats-value-exactly', $wgLang->formatNum( 75 ) ) => array( 75 ),
 250+ wfMsg( 'contribstats-value-exactly', $wgLang->formatNum( 100 ) ) => array( 100 ),
 251+ wfMsg( 'contribstats-value-under', $wgLang->formatNum( 99.99 ) ) => array( 0, 99.99 ),
 252+ wfMsg( 'contribstats-value-from', $wgLang->formatNum( 100 ), $wgLang->formatNum( 999.99 ) ) => array( 100, 999.99 ),
 253+ wfMsg( 'contribstats-value-over', $wgLang->formatNum( 1000 ) ) => array( 1000, 999999999999.99 ),
254254 );
255255 foreach( $list as $label => $range ) {
256256 $data = array();
@@ -260,9 +260,12 @@
261261 }
262262 $htmlOut .= Xml::tags( 'tr', null,
263263 Xml::element( 'td', array( 'align' => 'left' ), $label ) .
264 - Xml::element( 'td', array( 'align' => 'right' ), $data[0] ) .
265 - Xml::element( 'td', array( 'align' => 'right' ), round( $data[0] * $factor, 2 ) . '%' ) .
266 - Xml::element( 'td', array( 'align' => 'right' ), isset( $range[1] ) ? round( $data[1], 2 ) : '-' )
 264+ Xml::element( 'td', array( 'align' => 'right' ),
 265+ $wgLang->formatNum( $data[0] ) ) .
 266+ Xml::element( 'td', array( 'align' => 'right' ),
 267+ wfMsg( 'contribstats-percentage', $wgLang->formatNum( round( $data[0] * $factor, 2 ) ) ) ) .
 268+ Xml::element( 'td', array( 'align' => 'right' ),
 269+ isset( $range[1] ) ? $wgLang->formatNum( round( $data[1], 2 ) ) : '-' )
267270 );
268271 }
269272

Follow-up revisions

RevisionCommit summaryAuthorDate
r44762Follow up r44761: Make message optionalraymond09:59, 18 December 2008

Status & tagging log