r47028 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r47027‎ | r47028 | r47029 >
Date:09:13, 9 February 2009
Author:siebrand
Status:deferred
Tags:
Comment:
* Update message 'pipe-separator' to have leading and trailing space for English and Occitan, to be able to remove some hard coded spaces
* Take out some hard coded pipe characters. Replace by message or Language::pipeList
* Take out a hard coded comma list SpecialIpblocklist.php. Replace by Language::commaList
Modified paths:
  • /trunk/phase3/includes/GlobalFunctions.php (modified) (history)
  • /trunk/phase3/includes/Linker.php (modified) (history)
  • /trunk/phase3/includes/LogEventsList.php (modified) (history)
  • /trunk/phase3/includes/PageHistory.php (modified) (history)
  • /trunk/phase3/includes/Pager.php (modified) (history)
  • /trunk/phase3/includes/specials/SpecialIpblocklist.php (modified) (history)
  • /trunk/phase3/languages/messages/MessagesEn.php (modified) (history)
  • /trunk/phase3/languages/messages/MessagesOc.php (modified) (history)

Diff [purge]

Index: trunk/phase3/languages/messages/MessagesEn.php
@@ -3579,7 +3579,7 @@
35803580 'comma-separator' => ', ', # only translate this message to other languages if you have to change it
35813581 'colon-separator' => ': ', # only translate this message to other languages if you have to change it
35823582 'autocomment-prefix' => '- ', # only translate this message to other languages if you have to change it
3583 -'pipe-separator' => '|', # only translate this message to other languages if you have to change it
 3583+'pipe-separator' => ' | ', # only translate this message to other languages if you have to change it
35843584 'word-separator' => ' ', # only translate this message to other languages if you have to change it
35853585 'ellipsis' => '…', # only translate this message to other languages if you have to change it
35863586
Index: trunk/phase3/languages/messages/MessagesOc.php
@@ -2912,7 +2912,7 @@
29132913 # Separators for various lists, etc.
29142914 'colon-separator' => ' : ',
29152915 'autocomment-prefix' => '-',
2916 -'pipe-separator' => '•',
 2916+'pipe-separator' => ' • ',
29172917
29182918 # Multipage image navigation
29192919 'imgmultipageprev' => '← pagina precedenta',
Index: trunk/phase3/includes/Pager.php
@@ -530,7 +530,7 @@
531531
532532 $pagingLinks = $this->getPagingLinks( $linkTexts );
533533 $limitLinks = $this->getLimitLinks();
534 - $limits = implode( ' | ', $limitLinks );
 534+ $limits = $wgLang->pipeList( $limitLinks );
535535
536536 $this->mNavigationBar =
537537 "({$pagingLinks['first']} | {$pagingLinks['last']}) " .
@@ -549,7 +549,7 @@
550550 if( $first ) {
551551 $first = false;
552552 } else {
553 - $extra .= ' | ';
 553+ $extra .= wfMsgExt( 'pipe-separator' , 'escapenoentities' );
554554 }
555555
556556 if( $order == $this->mOrderType ) {
@@ -610,9 +610,9 @@
611611
612612 $pagingLinks = $this->getPagingLinks( $linkTexts );
613613 $limitLinks = $this->getLimitLinks();
614 - $limits = implode( ' | ', $limitLinks );
 614+ $limits = $wgLang->pipeList( $limitLinks );
615615
616 - $this->mNavigationBar = "({$pagingLinks['first']} | {$pagingLinks['last']}) " .
 616+ $this->mNavigationBar = "({$pagingLinks['first']}" . wfMsgExt( 'pipe-separator' , 'escapenoentities' ) . "{$pagingLinks['last']}) " .
617617 wfMsgHtml("viewprevnext", $pagingLinks['prev'], $pagingLinks['next'], $limits);
618618 return $this->mNavigationBar;
619619 }
Index: trunk/phase3/includes/specials/SpecialIpblocklist.php
@@ -306,7 +306,7 @@
307307 }
308308
309309 function searchForm() {
310 - global $wgTitle, $wgScript, $wgRequest;
 310+ global $wgTitle, $wgScript, $wgRequest, $wgLang;
311311
312312 $showhide = array( wfMsg( 'show' ), wfMsg( 'hide' ) );
313313 $nondefaults = array();
@@ -330,7 +330,7 @@
331331 $links[] = wfMsgHtml( 'ipblocklist-sh-userblocks', $ubLink );
332332 $links[] = wfMsgHtml( 'ipblocklist-sh-tempblocks', $tbLink );
333333 $links[] = wfMsgHtml( 'ipblocklist-sh-addressblocks', $sipbLink );
334 - $hl = implode( ' ' . wfMsg( 'pipe-separator' ) . ' ', $links );
 334+ $hl = $wgLang->pipeList( $links );
335335
336336 return
337337 Xml::tags( 'form', array( 'action' => $wgScript ),
@@ -418,7 +418,7 @@
419419 $properties[] = $msg['blocklist-nousertalk'];
420420 }
421421
422 - $properties = implode( ', ', $properties );
 422+ $properties = $wgLang->commaList( $properties );
423423
424424 $line = wfMsgReplaceArgs( $msg['blocklistline'], array( $formattedTime, $blocker, $target, $properties ) );
425425
@@ -434,7 +434,7 @@
435435
436436 # Create changeblocklink for all blocks with exception of autoblocks
437437 if( !$block->mAuto ) {
438 - $changeblocklink = ' ' . wfMsg( 'pipe-separator' ) . ' ' .
 438+ $changeblocklink = wfMsg( 'pipe-separator' ) .
439439 $sk->link( SpecialPage::getTitleFor( 'Blockip', $block->mAddress ),
440440 $msg['change-blocklink'],
441441 array(), array(), 'known' );
Index: trunk/phase3/includes/Linker.php
@@ -1053,7 +1053,7 @@
10541054 * @return string
10551055 */
10561056 public function userToolLinks( $userId, $userText, $redContribsWhenNoEdits = false, $flags = 0, $edits=null ) {
1057 - global $wgUser, $wgDisableAnonTalk, $wgSysopUserBans;
 1057+ global $wgUser, $wgDisableAnonTalk, $wgSysopUserBans, $wgLang;
10581058 $talkable = !( $wgDisableAnonTalk && 0 == $userId );
10591059 $blockable = ( $wgSysopUserBans || 0 == $userId ) && !$flags & self::TOOL_LINKS_NOBLOCK;
10601060
@@ -1079,7 +1079,7 @@
10801080 }
10811081
10821082 if( $items ) {
1083 - return ' <span class="mw-usertoollinks">(' . implode( ' | ', $items ) . ')</span>';
 1083+ return ' <span class="mw-usertoollinks">(' . $wgLang->pipeList( $items ) . ')</span>';
10841084 } else {
10851085 return '';
10861086 }
Index: trunk/phase3/includes/PageHistory.php
@@ -358,7 +358,7 @@
359359 }
360360
361361 if( $tools ) {
362 - $s .= ' (' . implode( ' | ', $tools ) . ')';
 362+ $s .= ' (' . $wgLang->pipeList( $tools ) . ')';
363363 }
364364
365365 # Tags
Index: trunk/phase3/includes/LogEventsList.php
@@ -280,7 +280,7 @@
281281 array(),
282282 array( 'action' => 'unblock', 'ip' => $row->log_title ),
283283 'known' )
284 - . ' ' . $this->message['pipe-separator'] . ' ' .
 284+ . $this->message['pipe-separator'] .
285285 $this->skin->link( SpecialPage::getTitleFor( 'Blockip', $row->log_title ),
286286 $this->message['change-blocklink'],
287287 array(), array(), 'known' ) .
@@ -293,7 +293,7 @@
294294 array(),
295295 array( 'action' => 'history', 'offset' => $row->log_timestamp ) );
296296 if( $wgUser->isAllowed( 'protect' ) ) {
297 - $revert .= ' ' . $this->message['pipe-separator'] . ' ' .
 297+ $revert .= $this->message['pipe-separator'] .
298298 $this->skin->link( $title,
299299 $this->message['protect_change'],
300300 array(),
Index: trunk/phase3/includes/GlobalFunctions.php
@@ -986,11 +986,11 @@
987987 } else {
988988 $nlink = '<a href="' . $title->escapeLocalUrl( $q ) . "\" class=\"mw-nextlink\">{$next}</a>";
989989 }
990 - $nums = wfNumLink( $offset, 20, $title, $query ) . ' | ' .
991 - wfNumLink( $offset, 50, $title, $query ) . ' | ' .
992 - wfNumLink( $offset, 100, $title, $query ) . ' | ' .
993 - wfNumLink( $offset, 250, $title, $query ) . ' | ' .
994 - wfNumLink( $offset, 500, $title, $query );
 990+ $nums = $wgLang->pipeList( wfNumLink( $offset, 20, $title, $query ),
 991+ wfNumLink( $offset, 50, $title, $query ),
 992+ wfNumLink( $offset, 100, $title, $query ),
 993+ wfNumLink( $offset, 250, $title, $query ),
 994+ wfNumLink( $offset, 500, $title, $query ) );
995995
996996 return wfMsg( 'viewprevnext', $plink, $nlink, $nums );
997997 }

Follow-up revisions

RevisionCommit summaryAuthorDate
r47040* remove forgotten case of hard coded pipe separator in Pager...siebrand14:31, 9 February 2009
r47046(bug 7509) Separation strings should be configurable...siebrand17:48, 9 February 2009

Status & tagging log