Sn1per has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/181794

Change subject: Replace deprecated wfMsg*
......................................................................

Replace deprecated wfMsg*

 - Replaces wfMsg* calls

Bug: T70750
Change-Id: I86667acb284b239b66bdbec3a87007f5ff11deec
---
M Duplicator.page.php
M Duplicator.php
2 files changed, 18 insertions(+), 18 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Duplicator 
refs/changes/94/181794/1

diff --git a/Duplicator.page.php b/Duplicator.page.php
index 424d944..2395203 100644
--- a/Duplicator.page.php
+++ b/Duplicator.page.php
@@ -112,8 +112,8 @@
                # Attempt to perform the main duplicate op. first
                $num = $this->duplicate( $this->sourceTitle, $this->destTitle, 
$this->history );
                if( $num ) {
-                       $success = '* ' . wfMsgNoTrans( 'duplicator-success', 
$this->sourceTitle->getPrefixedText(), $this->destTitle->getPrefixedText() );
-                       $success .= ' ' . wfMsgNoTrans( 
'duplicator-success-revisions', $wgLang->formatNum( $num ) ) . "\n";
+                       $success = '* ' . wfMessage( 'duplicator-success', 
$this->sourceTitle->getPrefixedText(), $this->destTitle->getPrefixedText() 
)->plain();
+                       $success .= ' ' . wfMessage( 
'duplicator-success-revisions', $wgLang->formatNum( $num ) )->plain() . "\n";
                        # If there are subpages and we've been asked to 
duplicate them, do so
                        if ( $this->subpages ) {
                                $success .= $this->duplicateSubpages( 
$this->sourceTitle, $this->destTitle, $this->history );
@@ -124,13 +124,13 @@
                                $dt = $this->destTitle->getTalkPage();
                                $num = $this->duplicate( $st, $dt, 
$this->history );
                                if ( $num ) {
-                                       $success .= '* ' . wfMsgNoTrans( 
'duplicator-success', $st->getPrefixedText(), $dt->getPrefixedText() );
-                                       $success .= ' ' . wfMsgNoTrans( 
'duplicator-success-revisions', $wgLang->formatNum( $num ) ) . "\n";
+                                       $success .= '* ' . wfMessage( 
'duplicator-success', $st->getPrefixedText(), $dt->getPrefixedText() )->plain();
+                                       $success .= ' ' . wfMessage( 
'duplicator-success-revisions', $wgLang->formatNum( $num ) )->plain() . "\n";
                                        if ( $this->subpages ) {
                                                $success .= 
$this->duplicateSubpages( $st, $dt, $this->history );
                                        }
                                } else {
-                                       $success .= '* ' . wfMsgNoTrans( 
'duplicator-success-talknotcopied' ) . "\n";
+                                       $success .= '* ' . wfMessage( 
'duplicator-success-talknotcopied' )->plain() . "\n";
                                }
                        }
                        # Report success to the user
@@ -190,26 +190,26 @@
                $source = is_object( $this->sourceTitle ) ? 
$this->sourceTitle->getPrefixedText() : $this->source;
                $dest = is_object( $this->destTitle ) ? 
$this->destTitle->getPrefixedText() : $this->dest;
                $form  = '<form method="post" action="' . $self->getLocalUrl() 
. '">';
-               $form .= '<fieldset><legend>' . wfMsgHtml( 'duplicator-options' 
) . '</legend>';
+               $form .= '<fieldset><legend>' . wfMessage( 'duplicator-options' 
)->escaped() . '</legend>';
                $form .= '<table>';
                $form .= '<tr>';
-               $form .= '<td><label for="source">' . wfMsgHtml( 
'duplicator-source' ) . '</label></td>';
+               $form .= '<td><label for="source">' . wfMessage( 
'duplicator-source' )->escaped() . '</label></td>';
                $form .= '<td>' . Xml::input( 'source', 40, $source, array( 
'id' => 'source' ) ) . '</td>';
                $form .= '</tr><tr>';
-               $form .= '<td><label for="dest">' . wfMsgHtml( 
'duplicator-dest' ) . '</label></td>';
+               $form .= '<td><label for="dest">' . wfMessage( 
'duplicator-dest' )->escaped() . '</label></td>';
                $form .= '<td>' . Xml::input( 'dest', 40, $dest, array( 'id' => 
'dest' ) ) . '</td>';
                $form .= '</tr><tr>';
                $form .= '<td>&#160;</td>';
-               $form .= '<td>' . Xml::checkLabel( wfMsg( 'duplicator-dotalk' 
), 'talk', 'talk', $this->talk ) . '</td>';
+               $form .= '<td>' . Xml::checkLabel( wfMessage( 
'duplicator-dotalk' )->text(), 'talk', 'talk', $this->talk ) . '</td>';
                $form .= '</tr><tr>';
                $form .= '<td>&#160;</td>';
-               $form .= '<td>' . Xml::checkLabel( wfMsg( 
'duplicator-dosubpages' ), 'subpages', 'subpages', $this->subpages ) . '</td>';
+               $form .= '<td>' . Xml::checkLabel( wfMessage( 
'duplicator-dosubpages' )->text(), 'subpages', 'subpages', $this->subpages ) . 
'</td>';
                $form .= '</tr><tr>';
                $form .= '<td>&#160;</td>';
-               $form .= '<td>' . Xml::checkLabel( wfMsg( 
'duplicator-dohistory' ), 'history', 'history', $this->history ) . '</td>';
+               $form .= '<td>' . Xml::checkLabel( wfMessage( 
'duplicator-dohistory' )->text(), 'history', 'history', $this->history ) . 
'</td>';
                $form .= '</tr><tr>';
                $form .= '<td>&#160;</td>';
-               $form .= '<td>' . Xml::submitButton( wfMsg( 'duplicator-submit' 
) ) . '</td>';
+               $form .= '<td>' . Xml::submitButton( wfMessage( 
'duplicator-submit' )->text() ) . '</td>';
                $form .= '</tr>';
                $form .= '</table>';
                $form .= Html::Hidden( 'token', $wgUser->getEditToken( 
'duplicator' ) );
@@ -235,15 +235,15 @@
                        $destSub = Title::makeTitleSafe( $ns, $dest . substr( 
$sub->getText(), $len ) );
                        if ( $destSub ) {
                                if ( $destSub->exists() ) {
-                                       $success .= '* ' . wfMsgNoTrans( 
'duplicator-failed-dest-exists', $sub->getPrefixedText(), 
$destSub->getPrefixedText() ) . "\n";
+                                       $success .= '* ' . wfMessage( 
'duplicator-failed-dest-exists', $sub->getPrefixedText(), 
$destSub->getPrefixedText() )->plain() . "\n";
                                } else {
                                        $num = $this->duplicate( $sub, 
$destSub, $this->history );
-                                       $success .= '* ' . wfMsgNoTrans( 
'duplicator-success', $sub->getPrefixedText(), $destSub->getPrefixedText() );
-                                       $success .= ' ' . wfMsgNoTrans( 
'duplicator-success-revisions', $wgLang->formatNum( $num ) ) . "\n";
+                                       $success .= '* ' . wfMessage( 
'duplicator-success', $sub->getPrefixedText(), $destSub->getPrefixedText() 
)->plain();
+                                       $success .= ' ' . wfMessage( 
'duplicator-success-revisions', $wgLang->formatNum( $num ) )->plain() . "\n";
                                }
                        } else {
                                # Bad title error can only occur here because 
of the destination title being too long
-                               $success .= '* ' . wfMsgNoTrans( 
'duplicator-failed-toolong', $sub->getPrefixedText() ) . "\n";
+                               $success .= '* ' . wfMessage( 
'duplicator-failed-toolong', $sub->getPrefixedText() )->plain() . "\n";
                        }
                }
                return $success;
@@ -280,7 +280,7 @@
                if( $res && ( $count = $dbw->numRows( $res ) ) > 0 ) {
                        while( $row = $dbw->fetchObject( $res ) ) {
                                if( !$comment ) {
-                                       $comment = wfMsgForContent( 
'duplicator-summary', $source->getPrefixedText(), $row->rev_id );
+                                       $comment = wfMessage( 
'duplicator-summary', $source->getPrefixedText(), $row->rev_id 
)->inContentLanguage()->text();
                                }
                                $values['rev_page'] = $aid;
                                $values['rev_text_id'] = $row->rev_text_id;
diff --git a/Duplicator.php b/Duplicator.php
index 5f9706d..18e0be8 100644
--- a/Duplicator.php
+++ b/Duplicator.php
@@ -64,7 +64,7 @@
        if( ( $ns === NS_MAIN || $ns === NS_TALK ) && $wgUser->isAllowed( 
'duplicate' ) ) {
 
                $nav_urls['duplicator'] = array(
-                       'text' => wfMsg( 'duplicator-toolbox' ),
+                       'text' => wfMessage( 'duplicator-toolbox' )->text(),
                        'href' => $skin->makeSpecialUrl( 'Duplicator', 
"source=" . wfUrlEncode( "{$skin->thispage}" ) )
                );
        }

-- 
To view, visit https://gerrit.wikimedia.org/r/181794
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I86667acb284b239b66bdbec3a87007f5ff11deec
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Duplicator
Gerrit-Branch: master
Gerrit-Owner: Sn1per <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to