From: Sam Reed Date: Thu, 19 Jan 2012 16:44:49 +0000 (+0000) Subject: * (bug 33819) Display filesize on Special:NewFiles in appropriate unit. X-Git-Tag: 1.31.0-rc.0~25179 X-Git-Url: http://git.cyclocoop.org/%22.%24image2.%22?a=commitdiff_plain;h=bf3cb61dcb9238efd0a85d886474364a3643bccb;p=lhc%2Fweb%2Fwiklou.git * (bug 33819) Display filesize on Special:NewFiles in appropriate unit. Do the same for the rest of the file usages of 'nbytes' in Generic.php --- diff --git a/includes/media/Generic.php b/includes/media/Generic.php index 5c1640522f..d87c1cffaf 100644 --- a/includes/media/Generic.php +++ b/includes/media/Generic.php @@ -404,7 +404,8 @@ abstract class MediaHandler { * @return string */ function getShortDesc( $file ) { - return wfMessage( 'nbytes' )->numParams( $file->getSize() )->escaped(); + global $wgLang; + return $wgLang->formatSize( $file->getSize() ); } /** @@ -422,7 +423,8 @@ abstract class MediaHandler { * @return string */ static function getGeneralShortDesc( $file ) { - return wfMessage( 'nbytes' )->numParams( $file->getSize() )->escaped(); + global $wgLang; + return $wgLang->formatSize( $file->getSize() ); } /** @@ -707,7 +709,8 @@ abstract class ImageHandler extends MediaHandler { * @return string */ function getShortDesc( $file ) { - $nbytes = wfMessage( 'nbytes' )->numParams( $file->getSize() )->escaped(); + global $wgLang; + $nbytes = $wgLang->formatSize( $file->getSize() ); $widthheight = wfMessage( 'widthheight' )->numParams( $file->getWidth(), $file->getHeight() )->escaped(); return "$widthheight ($nbytes)";