Florianschmidtwelzow has uploaded a new change for review.
https://gerrit.wikimedia.org/r/262062
Change subject: Replace some wfMsg* calls
......................................................................
Replace some wfMsg* calls
Change-Id: I75db3c9e7e4d63efa903d3c0c1f9ca69fd8e5123
But: T70750
---
M Push.hooks.php
M api/ApiPush.php
M api/ApiPushImages.php
M includes/Push_Tab.php
M specials/Push_Body.php
5 files changed, 47 insertions(+), 47 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Push
refs/changes/62/262062/1
diff --git a/Push.hooks.php b/Push.hooks.php
index 8cded29..ad4682d 100644
--- a/Push.hooks.php
+++ b/Push.hooks.php
@@ -20,7 +20,7 @@
* @return true
*/
public static function addToAdminLinks( &$admin_links_tree ) {
- $ioSection = $admin_links_tree->getSection( wfMsg(
'adminlinks_importexport' ) );
+ $ioSection = $admin_links_tree->getSection( wfMessage(
'adminlinks_importexport' )->text() );
$mainRow = $ioSection->getRow( 'main' );
$mainRow->addItem( ALItem::newFromSpecialPage( 'Push' ) );
diff --git a/api/ApiPush.php b/api/ApiPush.php
index 956f5f3..43da2cb 100644
--- a/api/ApiPush.php
+++ b/api/ApiPush.php
@@ -157,15 +157,15 @@
$this->cookieJars[$target] =
$req->getCookieJar();
}
else {
- $this->dieUsage( wfMsgExt(
'push-err-authentication', 'parsemag', $target, '' ), 'authentication-failed' );
+ $this->dieUsage( wfMessage(
'push-err-authentication', $target, '' )->parse(), 'authentication-failed' );
}
}
else {
- $this->dieUsage( wfMsgExt(
'push-err-authentication', 'parsemag', $target, '' ), 'authentication-failed' );
+ $this->dieUsage( wfMessage(
'push-err-authentication', $target, '' )->parse(), 'authentication-failed' );
}
}
else {
- $this->dieUsage( wfMsgExt( 'push-err-authentication',
'parsemag', $target, '' ), 'authentication-failed' );
+ $this->dieUsage( wfMessage( 'push-err-authentication',
$target, '' )->parse(), 'authentication-failed' );
}
}
@@ -220,11 +220,11 @@
$revision =
$response['query']['pages'][$first]['revisions'][0];
}
else {
- $this->dieUsage( wfMsg(
'push-special-err-pageget-failed' ), 'page-get-failed' );
+ $this->dieUsage( wfMessage(
'push-special-err-pageget-failed' )->text(), 'page-get-failed' );
}
}
else {
- $this->dieUsage( wfMsg(
'push-special-err-pageget-failed' ), 'page-get-failed' );
+ $this->dieUsage( wfMessage(
'push-special-err-pageget-failed' )->text(), 'page-get-failed' );
}
return $revision;
@@ -315,11 +315,11 @@
$this->dieUsage(
$response->query->error->message, 'token-request-failed' );
}
else {
- $this->dieUsage( wfMsg(
'push-special-err-token-failed' ), 'token-request-failed' );
+ $this->dieUsage( wfMessage(
'push-special-err-token-failed' )->text(), 'token-request-failed' );
}
}
else {
- $this->dieUsage( wfMsg( 'push-special-err-token-failed'
), 'token-request-failed' );
+ $this->dieUsage( wfMessage(
'push-special-err-token-failed' )->text(), 'token-request-failed' );
}
return $token;
@@ -338,12 +338,11 @@
protected function pushToTarget( Title $title, array $revision,
$target, $token ) {
global $wgSitename;
- $summary = wfMsgExt(
+ $summary = wfMessage(
'push-import-revision-message',
- 'parsemag',
$wgSitename
//$revision['user']
- );
+ )->parse();
$requestData = array(
'action' => 'edit',
@@ -374,7 +373,7 @@
Hooks::run( 'PushAPIAfterPush', array( $title,
$revision, $target, $token, $response ) );
}
else {
- $this->dieUsage( wfMsg( 'push-special-err-push-failed'
), 'page-push-failed' );
+ $this->dieUsage( wfMessage(
'push-special-err-push-failed' )->text(), 'page-push-failed' );
}
}
diff --git a/api/ApiPushImages.php b/api/ApiPushImages.php
index 63048d5..4f9f733 100644
--- a/api/ApiPushImages.php
+++ b/api/ApiPushImages.php
@@ -143,15 +143,15 @@
$this->cookieJars[$target] =
$req->getCookieJar();
}
else {
- $this->dieUsage( wfMsgExt(
'push-err-authentication', 'parsemag', $target, '' ), 'authentication-failed' );
+ $this->dieUsage( wfMessage(
'push-err-authentication', $target, '' )->parse(), 'authentication-failed' );
}
}
else {
- $this->dieUsage( wfMsgExt(
'push-err-authentication', 'parsemag', $target, '' ), 'authentication-failed' );
+ $this->dieUsage( wfMessage(
'push-err-authentication', $target, '' )->parse(), 'authentication-failed' );
}
}
else {
- $this->dieUsage( wfMsgExt( 'push-err-authentication',
'parsemag', $target, '' ), 'authentication-failed' );
+ $this->dieUsage( wfMessage( 'push-err-authentication',
$target, '' )->parse(), 'authentication-failed' );
}
}
@@ -239,11 +239,11 @@
$this->dieUsage(
$response->query->error->message, 'token-request-failed' );
}
else {
- $this->dieUsage( wfMsg(
'push-special-err-token-failed' ), 'token-request-failed' );
+ $this->dieUsage( wfMessage(
'push-special-err-token-failed' )->text(), 'token-request-failed' );
}
}
else {
- $this->dieUsage( wfMsg( 'push-special-err-token-failed'
), 'token-request-failed' );
+ $this->dieUsage( wfMessage(
'push-special-err-token-failed' )->text(), 'token-request-failed' );
}
return $token;
@@ -291,10 +291,10 @@
if ( $egPushDirectFileUploads ) {
if ( !function_exists( 'curl_init' ) ) {
- $this->dieUsage( wfMsg( 'push-api-err-nocurl'
), 'image-push-nocurl' );
+ $this->dieUsage( wfMessage(
'push-api-err-nocurl' )->text(), 'image-push-nocurl' );
}
elseif ( !defined(
'CurlHttpRequest::SUPPORTS_FILE_POSTS' ) ||
!CurlHttpRequest::SUPPORTS_FILE_POSTS ) {
- $this->dieUsage( wfMsg(
'push-api-err-nofilesupport' ), 'image-push-nofilesupport' );
+ $this->dieUsage( wfMessage(
'push-api-err-nofilesupport' )->text(), 'image-push-nofilesupport' );
}
else {
$httpEngine = Http::$httpEngine;
@@ -325,7 +325,7 @@
Hooks::run( 'PushAPIAfterImagePush', array( $title,
$target, $token, $response ) );
}
else {
- $this->dieUsage( wfMsg( 'push-special-err-push-failed'
), 'page-push-failed' );
+ $this->dieUsage( wfMessage(
'push-special-err-push-failed' )->text(), 'page-push-failed' );
}
}
diff --git a/includes/Push_Tab.php b/includes/Push_Tab.php
index cf40938..34192df 100644
--- a/includes/Push_Tab.php
+++ b/includes/Push_Tab.php
@@ -29,7 +29,7 @@
global $wgRequest;
$content_actions['push'] = array(
- 'text' => wfMsg( 'push-tab-text' ),
+ 'text' => wfMessage( 'push-tab-text' )->text(),
'class' => $wgRequest->getVal( 'action' ) ==
'push' ? 'selected' : '',
'href' => $title->getLocalURL( 'action=push' )
);
@@ -105,16 +105,16 @@
public static function displayPushPage( Article $article ) {
global $wgOut, $wgUser, $wgTitle, $wgSitename, $egPushTargets;
- $wgOut->setPageTitle( wfMsgExt( 'push-tab-title', 'parsemag',
$article->getTitle()->getText() ) );
+ $wgOut->setPageTitle( wfmessage( 'push-tab-title',
$article->getTitle()->getText() )->parse() );
if ( !$wgUser->isAllowed( 'push' ) ) {
throw new PermissionsError( 'push' );
}
- $wgOut->addHTML( '<p>' . htmlspecialchars( wfMsg(
'push-tab-desc' ) ) . '</p>' );
+ $wgOut->addHTML( '<p>' . wfMessage( 'push-tab-desc'
)->escaped() . '</p>' );
if ( count( $egPushTargets ) == 0 ) {
- $wgOut->addHTML( '<p>' . htmlspecialchars( wfMsg(
'push-tab-no-targets' ) ) . '</p>' );
+ $wgOut->addHTML( '<p>' . wfMesssage(
'push-tab-no-targets' )->escaped() . '</p>' );
return false;
}
@@ -147,12 +147,12 @@
Html::element(
'th',
array( 'width' => '200px' ),
- wfMsg( 'push-targets' )
+ wfMessage( 'push-targets' )->text()
) .
Html::element(
'th',
array( 'style' => 'min-width:400px;' ),
- wfMsg( 'push-remote-pages' )
+ wfMessage( 'push-remote-pages' )->text()
) .
Html::element(
'th',
@@ -174,7 +174,7 @@
Html::element(
'th',
array( 'colspan' => 2, 'style' =>
'text-align: left' ),
- wfMsgExt( 'push-targets-total',
'parsemag', $wgLang->formatNum( count( $egPushTargets ) ) )
+ wfMessage( 'push-targets-total'
)->numParams( count( $egPushTargets ) )->parse()
) .
Html::rawElement(
'th',
@@ -185,7 +185,7 @@
'id' =>
'push-all-button',
'style' => 'width:
125px; height: 30px',
),
- wfMsg( 'push-button-all' )
+ wfmessage( 'push-button-all'
)->text()
)
)
);
@@ -234,7 +234,7 @@
'rel' => 'nofollow',
'id' => 'targetlink' . $targetId
),
- wfMsgExt( 'push-remote-page-link',
'parsemag', $wgTitle->getFullText(), $name )
+ wfMessage( 'push-remote-page-link',
$wgTitle->getFullText(), $name )->parse()
) .
Html::element(
'div',
@@ -277,7 +277,7 @@
'targetid' => $targetId,
'targetname' => $name
),
- wfMsg( 'push-button-text' )
+ wfMessage( 'push-button-text' )->text()
)
)
);
@@ -291,7 +291,7 @@
protected static function displayPushOptions() {
global $wgOut, $wgUser, $wgTitle;
- $wgOut->addHTML( '<h3>' . htmlspecialchars( wfMsg(
'push-tab-push-options' ) ) . '</h3>' );
+ $wgOut->addHTML( '<h3>' . wfMessage( 'push-tab-push-options'
)->escaped() . '</h3>' );
$usedTemplates = array_keys(
PushFunctions::getTemplates(
@@ -336,15 +336,16 @@
Html::element(
'label',
array( 'id' => 'lblIncTemplates', 'for'
=> 'checkIncTemplates' ),
- wfMsg( 'push-tab-inc-templates' )
+ wfmessage( 'push-tab-inc-templates'
)->text()
) .
' ' .
Html::rawElement(
'div',
array( 'style' => 'display:none;
opacity:0', 'id' => 'txtTemplateList' ),
count( $templates ) > 0 ?
- wfMsgExt(
'push-tab-used-templates', 'parseinline', $wgLang->listToText( $templates ),
count( $templates ) ) :
- htmlspecialchars( wfMsg(
'push-tab-no-used-templates' ) )
+ wfmessage(
'push-tab-used-templates',
+ $wgLang->listToText(
$templates ), count( $templates ) )->parse() :
+ wfMessage(
'push-tab-no-used-templates' )->escaped()
)
)
);
@@ -384,7 +385,7 @@
Html::element(
'label',
array( 'id' => 'lblIncFiles', 'for' =>
'checkIncFiles' ),
- wfMsg( 'push-tab-inc-files' )
+ wfMessage( 'push-tab-inc-files'
)->text()
) .
' ' .
Html::rawElement(
diff --git a/specials/Push_Body.php b/specials/Push_Body.php
index dd4ca71..cfdd555 100644
--- a/specials/Push_Body.php
+++ b/specials/Push_Body.php
@@ -26,7 +26,7 @@
* @see SpecialPage::getDescription
*/
public function getDescription() {
- return wfMsg( 'special-' . strtolower( $this->getName() ) );
+ return $this->msg( 'special-' . strtolower( $this->getName() )
)->text();
}
/**
@@ -61,7 +61,7 @@
}
if ( count( $egPushTargets ) == 0 ) {
- $this->getOutput()->addHTML( '<p>' . htmlspecialchars(
wfMsg( 'push-tab-no-targets' ) ) . '</p>' );
+ $this->getOutput()->addHTML( '<p>' . $this->msg(
'push-tab-no-targets' )->escaped() . '</p>' );
return;
}
@@ -179,7 +179,7 @@
Html::element( 'ul', array( 'id' =>
'pushResultList' ) )
)
) . '<br />' .
- Html::element( 'a', array( 'href' =>
$this->getPageTitle()->getInternalURL() ), wfMsg( 'push-special-return' ) )
+ Html::element( 'a', array( 'href' =>
$this->getPageTitle()->getInternalURL() ), $this->msg( 'push-special-return'
)->text() )
);
$out->addInlineScript(
@@ -205,25 +205,25 @@
$form = Xml::openElement( 'form', array( 'method' => 'post',
'action' => $this->getPageTitle()->getLocalUrl(
'action=submit' ) ) );
- $form .= Xml::inputLabel( wfMsg( 'export-addcattext' ) ,
'catname', 'catname', 40 ) . ' ';
- $form .= Xml::submitButton( wfMsg( 'export-addcat' ), array(
'name' => 'addcat' ) ) . '<br />';
+ $form .= Xml::inputLabel( $this->msg( 'export-addcattext'
)->text() , 'catname', 'catname', 40 ) . ' ';
+ $form .= Xml::submitButton( $this->msg( 'export-addcat'
)->text(), array( 'name' => 'addcat' ) ) . '<br />';
$form .= Html::namespaceSelector( array(
'selected' => $req->getText( 'nsindex', '' ),
'all' => null,
- 'label' => wfMsg( 'export-addnstext' ),
+ 'label' => $this->msg( 'export-addnstext' )->text(),
), array(
'name' => 'nsindex',
'id' => 'namespace',
'class' => 'namespaceselector',
) ) . ' ';
- $form .= Xml::submitButton( wfMsg( 'export-addns' ), array(
'name' => 'addns' ) ) . '<br />';
+ $form .= Xml::submitButton( $this->msg( 'export-addns'
)->text(), array( 'name' => 'addns' ) ) . '<br />';
$form .= Xml::element( 'textarea', array( 'name' => 'pages',
'cols' => 40, 'rows' => 10 ), $pages, false );
$form .= '<br />';
$form .= Xml::checkLabel(
- wfMsg( 'export-templates' ),
+ $this->msg( 'export-templates' )->text(),
'templates',
'wpPushTemplates',
$req->wasPosted() ? $req->getCheck( 'templates' ) :
$egPushIncTemplates
@@ -231,7 +231,7 @@
if ( $this->getUser()->isAllowed( 'filepush' ) ) {
$form .= Xml::checkLabel(
- wfMsg( 'push-special-inc-files' ),
+ $this->msg( 'push-special-inc-files' )->text(),
'files',
'wpPushFiles',
$req->wasPosted() ? $req->getCheck( 'files' ) :
$egPushIncFiles
@@ -240,10 +240,10 @@
if ( count( $egPushTargets ) == 1 ) {
$names = array_keys( $egPushTargets );
- $form .= '<b>' . htmlspecialchars( wfMsgExt(
'push-special-target-is', 'parsemag', $names[0] ) ) . '</b><br />';
+ $form .= '<b>' . $this->msg( 'push-special-target-is',
$names[0] )->parse() . '</b><br />';
}
else {
- $form .= '<b>' . htmlspecialchars( wfMsg(
'push-special-select-targets' ) ) . '</b><br />';
+ $form .= '<b>' . $this->msg(
'push-special-select-targets' )->escaped() . '</b><br />';
foreach ( $egPushTargets as $targetName => $targetUrl )
{
$checkName = str_replace( ' ', '_', $targetName
);
@@ -252,7 +252,7 @@
}
}
- $form .= Xml::submitButton( wfMsg( 'push-special-button-text'
), array( 'style' => 'width: 125px; height: 30px' ) );
+ $form .= Xml::submitButton( $this->msg(
'push-special-button-text' )->text(), array( 'style' => 'width: 125px; height:
30px' ) );
$form .= Xml::closeElement( 'form' );
$this->getOutput()->addHTML( $form );
--
To view, visit https://gerrit.wikimedia.org/r/262062
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I75db3c9e7e4d63efa903d3c0c1f9ca69fd8e5123
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Push
Gerrit-Branch: master
Gerrit-Owner: Florianschmidtwelzow <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits