From bf3cb61dcb9238efd0a85d886474364a3643bccb Mon Sep 17 00:00:00 2001 From: Sam Reed Date: Thu, 19 Jan 2012 16:44:49 +0000 Subject: [PATCH] * (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 --- includes/media/Generic.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) 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)"; -- 2.20.1