r48721 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r48720‎ | r48721 | r48722 >
Date:22:47, 23 March 2009
Author:siebrand
Status:deferred
Tags:
Comment:
Localise number and percentage formatting
Modified paths:
  • /trunk/extensions/Translate/SpecialLanguageStats.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Translate/SpecialLanguageStats.php
@@ -170,7 +170,7 @@
171171 * @return string HTML
172172 */
173173 function getGroupStats( $code, $suppressComplete = false ) {
174 - global $wgUser;
 174+ global $wgUser, $wgLang;
175175
176176 $out = '';
177177
@@ -221,8 +221,8 @@
222222 continue;
223223 }
224224
225 - $translatedPercentage = @sprintf( '%.2f%%', 100 * $translated / $total );
226 - $fuzzyPercentage = @sprintf( '%.2f%%', 100 * $fuzzy / $total );
 225+ $translatedPercentage = wfMsg( 'percent', $wgLang->formatNum( round( 100 * $translated / $total, 2 ) ) );
 226+ $fuzzyPercentage = wfMsg( 'percent', $wgLang->formatNum( round( 100 * $fuzzy / $total ) ) );
227227
228228 $translateTitle = SpecialPage::getTitleFor( 'Translate' );
229229 $pageParameters = "group=" . $g->getId() . "&language=" . $code;

Status & tagging log