From: Siebrand Mazeland Date: Tue, 28 Feb 2012 11:56:59 +0000 (+0000) Subject: (bug 34702) More localised parentheses. Patch contributed by Yusuke Matsubara. X-Git-Tag: 1.31.0-rc.0~24470 X-Git-Url: http://git.cyclocoop.org/%22%20.%20generer_url_ecrire%28%22articles%22%2C%22id_article=%24ze_article%22%29%20.%20%22?a=commitdiff_plain;h=481943429ec82e7355930b90389df330e9335607;p=lhc%2Fweb%2Fwiklou.git (bug 34702) More localised parentheses. Patch contributed by Yusuke Matsubara. --- diff --git a/CREDITS b/CREDITS index b35f927bf7..90272e960a 100644 --- a/CREDITS +++ b/CREDITS @@ -184,6 +184,7 @@ following names for their contribution to the product. * Ville Stadista * Vitaliy Filippov * William Demchick +* Yusuke Matsubara * Yuvaraj Pandian T * Zachary Hauri diff --git a/includes/ChangesList.php b/includes/ChangesList.php index 686ee092aa..3966e30fb2 100644 --- a/includes/ChangesList.php +++ b/includes/ChangesList.php @@ -252,7 +252,7 @@ class ChangesList extends ContextSource { public function insertLog( &$s, $title, $logtype ) { $page = new LogPage( $logtype ); $logname = $page->getName()->escaped(); - $s .= '(' . Linker::linkKnown( $title, $logname ) . ')'; + $s .= $this->msg( 'parentheses' )->rawParams( Linker::linkKnown( $title, $logname ) )->escaped(); } /** @@ -284,9 +284,9 @@ class ChangesList extends ContextSource { $query ); } - $s .= '(' . $diffLink . $this->message['pipe-separator']; + $diffhist = $diffLink . $this->message['pipe-separator']; # History link - $s .= Linker::linkKnown( + $diffhist .= Linker::linkKnown( $rc->getTitle(), $this->message['hist'], array(), @@ -295,7 +295,7 @@ class ChangesList extends ContextSource { 'action' => 'history' ) ); - $s .= ') . . '; + $s .= $this->msg( 'parentheses' )->rawParams( $diffhist )->escaped() . ' . . '; } /** @@ -679,7 +679,7 @@ class EnhancedChangesList extends ChangesList { $logtitle = SpecialPage::getTitleFor( 'Log', $logType ); $logpage = new LogPage( $logType ); $logname = $logpage->getName()->escaped(); - $clink = '(' . Linker::linkKnown( $logtitle, $logname ) . ')'; + $clink = $this->msg( 'parentheses' )->rawParams( Linker::linkKnown( $logtitle, $logname ) )->escaped(); } else { $clink = Linker::link( $rc->getTitle() ); } @@ -852,7 +852,7 @@ class EnhancedChangesList extends ChangesList { $text = $userlink; $text .= $this->getLanguage()->getDirMark(); if( $count > 1 ) { - $text .= ' (' . $this->getLanguage()->formatNum( $count ) . '×)'; + $text .= ' ' . $this->msg( 'parentheses' )->rawParams( $this->getLanguage()->formatNum( $count ) . '×' )->escaped(); } array_push( $users, $text ); } @@ -894,18 +894,18 @@ class EnhancedChangesList extends ChangesList { } # Total change link $r .= ' '; + $logtext = ''; if( !$allLogs ) { - $r .= '('; if( !ChangesList::userCan( $rcObj, Revision::DELETED_TEXT, $this->getUser() ) ) { - $r .= $nchanges[$n]; + $logtext .= $nchanges[$n]; } elseif( $isnew ) { - $r .= $nchanges[$n]; + $logtext .= $nchanges[$n]; } else { $params = $queryParams; $params['diff'] = $currentRevision; $params['oldid'] = $oldid; - $r .= Linker::link( + $logtext .= Linker::link( $block[0]->getTitle(), $nchanges[$n], array(), @@ -919,19 +919,24 @@ class EnhancedChangesList extends ChangesList { if( $allLogs ) { // don't show history link for logs } elseif( $namehidden || !$block[0]->getTitle()->exists() ) { - $r .= $this->message['pipe-separator'] . $this->message['hist'] . ')'; + $logtext .= $this->message['pipe-separator'] . $this->message['hist']; } else { $params = $queryParams; $params['action'] = 'history'; - $r .= $this->message['pipe-separator'] . + $logtext .= $this->message['pipe-separator'] . Linker::linkKnown( $block[0]->getTitle(), $this->message['hist'], array(), $params - ) . ')'; + ); + } + + if( $logtext != '' ) { + $r .= $this->msg( 'parentheses' )->rawParams( $logtext )->escaped(); } + $r .= ' . . '; # Character difference (does not apply if only log items) @@ -1003,11 +1008,7 @@ class EnhancedChangesList extends ChangesList { $r .= $link . ''; if ( !$type == RC_LOG || $type == RC_NEW ) { - $r .= ' ('; - $r .= $rcObj->curlink; - $r .= $this->message['pipe-separator']; - $r .= $rcObj->lastlink; - $r .= ')'; + $r .= $this->msg( 'parentheses' )->rawParams( $rcObj->curlink . $this->message['pipe-separator'] . $rcObj->lastlink )->escaped(); } $r .= ' . . '; @@ -1126,20 +1127,19 @@ class EnhancedChangesList extends ChangesList { if( $logType ) { $logtitle = SpecialPage::getTitleFor( 'Log', $logType ); $logname = LogPage::logName( $logType ); - $r .= '(' . Linker::linkKnown( $logtitle, htmlspecialchars( $logname ) ) . ')'; + $r .= $this->msg( 'parentheses' )->rawParams( Linker::linkKnown( $logtitle, htmlspecialchars( $logname ) ) )->escaped(); } else { $this->insertArticleLink( $r, $rcObj, $rcObj->unpatrolled, $rcObj->watched ); } # Diff and hist links if ( $type != RC_LOG ) { - $r .= ' ('. $rcObj->difflink . $this->message['pipe-separator']; $query['action'] = 'history'; - $r .= Linker::linkKnown( + $r .= $this->msg( 'parentheses' )->rawParams( $rcObj->difflink . $this->message['pipe-separator'] . Linker::linkKnown( $rcObj->getTitle(), $this->message['hist'], array(), $query - ) . ')'; + ) )->escaped(); } $r .= ' . . '; # Character diff diff --git a/includes/Linker.php b/includes/Linker.php index 8bea052d90..917f438c09 100644 --- a/includes/Linker.php +++ b/includes/Linker.php @@ -995,7 +995,7 @@ class Linker { wfRunHooks( 'UserToolLinksEdit', array( $userId, $userText, &$items ) ); if ( $items ) { - return ' (' . $wgLang->pipeList( $items ) . ')'; + return ' ' . wfMessage( 'parentheses' )->rawParams( $wgLang->pipeList( $items ) )->escaped() . ''; } else { return ''; } diff --git a/includes/actions/HistoryAction.php b/includes/actions/HistoryAction.php index 4bdaebbf63..4c57e03fce 100644 --- a/includes/actions/HistoryAction.php +++ b/includes/actions/HistoryAction.php @@ -523,7 +523,7 @@ class HistoryPager extends ReverseChronologicalPager { $histLinks = Html::rawElement( 'span', array( 'class' => 'mw-history-histlinks' ), - '(' . $curlink . $this->historyPage->message['pipe-separator'] . $lastlink . ') ' + $this->msg( 'parentheses' )->rawParams( $curlink . $this->historyPage->message['pipe-separator'] . $lastlink )->escaped() ); $s = $histLinks . $diffButtons; @@ -619,7 +619,7 @@ class HistoryPager extends ReverseChronologicalPager { } if ( $tools ) { - $s .= ' (' . $lang->pipeList( $tools ) . ')'; + $s .= $this->msg( 'parentheses' )->rawParams( $lang->pipeList( $tools ) )->escaped(); } # Tags