Embrace comment with () only when really needed. In Special:ListFiles and ImagePage...
authorRaimond Spekking <raymond@users.mediawiki.org>
Sat, 23 Apr 2011 13:23:08 +0000 (13:23 +0000)
committerRaimond Spekking <raymond@users.mediawiki.org>
Sat, 23 Apr 2011 13:23:08 +0000 (13:23 +0000)
includes/ImagePage.php
includes/Linker.php
includes/specials/SpecialListfiles.php

index ad3a5a7..6d4aedf 100644 (file)
@@ -1097,7 +1097,7 @@ class ImageHistoryList {
                if ( $file->isDeleted( File::DELETED_COMMENT ) ) {
                        $row .= '<span class="history-deleted">' . wfMsgHtml( 'rev-deleted-comment' ) . '</span>';
                } else {
-                       $row .= $this->skin->commentBlock( $description, $this->title );
+                       $row .= $this->skin->commentBlock( $description, $this->title, false, false );
                }
                $row .= '</td>';
 
index 7c9031a..b430db1 100644 (file)
@@ -1292,10 +1292,10 @@ class Linker {
         * @param $comment String
         * @param $title Mixed: Title object (to generate link to section in autocomment) or null
         * @param $local Boolean: whether section links should refer to local page
-        *
+        * @param $embraced Boolean: whether the formatted comment should be embraced with ()
         * @return string
         */
-       static function commentBlock( $comment, $title = null, $local = false ) {
+       static function commentBlock( $comment, $title = null, $local = false, $embraced = true ) {
                // '*' used to be the comment inserted by the software way back
                // in antiquity in case none was provided, here for backwards
                // compatability, acc. to brion -ævar
@@ -1303,7 +1303,10 @@ class Linker {
                        return '';
                } else {
                        $formatted = self::formatComment( $comment, $title, $local );
-                       return " <span class=\"comment\">($formatted)</span>";
+                       if ( $embraced ) {
+                               $formatted = wfMessage( 'parentheses', $formatted );
+                       } 
+                       return Html::rawElement( 'span', array( 'class' => 'comment' ), $formatted );
                }
        }
 
index 9bc38cd..ca6e8aa 100644 (file)
@@ -215,7 +215,7 @@ class ImageListPager extends TablePager {
                        case 'img_size':
                                return $this->getSkin()->formatSize( $value );
                        case 'img_description':
-                               return $this->getSkin()->commentBlock( $value );
+                               return $this->getSkin()->commentBlock( $value, null, false, false );
                        case 'count':
                                return intval($value)+1;
                }