r112589 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r112588‎ | r112589 | r112590 >
Date:11:56, 28 February 2012
Author:siebrand
Status:resolved
Tags:i18nreview 
Comment:
(bug 34702) More localised parentheses. Patch contributed by Yusuke Matsubara.
Modified paths:
  • /trunk/phase3/CREDITS (modified) (history)
  • /trunk/phase3/includes/ChangesList.php (modified) (history)
  • /trunk/phase3/includes/Linker.php (modified) (history)
  • /trunk/phase3/includes/actions/HistoryAction.php (modified) (history)

Diff [purge]

Index: trunk/phase3/CREDITS
@@ -184,6 +184,7 @@
185185 * Ville Stadista
186186 * Vitaliy Filippov
187187 * William Demchick
 188+* Yusuke Matsubara
188189 * Yuvaraj Pandian T
189190 * Zachary Hauri
190191
Index: trunk/phase3/includes/Linker.php
@@ -995,7 +995,7 @@
996996 wfRunHooks( 'UserToolLinksEdit', array( $userId, $userText, &$items ) );
997997
998998 if ( $items ) {
999 - return ' <span class="mw-usertoollinks">(' . $wgLang->pipeList( $items ) . ')</span>';
 999+ return ' <span class="mw-usertoollinks">' . wfMessage( 'parentheses' )->rawParams( $wgLang->pipeList( $items ) )->escaped() . '</span>';
10001000 } else {
10011001 return '';
10021002 }
Index: trunk/phase3/includes/actions/HistoryAction.php
@@ -523,7 +523,7 @@
524524 $histLinks = Html::rawElement(
525525 'span',
526526 array( 'class' => 'mw-history-histlinks' ),
527 - '(' . $curlink . $this->historyPage->message['pipe-separator'] . $lastlink . ') '
 527+ $this->msg( 'parentheses' )->rawParams( $curlink . $this->historyPage->message['pipe-separator'] . $lastlink )->escaped()
528528 );
529529 $s = $histLinks . $diffButtons;
530530
@@ -619,7 +619,7 @@
620620 }
621621
622622 if ( $tools ) {
623 - $s .= ' (' . $lang->pipeList( $tools ) . ')';
 623+ $s .= $this->msg( 'parentheses' )->rawParams( $lang->pipeList( $tools ) )->escaped();
624624 }
625625
626626 # Tags
Index: trunk/phase3/includes/ChangesList.php
@@ -252,7 +252,7 @@
253253 public function insertLog( &$s, $title, $logtype ) {
254254 $page = new LogPage( $logtype );
255255 $logname = $page->getName()->escaped();
256 - $s .= '(' . Linker::linkKnown( $title, $logname ) . ')';
 256+ $s .= $this->msg( 'parentheses' )->rawParams( Linker::linkKnown( $title, $logname ) )->escaped();
257257 }
258258
259259 /**
@@ -284,9 +284,9 @@
285285 $query
286286 );
287287 }
288 - $s .= '(' . $diffLink . $this->message['pipe-separator'];
 288+ $diffhist = $diffLink . $this->message['pipe-separator'];
289289 # History link
290 - $s .= Linker::linkKnown(
 290+ $diffhist .= Linker::linkKnown(
291291 $rc->getTitle(),
292292 $this->message['hist'],
293293 array(),
@@ -295,7 +295,7 @@
296296 'action' => 'history'
297297 )
298298 );
299 - $s .= ') . . ';
 299+ $s .= $this->msg( 'parentheses' )->rawParams( $diffhist )->escaped() . ' . . ';
300300 }
301301
302302 /**
@@ -679,7 +679,7 @@
680680 $logtitle = SpecialPage::getTitleFor( 'Log', $logType );
681681 $logpage = new LogPage( $logType );
682682 $logname = $logpage->getName()->escaped();
683 - $clink = '(' . Linker::linkKnown( $logtitle, $logname ) . ')';
 683+ $clink = $this->msg( 'parentheses' )->rawParams( Linker::linkKnown( $logtitle, $logname ) )->escaped();
684684 } else {
685685 $clink = Linker::link( $rc->getTitle() );
686686 }
@@ -852,7 +852,7 @@
853853 $text = $userlink;
854854 $text .= $this->getLanguage()->getDirMark();
855855 if( $count > 1 ) {
856 - $text .= ' (' . $this->getLanguage()->formatNum( $count ) . '×)';
 856+ $text .= ' ' . $this->msg( 'parentheses' )->rawParams( $this->getLanguage()->formatNum( $count ) . '×' )->escaped();
857857 }
858858 array_push( $users, $text );
859859 }
@@ -894,18 +894,18 @@
895895 }
896896 # Total change link
897897 $r .= ' ';
 898+ $logtext = '';
898899 if( !$allLogs ) {
899 - $r .= '(';
900900 if( !ChangesList::userCan( $rcObj, Revision::DELETED_TEXT, $this->getUser() ) ) {
901 - $r .= $nchanges[$n];
 901+ $logtext .= $nchanges[$n];
902902 } elseif( $isnew ) {
903 - $r .= $nchanges[$n];
 903+ $logtext .= $nchanges[$n];
904904 } else {
905905 $params = $queryParams;
906906 $params['diff'] = $currentRevision;
907907 $params['oldid'] = $oldid;
908908
909 - $r .= Linker::link(
 909+ $logtext .= Linker::link(
910910 $block[0]->getTitle(),
911911 $nchanges[$n],
912912 array(),
@@ -919,19 +919,24 @@
920920 if( $allLogs ) {
921921 // don't show history link for logs
922922 } elseif( $namehidden || !$block[0]->getTitle()->exists() ) {
923 - $r .= $this->message['pipe-separator'] . $this->message['hist'] . ')';
 923+ $logtext .= $this->message['pipe-separator'] . $this->message['hist'];
924924 } else {
925925 $params = $queryParams;
926926 $params['action'] = 'history';
927927
928 - $r .= $this->message['pipe-separator'] .
 928+ $logtext .= $this->message['pipe-separator'] .
929929 Linker::linkKnown(
930930 $block[0]->getTitle(),
931931 $this->message['hist'],
932932 array(),
933933 $params
934 - ) . ')';
 934+ );
935935 }
 936+
 937+ if( $logtext != '' ) {
 938+ $r .= $this->msg( 'parentheses' )->rawParams( $logtext )->escaped();
 939+ }
 940+
936941 $r .= ' . . ';
937942
938943 # Character difference (does not apply if only log items)
@@ -1003,11 +1008,7 @@
10041009 $r .= $link . '</span>';
10051010
10061011 if ( !$type == RC_LOG || $type == RC_NEW ) {
1007 - $r .= ' (';
1008 - $r .= $rcObj->curlink;
1009 - $r .= $this->message['pipe-separator'];
1010 - $r .= $rcObj->lastlink;
1011 - $r .= ')';
 1012+ $r .= $this->msg( 'parentheses' )->rawParams( $rcObj->curlink . $this->message['pipe-separator'] . $rcObj->lastlink )->escaped();
10121013 }
10131014 $r .= ' . . ';
10141015
@@ -1126,20 +1127,19 @@
11271128 if( $logType ) {
11281129 $logtitle = SpecialPage::getTitleFor( 'Log', $logType );
11291130 $logname = LogPage::logName( $logType );
1130 - $r .= '(' . Linker::linkKnown( $logtitle, htmlspecialchars( $logname ) ) . ')';
 1131+ $r .= $this->msg( 'parentheses' )->rawParams( Linker::linkKnown( $logtitle, htmlspecialchars( $logname ) ) )->escaped();
11311132 } else {
11321133 $this->insertArticleLink( $r, $rcObj, $rcObj->unpatrolled, $rcObj->watched );
11331134 }
11341135 # Diff and hist links
11351136 if ( $type != RC_LOG ) {
1136 - $r .= ' ('. $rcObj->difflink . $this->message['pipe-separator'];
11371137 $query['action'] = 'history';
1138 - $r .= Linker::linkKnown(
 1138+ $r .= $this->msg( 'parentheses' )->rawParams( $rcObj->difflink . $this->message['pipe-separator'] . Linker::linkKnown(
11391139 $rcObj->getTitle(),
11401140 $this->message['hist'],
11411141 array(),
11421142 $query
1143 - ) . ')';
 1143+ ) )->escaped();
11441144 }
11451145 $r .= ' . . ';
11461146 # Character diff

Follow-up revisions

RevisionCommit summaryAuthorDate
r112591(bug 34702) More localised parentheses.siebrand12:41, 28 February 2012
r112788Restore many missing spaces from r112589...nikerabbit10:42, 1 March 2012

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r112410(bug 34702) Use localised parentheses in Special:Contributions.siebrand20:42, 25 February 2012
r112412Follow-up r112410: (bug 34702) Use localised parentheses for comment, too.siebrand20:53, 25 February 2012
r112433(bug 34702) Localised parentheses are now used in more special pages.siebrand13:08, 26 February 2012

Status & tagging log