https://www.mediawiki.org/wiki/Special:Code/MediaWiki/112591
Revision: 112591
Author: siebrand
Date: 2012-02-28 12:41:26 +0000 (Tue, 28 Feb 2012)
Log Message:
-----------
(bug 34702) More localised parentheses.
Modified Paths:
--------------
trunk/phase3/includes/RecentChange.php
trunk/phase3/includes/SkinLegacy.php
trunk/phase3/includes/logging/LogEventsList.php
trunk/phase3/includes/logging/LogPage.php
trunk/phase3/includes/specials/SpecialAllmessages.php
trunk/phase3/includes/specials/SpecialListusers.php
trunk/phase3/includes/specials/SpecialTags.php
trunk/phase3/includes/specials/SpecialUndelete.php
trunk/phase3/includes/specials/SpecialUserlogin.php
Modified: trunk/phase3/includes/RecentChange.php
===================================================================
--- trunk/phase3/includes/RecentChange.php 2012-02-28 12:10:17 UTC (rev
112590)
+++ trunk/phase3/includes/RecentChange.php 2012-02-28 12:41:26 UTC (rev
112591)
@@ -706,6 +706,7 @@
} elseif($szdiff >= 0) {
$szdiff = '+' . $szdiff ;
}
+ // @todo i18n with parentheses in content language?
$szdiff = '(' . $szdiff . ')' ;
} else {
$szdiff = '';
Modified: trunk/phase3/includes/SkinLegacy.php
===================================================================
--- trunk/phase3/includes/SkinLegacy.php 2012-02-28 12:10:17 UTC (rev
112590)
+++ trunk/phase3/includes/SkinLegacy.php 2012-02-28 12:41:26 UTC (rev
112591)
@@ -702,7 +702,7 @@
global $wgOut;
if ( !$wgOut->isArticleRelated() ) {
- return '(' . wfMsg( 'notanarticle' ) . ')';
+ return wfMessage( 'parentheses', wfMessage(
'notanarticle' )->text() )->escaped();
} else {
return Linker::linkKnown(
SpecialPage::getTitleFor(
'Recentchangeslinked', $this->getSkin()->getTitle()->getPrefixedDBkey() ),
@@ -815,8 +815,9 @@
$talkLink = Linker::link(
$wgUser->getTalkPage(),
$wgLang->getNsText( NS_TALK ) );
+ $talkLink = wfMessage( 'parentheses'
)->rawParams( $talkLink )->escaped();
- $ret .= "$name ($talkLink)";
+ $ret .= "$name $talkLink";
} else {
$ret .= wfMsg( 'notloggedin' );
}
@@ -837,10 +838,11 @@
} else {
$talkLink = Linker::link( $wgUser->getTalkPage(),
$wgLang->getNsText( NS_TALK ) );
+ $talkLink = wfMessage( 'parentheses' )->rawParams(
$talkLink )->escaped();
$ret .= Linker::link( $wgUser->getUserPage(),
htmlspecialchars( $wgUser->getName() ) );
- $ret .= " ($talkLink)<br />";
+ $ret .= " $talkLink<br />";
$ret .= $wgLang->pipeList( array(
Linker::link(
SpecialPage::getTitleFor( 'Userlogout'
), wfMsg( 'logout' ),
@@ -860,6 +862,4 @@
return $ret;
}
-
}
-
Modified: trunk/phase3/includes/logging/LogEventsList.php
===================================================================
--- trunk/phase3/includes/logging/LogEventsList.php 2012-02-28 12:10:17 UTC
(rev 112590)
+++ trunk/phase3/includes/logging/LogEventsList.php 2012-02-28 12:41:26 UTC
(rev 112591)
@@ -383,7 +383,7 @@
if( self::typeAction( $row, 'move', 'move', 'move' ) && !empty(
$paramArray[0] ) ) {
$destTitle = Title::newFromText( $paramArray[0] );
if( $destTitle ) {
- $revert = '(' . Linker::link(
+ $revert = Linker::link(
SpecialPage::getTitleFor( 'Movepage' ),
$this->message['revertmove'],
array(),
@@ -394,7 +394,8 @@
'wpMovetalk' => 0
),
array( 'known', 'noclasses' )
- ) . ')';
+ );
+ $revert = wfMessage( 'parentheses'
)->rawParams( $revert )->escaped();
}
// Show undelete link
} elseif( self::typeAction( $row, array( 'delete', 'suppress'
), 'delete', 'deletedhistory' ) ) {
@@ -403,17 +404,17 @@
} else {
$viewdeleted = $this->message['undeletelink'];
}
- $revert = '(' . Linker::link(
+ $revert = Linker::link(
SpecialPage::getTitleFor( 'Undelete' ),
$viewdeleted,
array(),
array( 'target' => $title->getPrefixedDBkey() ),
array( 'known', 'noclasses' )
- ) . ')';
+ );
+ $revert = wfMessage( 'parentheses' )->rawParams(
$revert )->escaped();
// Show unblock/change block link
} elseif( self::typeAction( $row, array( 'block', 'suppress' ),
array( 'block', 'reblock' ), 'block' ) ) {
- $revert = '(' .
- Linker::link(
+ $revert = Linker::link(
SpecialPage::getTitleFor( 'Unblock',
$row->log_title ),
$this->message['unblocklink'],
array(),
@@ -427,12 +428,11 @@
array(),
array(),
'known'
- ) .
- ')';
+ );
+ $revert = wfMessage( 'parentheses'
)->rawParams( $revert )->escaped();
// Show change protection link
} elseif( self::typeAction( $row, 'protect', array( 'modify',
'protect', 'unprotect' ) ) ) {
- $revert .= ' (' .
- Linker::link( $title,
+ $revert .= Linker::link( $title,
$this->message['hist'],
array(),
array(
@@ -448,10 +448,10 @@
array( 'action' => 'protect' ),
'known' );
}
- $revert .= ')';
+ $revert = ' ' . wfMessage( 'parentheses' )->rawParams(
$revert )->escaped();
// Show unmerge link
} elseif( self::typeAction( $row, 'merge', 'merge',
'mergehistory' ) ) {
- $revert = '(' . Linker::link(
+ $revert = Linker::link(
SpecialPage::getTitleFor( 'MergeHistory' ),
$this->message['revertmerge'],
array(),
@@ -461,7 +461,8 @@
'mergepoint' => $paramArray[1]
),
array( 'known', 'noclasses' )
- ) . ')';
+ );
+ $revert = wfMessage( 'parentheses' )->rawParams(
$revert )->escaped();
// If an edit was hidden from a page give a review link to the
history
} elseif( self::typeAction( $row, array( 'delete', 'suppress'
), 'revision', 'deletedhistory' ) ) {
$revert = RevisionDeleter::getLogLinks( $title,
$paramArray,
@@ -473,7 +474,7 @@
// $paramArray[1] is a CSV of the IDs
$query = $paramArray[0];
// Link to each hidden object ID,
$paramArray[1] is the url param
- $revert = '(' . Linker::link(
+ $revert = Linker::link(
$revdel,
$this->message['revdel-restore'],
array(),
@@ -483,7 +484,8 @@
'ids' => $query
),
array( 'known', 'noclasses' )
- ) . ')';
+ );
+ $revert = wfMessage( 'parentheses'
)->rawParams( $revert )->escaped();
}
// Do nothing. The implementation is handled by the hook
modifiying the passed-by-ref parameters.
} else {
Modified: trunk/phase3/includes/logging/LogPage.php
===================================================================
--- trunk/phase3/includes/logging/LogPage.php 2012-02-28 12:10:17 UTC (rev
112590)
+++ trunk/phase3/includes/logging/LogPage.php 2012-02-28 12:41:26 UTC (rev
112591)
@@ -416,7 +416,8 @@
# Use the language name for log titles,
rather than Log/X
if( $name == 'Log' ) {
- $titleLink = '(' .
Linker::link( $title, LogPage::logName( $par ) ) . ')';
+ $titleLink = Linker::link(
$title, LogPage::logName( $par ) );
+ $titleLink = wfMessage(
'parentheses' )->rawParams( $titleLink )->escaped();
} else {
$titleLink = Linker::link(
$title );
}
@@ -551,7 +552,7 @@
for( $i = 0; $i < count( $flags ); $i++ ) {
$flags[$i] = self::formatBlockFlag( $flags[$i],
$lang );
}
- return '(' . $lang->commaList( $flags ) . ')';
+ return wfMessage( 'parentheses' )->rawParams(
$lang->commaList( $flags ) )->escaped();
} else {
return '';
}
Modified: trunk/phase3/includes/specials/SpecialAllmessages.php
===================================================================
--- trunk/phase3/includes/specials/SpecialAllmessages.php 2012-02-28
12:10:17 UTC (rev 112590)
+++ trunk/phase3/includes/specials/SpecialAllmessages.php 2012-02-28
12:41:26 UTC (rev 112591)
@@ -370,7 +370,7 @@
array( 'broken' )
);
}
- return $title . ' (' . $talk . ')';
+ return $title . $this->msg( 'parentheses'
)->rawParams( $talk )->escaped();
case 'am_default' :
case 'am_actual' :
Modified: trunk/phase3/includes/specials/SpecialListusers.php
===================================================================
--- trunk/phase3/includes/specials/SpecialListusers.php 2012-02-28 12:10:17 UTC
(rev 112590)
+++ trunk/phase3/includes/specials/SpecialListusers.php 2012-02-28 12:41:26 UTC
(rev 112591)
@@ -158,14 +158,16 @@
}
$userTalkPage = $userPage->getTalkPage();
- $talk = ' (' . Linker::link( $userTalkPage, wfMessage(
'talkpagelinktext' )->escaped() ) . ')';
+ $talk = Linker::link( $userTalkPage, wfMessage(
'talkpagelinktext' )->escaped() );
+ $talk = ' ' . wfMessage( 'parentheses' )->rawParams( $talk
)->escaped();
$created = '';
# Some rows may be NULL
if( $row->creation ) {
$d = $lang->date( wfTimestamp( TS_MW, $row->creation ),
true );
$t = $lang->time( wfTimestamp( TS_MW, $row->creation ),
true );
- $created = ' (' . wfMsgExt( 'usercreated', array(
'parsemag', 'escape' ), $d, $t, $row->user_name ) . ')';
+ $created = wfMsgExt( 'usercreated', array( 'parsemag',
'escape' ), $d, $t, $row->user_name );
+ $created = ' ' . wfMessage( 'parentheses' )->rawParams(
$created )->escaped();
}
wfRunHooks( 'SpecialListusersFormatRow', array( &$item, $row )
);
Modified: trunk/phase3/includes/specials/SpecialTags.php
===================================================================
--- trunk/phase3/includes/specials/SpecialTags.php 2012-02-28 12:10:17 UTC
(rev 112590)
+++ trunk/phase3/includes/specials/SpecialTags.php 2012-02-28 12:41:26 UTC
(rev 112591)
@@ -75,12 +75,16 @@
$newRow .= Xml::tags( 'td', null, Xml::element( 'tt', null,
$tag ) );
$disp = ChangeTags::tagDescription( $tag );
- $disp .= ' (' . Linker::link( Title::makeTitle( NS_MEDIAWIKI,
"Tag-$tag" ), wfMsgHtml( 'tags-edit' ) ) . ')';
+ $disp .= ' ';
+ $editLink = Linker::link( Title::makeTitle( NS_MEDIAWIKI,
"Tag-$tag" ), wfMsgHtml( 'tags-edit' ) );
+ $disp .= $this->msg( 'parentheses' )->rawParams( $editLink
)->escaped();
$newRow .= Xml::tags( 'td', null, $disp );
$msg = wfMessage( "tag-$tag-description" );
$desc = !$msg->exists() ? '' : $msg->parse();
- $desc .= ' (' . Linker::link( Title::makeTitle( NS_MEDIAWIKI,
"Tag-$tag-description" ), wfMsgHtml( 'tags-edit' ) ) . ')';
+ $desc .= ' ';
+ $editDescLink = Linker::link( Title::makeTitle( NS_MEDIAWIKI,
"Tag-$tag-description" ), wfMsgHtml( 'tags-edit' ) );
+ $desc .= $this->msg( 'parentheses' )->rawParams( $editDescLink
)->escaped();
$newRow .= Xml::tags( 'td', null, $desc );
$hitcount = wfMsgExt( 'tags-hitcount', array( 'parsemag' ),
$this->getLanguage()->formatNum( $hitcount ) );
Modified: trunk/phase3/includes/specials/SpecialUndelete.php
===================================================================
--- trunk/phase3/includes/specials/SpecialUndelete.php 2012-02-28 12:10:17 UTC
(rev 112590)
+++ trunk/phase3/includes/specials/SpecialUndelete.php 2012-02-28 12:41:26 UTC
(rev 112591)
@@ -1233,9 +1233,9 @@
$pageLink = $this->getLanguage()->userTimeAndDate( $ts,
$user );
}
$userLink = $this->getFileUser( $file );
- $data = $this->msg( 'widthheight' )->numParams( $row->fa_width,
$row->fa_height )->text() .
- ' (' . $this->msg( 'nbytes' )->numParams( $row->fa_size
)->text() . ')';
- $data = htmlspecialchars( $data );
+ $data = $this->msg( 'widthheight' )->numParams( $row->fa_width,
$row->fa_height )->text();
+ $bytes = $this->msg( 'parentheses' )->rawParams( $this->msg(
'nbytes' )->numParams( $row->fa_size )->text() )->plain();
+ $data = htmlspecialchars( $data . ' ' . $bytes );
$comment = $this->getFileComment( $file );
// Add show/hide deletion links if available
Modified: trunk/phase3/includes/specials/SpecialUserlogin.php
===================================================================
--- trunk/phase3/includes/specials/SpecialUserlogin.php 2012-02-28 12:10:17 UTC
(rev 112590)
+++ trunk/phase3/includes/specials/SpecialUserlogin.php 2012-02-28 12:41:26 UTC
(rev 112591)
@@ -334,7 +334,7 @@
$ip = $this->getRequest()->getIP();
if ( $currentUser->isDnsBlacklisted( $ip, true /* check
$wgProxyWhitelist */ ) ) {
- $this->mainLoginForm( $this->msg(
'sorbs_create_account_reason' )->text() . ' (' . htmlspecialchars( $ip ) . ')'
);
+ $this->mainLoginForm( $this->msg(
'sorbs_create_account_reason' )->text() . ' ' . $this->msg( 'parentheses'
)->rawParams( htmlspecialchars( $ip ) )->escaped() );
return false;
}
_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs