From 68643f50792bef82666d883304317d1c1572546a Mon Sep 17 00:00:00 2001 From: Siebrand Mazeland Date: Sat, 25 Feb 2012 20:42:08 +0000 Subject: [PATCH] (bug 34702) Use localised parentheses in Special:Contributions. --- RELEASE-NOTES-1.20 | 1 + includes/Linker.php | 6 +++--- includes/Pager.php | 8 +++++--- includes/specials/SpecialContributions.php | 6 ++++-- 4 files changed, 13 insertions(+), 8 deletions(-) diff --git a/RELEASE-NOTES-1.20 b/RELEASE-NOTES-1.20 index 65317f312c..1647aa521b 100644 --- a/RELEASE-NOTES-1.20 +++ b/RELEASE-NOTES-1.20 @@ -34,6 +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. === API changes in 1.20 === * (bug 34316) Add ability to retrieve maximum upload size from MediaWiki API. diff --git a/includes/Linker.php b/includes/Linker.php index ef1f043329..52e00ba643 100644 --- a/includes/Linker.php +++ b/includes/Linker.php @@ -1440,7 +1440,7 @@ class Linker { } else { global $wgLang; $stxt = wfMsgExt( 'nbytes', 'parsemag', $wgLang->formatNum( $size ) ); - $stxt = "($stxt)"; + $stxt = wfMessage( 'parentheses' )->rawParams( $stxt ); } $stxt = htmlspecialchars( $stxt ); return "$stxt"; @@ -1869,7 +1869,7 @@ class Linker { $html = $delete ? wfMsgHtml( 'rev-delundel' ) : wfMsgHtml( 'rev-showdeleted' ); $tag = $restricted ? 'strong' : 'span'; $link = self::link( $sp, $html, array(), $query, array( 'known', 'noclasses' ) ); - return Xml::tags( $tag, array( 'class' => 'mw-revdelundel-link' ), "($link)" ); + return Xml::tags( $tag, array( 'class' => 'mw-revdelundel-link' ), wfMessage( 'parentheses' )->rawParams( $link ) ); } /** @@ -1882,7 +1882,7 @@ class Linker { */ public static function revDeleteLinkDisabled( $delete = true ) { $html = $delete ? wfMsgHtml( 'rev-delundel' ) : wfMsgHtml( 'rev-showdeleted' ); - return Xml::tags( 'span', array( 'class' => 'mw-revdelundel-link' ), "($html)" ); + return Xml::tags( 'span', array( 'class' => 'mw-revdelundel-link' ), wfMessage( 'parentheses' )->rawParams( $html ) ); } /* Deprecated methods */ diff --git a/includes/Pager.php b/includes/Pager.php index f9231d58d9..a9937e4967 100644 --- a/includes/Pager.php +++ b/includes/Pager.php @@ -769,15 +769,17 @@ abstract class ReverseChronologicalPager extends IndexPager { $pagingLinks = $this->getPagingLinks( $linkTexts ); $limitLinks = $this->getLimitLinks(); $limits = $this->getLanguage()->pipeList( $limitLinks ); - - $this->mNavigationBar = "({$pagingLinks['first']}" . + $firstLastLinks = wfMessage( 'parentheses' )->rawParams( "{$pagingLinks['first']}" . wfMsgExt( 'pipe-separator' , 'escapenoentities' ) . - "{$pagingLinks['last']}) " . + "{$pagingLinks['last']}" ); + + $this->mNavigationBar = $firstLastLinks . ' ' . wfMsgHTML( 'viewprevnext', $pagingLinks['prev'], $pagingLinks['next'], $limits ); + return $this->mNavigationBar; } diff --git a/includes/specials/SpecialContributions.php b/includes/specials/SpecialContributions.php index 03820b4338..ce67a6d198 100644 --- a/includes/specials/SpecialContributions.php +++ b/includes/specials/SpecialContributions.php @@ -251,9 +251,11 @@ class SpecialContributions extends SpecialPage { // languages that want to put the "for" bit right after $user but before // $links. If 'contribsub' is around, use it for reverse compatibility, // otherwise use 'contribsub2'. + // @todo Should this be removed at some point? $oldMsg = $this->msg( 'contribsub' ); if ( $oldMsg->exists() ) { - return $oldMsg->rawParams( "$user ($links)" ); + $linksWithParentheses = $this->msg( 'parenteses' )->rawParams( $links ); + return $oldMsg->rawParams( "$user $linksWithParentheses" ); } else { return $this->msg( 'contribsub2' )->rawParams( $user, $links ); } @@ -837,7 +839,7 @@ class ContribsPager extends ReverseChronologicalPager { $del .= ' '; } - $diffHistLinks = '(' . $difftext . $this->messages['pipe-separator'] . $histlink . ')'; + $diffHistLinks = $this->msg( 'parentheses' )->rawParams( $difftext . $this->messages['pipe-separator'] . $histlink ); $ret = "{$del}{$d} {$diffHistLinks}{$chardiff}{$nflag}{$mflag} {$link}{$userlink} {$comment} {$topmarktext}"; # Denote if username is redacted for this edit -- 2.20.1