From ec4bb050695c199dabcc7ab336839138760b3597 Mon Sep 17 00:00:00 2001 From: Siebrand Mazeland Date: Sun, 26 Feb 2012 13:08:41 +0000 Subject: [PATCH] (bug 34702) Localised parentheses are now used in more special pages. --- RELEASE-NOTES-1.20 | 2 +- includes/Pager.php | 9 +++++---- includes/specials/SpecialProtectedpages.php | 10 ++++++---- includes/specials/SpecialShortpages.php | 6 ++++-- includes/specials/SpecialWhatlinkshere.php | 4 ++-- 5 files changed, 18 insertions(+), 13 deletions(-) diff --git a/RELEASE-NOTES-1.20 b/RELEASE-NOTES-1.20 index cbe436f0b3..62461ed3ec 100644 --- a/RELEASE-NOTES-1.20 +++ b/RELEASE-NOTES-1.20 @@ -34,7 +34,7 @@ production. copy/paste on supporting browsers * (bug 34428) Fixed incorrect hash mismatch errors in the DiffHistoryBlob history compression method. -* (bug 34702) Special:Contributions now uses localised parentheses. +* (bug 34702) Localised parentheses are now used in more special pages. * (bug 34723) When editing a script page on a RTL wiki the textbox should be LTR. === API changes in 1.20 === diff --git a/includes/Pager.php b/includes/Pager.php index 86b7729137..cd0d9eb66e 100644 --- a/includes/Pager.php +++ b/includes/Pager.php @@ -679,11 +679,11 @@ abstract class AlphabeticPager extends IndexPager { $limitLinks = $this->getLimitLinks(); $limits = $lang->pipeList( $limitLinks ); - $this->mNavigationBar = - "(" . $lang->pipeList( + $this->mNavigationBar = wfMessage( 'parentheses' )->rawParams( + $lang->pipeList( array( $pagingLinks['first'], $pagingLinks['last'] ) - ) . ") " . + ) )->escaped() . " " . wfMsgHtml( 'viewprevnext', $pagingLinks['prev'], $pagingLinks['next'], $limits ); @@ -713,7 +713,8 @@ abstract class AlphabeticPager extends IndexPager { } if( $extra !== '' ) { - $this->mNavigationBar .= " ($extra)"; + $extra = ' ' . wfMessage( 'parentheses' )->rawParams( $extra )->escaped(); + $this->mNavigationBar .= $extra; } return $this->mNavigationBar; diff --git a/includes/specials/SpecialProtectedpages.php b/includes/specials/SpecialProtectedpages.php index eec974fe0f..fa45255a8f 100644 --- a/includes/specials/SpecialProtectedpages.php +++ b/includes/specials/SpecialProtectedpages.php @@ -118,15 +118,15 @@ class SpecialProtectedpages extends SpecialPage { # Show a link to the change protection form for allowed users otherwise a link to the protection log if( $this->getUser()->isAllowed( 'protect' ) ) { - $changeProtection = ' (' . Linker::linkKnown( + $changeProtection = Linker::linkKnown( $title, wfMsgHtml( 'protect_change' ), array(), array( 'action' => 'unprotect' ) - ) . ')'; + ); } else { $ltitle = SpecialPage::getTitleFor( 'Log' ); - $changeProtection = ' (' . Linker::linkKnown( + $changeProtection = Linker::linkKnown( $ltitle, wfMsgHtml( 'protectlogpage' ), array(), @@ -134,9 +134,11 @@ class SpecialProtectedpages extends SpecialPage { 'type' => 'protect', 'page' => $title->getPrefixedText() ) - ) . ')'; + ); } + $changeProtection = ' ' . wfMessage( 'parentheses' )->rawParams( $changeProtection )->escaped(); + wfProfileOut( __METHOD__ ); return Html::rawElement( diff --git a/includes/specials/SpecialShortpages.php b/includes/specials/SpecialShortpages.php index c176f91364..5657b68988 100644 --- a/includes/specials/SpecialShortpages.php +++ b/includes/specials/SpecialShortpages.php @@ -95,8 +95,10 @@ class ShortPagesPage extends QueryPage { : Linker::linkKnown( $title ); $size = $this->msg( 'nbytes' )->numParams( $result->value )->escaped(); + $hlinkInParentheses = wfMessage( 'parentheses' )->rawParams( $hlink )->escaped(); + return $title->exists() - ? "({$hlink}) {$dm}{$plink} {$dm}[{$size}]" - : "({$hlink}) {$dm}{$plink} {$dm}[{$size}]"; + ? "${hlinkInParentheses} {$dm}{$plink} {$dm}[{$size}]" + : "${hlinkInParentheses} {$dm}{$plink} {$dm}[{$size}]"; } } diff --git a/includes/specials/SpecialWhatlinkshere.php b/includes/specials/SpecialWhatlinkshere.php index 79305adaa8..4cff1ee02e 100644 --- a/includes/specials/SpecialWhatlinkshere.php +++ b/includes/specials/SpecialWhatlinkshere.php @@ -316,12 +316,12 @@ class SpecialWhatLinksHere extends SpecialPage { $props[] = $msgcache['isimage']; if ( count( $props ) ) { - $propsText = '(' . implode( $msgcache['semicolon-separator'], $props ) . ')'; + $propsText = wfMessage( 'parentheses' )->rawParams( implode( $msgcache['semicolon-separator'], $props ) )->escaped(); } # Space for utilities links, with a what-links-here link provided $wlhLink = $this->wlhLink( $nt, $msgcache['whatlinkshere-links'] ); - $wlh = Xml::wrapClass( "($wlhLink)", 'mw-whatlinkshere-tools' ); + $wlh = Xml::wrapClass( wfMessage( 'parentheses' )->rawParams( $wlhLink )->escaped(), 'mw-whatlinkshere-tools' ); return $notClose ? Xml::openElement( 'li' ) . "$link $propsText $dirmark $wlh\n" : -- 2.20.1