* (bug 33819) Display filesize on Special:NewFiles in appropriate unit.
authorSam Reed <reedy@users.mediawiki.org>
Thu, 19 Jan 2012 16:44:49 +0000 (16:44 +0000)
committerSam Reed <reedy@users.mediawiki.org>
Thu, 19 Jan 2012 16:44:49 +0000 (16:44 +0000)
Do the same for the rest of the file usages of 'nbytes' in Generic.php

includes/media/Generic.php

index 5c16405..d87c1cf 100644 (file)
@@ -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)";