From 35d16afa2a69d39ff1cb94a57a190bc70b389fc0 Mon Sep 17 00:00:00 2001 From: Derk-Jan Hartman Date: Mon, 10 Jan 2011 22:18:08 +0000 Subject: [PATCH] Move the () surrounding description strings of files, out of the description and into the interface. Follows up r68324 and r68325 --- includes/ImagePage.php | 2 +- includes/media/GIF.php | 6 ++---- includes/media/Generic.php | 8 ++++---- includes/media/PNG.php | 6 ++---- includes/specials/SpecialSearch.php | 2 +- languages/messages/MessagesEn.php | 7 ++++--- languages/messages/MessagesQqq.php | 1 + maintenance/language/messages.inc | 1 + 8 files changed, 16 insertions(+), 17 deletions(-) diff --git a/includes/ImagePage.php b/includes/ImagePage.php index 311381850a..7c127d1bd5 100644 --- a/includes/ImagePage.php +++ b/includes/ImagePage.php @@ -330,7 +330,7 @@ class ImagePage extends Article { $height_orig = $this->displayImg->getHeight( $page ); $height = $height_orig; - $longDesc = $this->displayImg->getLongDesc(); + $longDesc = wfMsgExt( 'file-info-wrapper', 'parseinline', $this->displayImg->getLongDesc() ); wfRunHooks( 'ImageOpenShowImageInlineBefore', array( &$this, &$wgOut ) ); diff --git a/includes/media/GIF.php b/includes/media/GIF.php index c4c8056ade..4e53d10983 100644 --- a/includes/media/GIF.php +++ b/includes/media/GIF.php @@ -76,7 +76,7 @@ class GIFHandler extends BitmapHandler { /* Preserve original image info string, but strip the last char ')' so we can add even more */ $info = array(); - $info[] = substr( $original, 1, strlen( $original )-2 ); + $info[] = $original; if ($metadata['looped']) $info[] = wfMsgExt( 'file-info-gif-looped', 'parseinline' ); @@ -87,8 +87,6 @@ class GIFHandler extends BitmapHandler { if ($metadata['duration']) $info[] = $wgLang->formatTimePeriod( $metadata['duration'] ); - $infoString = $wgLang->commaList( $info ); - - return "($infoString)"; + return $wgLang->commaList( $info ); } } diff --git a/includes/media/Generic.php b/includes/media/Generic.php index 92f03045c3..cf69a01987 100644 --- a/includes/media/Generic.php +++ b/includes/media/Generic.php @@ -240,8 +240,8 @@ abstract class MediaHandler { function getShortDesc( $file ) { global $wgLang; - $nbytes = '(' . wfMsgExt( 'nbytes', array( 'parsemag', 'escape' ), - $wgLang->formatNum( $file->getSize() ) ) . ')'; + $nbytes = wfMsgExt( 'nbytes', array( 'parsemag', 'escape' ), + $wgLang->formatNum( $file->getSize() ) ); return "$nbytes"; } @@ -255,8 +255,8 @@ abstract class MediaHandler { static function getGeneralShortDesc( $file ) { global $wgLang; - $nbytes = '(' . wfMsgExt( 'nbytes', array( 'parsemag', 'escape' ), - $wgLang->formatNum( $file->getSize() ) ) . ')'; + $nbytes = wfMsgExt( 'nbytes', array( 'parsemag', 'escape' ), + $wgLang->formatNum( $file->getSize() ) ); return "$nbytes"; } diff --git a/includes/media/PNG.php b/includes/media/PNG.php index 0a7fc32da3..5197282c03 100644 --- a/includes/media/PNG.php +++ b/includes/media/PNG.php @@ -63,7 +63,7 @@ class PNGHandler extends BitmapHandler { return $original; $info = array(); - $info[] = substr( $original, 1, strlen( $original )-2 ); + $info[] = $original; if ($metadata['loopCount'] == 0) $info[] = wfMsgExt( 'file-info-png-looped', 'parseinline' ); @@ -76,9 +76,7 @@ class PNGHandler extends BitmapHandler { if ($metadata['duration']) $info[] = $wgLang->formatTimePeriod( $metadata['duration'] ); - $infoString = $wgLang->commaList( $info ); - - return "($infoString)"; + return $wgLang->commaList( $info ); } } diff --git a/includes/specials/SpecialSearch.php b/includes/specials/SpecialSearch.php index fafcf0df96..7f5b7f113e 100644 --- a/includes/specials/SpecialSearch.php +++ b/includes/specials/SpecialSearch.php @@ -594,7 +594,7 @@ class SpecialSearch extends SpecialPage { if( $img ) { $thumb = $img->transform( array( 'width' => 120, 'height' => 120 ) ); if( $thumb ) { - $desc = $img->getShortDesc(); + $desc = wfMsgExt( 'file-info-wrapper', 'parseinline', $img->getShortDesc() ); wfProfileOut( __METHOD__ ); // Float doesn't seem to interact well with the bullets. // Table messes up vertical alignment of the bullets. diff --git a/languages/messages/MessagesEn.php b/languages/messages/MessagesEn.php index 5b18fe4f42..dd6f7c142d 100644 --- a/languages/messages/MessagesEn.php +++ b/languages/messages/MessagesEn.php @@ -3602,10 +3602,11 @@ By executing it, your system may be compromised.", 'thumbsize' => 'Thumbnail size:', 'widthheight' => '$1×$2', # only translate this message to other languages if you have to change it 'widthheightpage' => '$1×$2, $3 {{PLURAL:$3|page|pages}}', -'file-info' => '(file size: $1, MIME type: $2)', -'file-info-size' => '($1 × $2 pixels, file size: $3, MIME type: $4)', +'file-info' => 'file size: $1, MIME type: $2', +'file-info-size' => '$1 × $2 pixels, file size: $3, MIME type: $4', +'file-info-wrapper' => '($1)', 'file-nohires' => 'No higher resolution available.', -'svg-long-desc' => '(SVG file, nominally $1 × $2 pixels, file size: $3)', +'svg-long-desc' => 'SVG file, nominally $1 × $2 pixels, file size: $3', 'show-big-image' => 'Full resolution', 'show-big-image-thumb' => 'Size of this preview: $1 × $2 pixels', 'file-info-gif-looped' => 'looped', diff --git a/languages/messages/MessagesQqq.php b/languages/messages/MessagesQqq.php index a82be331ac..9dffc46782 100644 --- a/languages/messages/MessagesQqq.php +++ b/languages/messages/MessagesQqq.php @@ -3059,6 +3059,7 @@ The message appears after the name of the patroller.', 'widthheightpage' => 'This message is used on image pages in the dimensions column in the file history section for images with more than one page. Parameter $1 is the image width (in pixels), parameter $2 is the image height, and parameter $3 is the number of pages.', 'file-info' => 'File info displayed on file description page.', 'file-info-size' => 'File info displayed on file description page.', +'file-info-wrapper' => 'Surrounds file info descriptions', 'file-nohires' => 'File info displayed on file description page. For example of message in use see [[:File:Mouse10.gif]].', 'svg-long-desc' => 'Displayed under an SVG image at the image description page. Note that argument 3 is a string that includes the file size unit symbol. See for example [[:File:Yes check.svg]].', 'show-big-image' => 'Displayed under an image at the image description page, when it is displayed smaller there than it was uploaded.', diff --git a/maintenance/language/messages.inc b/maintenance/language/messages.inc index e7d891a9d8..30a89960f5 100644 --- a/maintenance/language/messages.inc +++ b/maintenance/language/messages.inc @@ -2560,6 +2560,7 @@ $wgMessageStructure = array( 'widthheightpage', 'file-info', 'file-info-size', + 'file-info-wrapper', 'file-nohires', 'svg-long-desc', 'show-big-image', -- 2.20.1