Florianschmidtwelzow has uploaded a new change for review.

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

Change subject: Replace wfMsg* and friends
......................................................................

Replace wfMsg* and friends

Bug: T70750
Change-Id: Ia9c931b6528edb03b62ada4aeb416371fb45bfa0
---
M SpecialWikilog.php
M Wikilog.php
M WikilogComment.php
M WikilogCommentsPage.php
M WikilogItemPage.php
M WikilogItemPager.php
M WikilogMainPage.php
M WikilogParser.php
M WikilogUtils.php
9 files changed, 132 insertions(+), 132 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikilog 
refs/changes/57/262057/1

diff --git a/SpecialWikilog.php b/SpecialWikilog.php
index 5729423..2310bfb 100644
--- a/SpecialWikilog.php
+++ b/SpecialWikilog.php
@@ -204,8 +204,7 @@
                                        'rel' => 'alternate',
                                        'href' => $title->getLocalURL( 
$altquery ),
                                        'type' => $wgMimeType,
-                                       'title' => wfMsgExt( 
"wikilog-view-{$alt}",
-                                               array( 'content', 'parsemag' ) )
+                                       'title' => $this->msg( 
"wikilog-view-{$alt}" )->inContentLanguage()->parse()
                                ) );
                        }
                }
@@ -227,7 +226,7 @@
         * and also the name that will be listed in Special:Specialpages.
         */
        public function getDescription() {
-               return wfMsg( 'wikilog-specialwikilog-title' );
+               return $this->msg( 'wikilog-specialwikilog-title' )->text();
        }
 
        /**
@@ -296,7 +295,7 @@
                }
 
                $out = Xml::tags( 'form', array( 'action' => $wgScript ), $out 
);
-               $out = Xml::fieldset( wfMsg( 'wikilog-form-legend' ), $out,
+               $out = Xml::fieldset( $this->msg( 'wikilog-form-legend' 
)->text(), $out,
                        array( 'class' => 'wl-options' )
                );
                return $out;
@@ -351,44 +350,44 @@
                $fields = array();
 
                $fields['wikilog'] = Xml::inputLabelSep(
-                       wfMsg( 'wikilog-form-wikilog' ), 'wikilog', 
'wl-wikilog', 40,
+                       $this->msg( 'wikilog-form-wikilog' )->text(), 
'wikilog', 'wl-wikilog', 40,
                        str_replace( '_', ' ', $opts->consumeValue( 'wikilog' ) 
)
                );
 
                $fields['category'] = Xml::inputLabelSep(
-                       wfMsg( 'wikilog-form-category' ), 'category', 
'wl-category', 40,
+                       $this->msg( 'wikilog-form-category' )->text(), 
'category', 'wl-category', 40,
                        str_replace( '_', ' ', $opts->consumeValue( 'category' 
) )
                );
 
                $fields['author'] = Xml::inputLabelSep(
-                       wfMsg( 'wikilog-form-author' ), 'author', 'wl-author', 
40,
+                       $this->msg( 'wikilog-form-author' )->text(), 'author', 
'wl-author', 40,
                        str_replace( '_', ' ', $opts->consumeValue( 'author' ) )
                );
 
                if ( $wgWikilogEnableTags ) {
                        $fields['tag'] = Xml::inputLabelSep(
-                               wfMsg( 'wikilog-form-tag' ), 'tag', 'wl-tag', 
40,
+                               $this->msg( 'wikilog-form-tag' )->text(), 
'tag', 'wl-tag', 40,
                                str_replace( '_', ' ', $opts->consumeValue( 
'tag' ) )
                        );
                }
 
                $fields['date'] = array(
-                       Xml::label( wfMsg( 'wikilog-form-date' ), 'wl-month' ),
+                       Xml::label( $this->msg( 'wikilog-form-date' )->text(), 
'wl-month' ),
                        Xml::monthSelector( $opts->consumeValue( 'month' ), '', 
'wl-month' ) .
                                " " . Xml::input( 'year', 4, 
$opts->consumeValue( 'year' ), array( 'maxlength' => 4 ) )
                );
                $opts->consumeValue( 'day' );   // ignore day, not really useful
 
                $statusSelect = new XmlSelect( 'show', 'wl-status', 
$opts->consumeValue( 'show' ) );
-               $statusSelect->addOption( wfMsg( 'wikilog-show-all' ), 'all' );
-               $statusSelect->addOption( wfMsg( 'wikilog-show-published' ), 
'published' );
-               $statusSelect->addOption( wfMsg( 'wikilog-show-drafts' ), 
'drafts' );
+               $statusSelect->addOption( $this->msg( 'wikilog-show-all' 
)->text(), 'all' );
+               $statusSelect->addOption( $this->msg( 'wikilog-show-published' 
)->text(), 'published' );
+               $statusSelect->addOption( $this->msg( 'wikilog-show-drafts' 
)->text(), 'drafts' );
                $fields['status'] = array(
-                       Xml::label( wfMsg( 'wikilog-form-status' ), 'wl-status' 
),
+                       Xml::label( $this->msg( 'wikilog-form-status' 
)->text(), 'wl-status' ),
                        $statusSelect->getHTML()
                );
 
-               $fields['submit'] = Xml::submitbutton( wfMsg( 'allpagessubmit' 
) );
+               $fields['submit'] = Xml::submitbutton( $this->msg( 
'allpagessubmit' )->text() );
                return $fields;
        }
 
diff --git a/Wikilog.php b/Wikilog.php
index 7446339..a57be21 100644
--- a/Wikilog.php
+++ b/Wikilog.php
@@ -387,7 +387,7 @@
                if ( $wi->isMain() && $skin->getTitle()->quickUserCan( 'edit' ) 
) {
                        $views['wikilog'] = array(
                                'class' => ( $action == 'wikilog' ) ? 
'selected' : false,
-                               'text' => wfMsg( 'wikilog-tab' ),
+                               'text' => wfMessage( 'wikilog-tab' )->text(),
                                'href' => $skin->getTitle()->getLocalUrl( 
'action=wikilog' )
                        );
                }
diff --git a/WikilogComment.php b/WikilogComment.php
index f5d9c82..41caceb 100644
--- a/WikilogComment.php
+++ b/WikilogComment.php
@@ -266,9 +266,9 @@
                global $wgContLang;
                $user = $this->mUserID ? $this->mUserText : $this->mAnonName;
                $summ = $wgContLang->truncate( str_replace( "\n", ' ', 
$this->mText ),
-                       max( 0, 200 - strlen( wfMsgForContent( 
'wikilog-comment-autosumm' ) ) ),
+                       max( 0, 200 - strlen( wfMessage( 
'wikilog-comment-autosumm' )->inContentLanguage()->text() ) ),
                        '...' );
-               return wfMsgForContent( 'wikilog-comment-autosumm', $user, 
$summ );
+               return wfMessage( 'wikilog-comment-autosumm', $user, $summ 
)->inContentLanguage()->text();
        }
 
        /**
@@ -603,7 +603,7 @@
 
                if ( !$comment->isVisible() && !$this->mAllowModeration ) {
                        # Placeholder.
-                       $status = wfMsg( "wikilog-comment-{$hidden}" );
+                       $status = wfMessage( "wikilog-comment-{$hidden}" 
)->escaped();
                        $html = WikilogUtils::wrapDiv( 
'wl-comment-placeholder', $status );
                } else {
                        # The comment.
@@ -650,10 +650,10 @@
                if ( !$comment->isVisible() ) {
                        # If comment is not visible to non-moderators, make 
note of it.
                        $hidden = WikilogComment::$statusMap[ $comment->mStatus 
];
-                       $status = WikilogUtils::wrapDiv( 'wl-comment-status', 
wfMsg( "wikilog-comment-{$hidden}" ) );
+                       $status = WikilogUtils::wrapDiv( 'wl-comment-status', 
wfMessage( "wikilog-comment-{$hidden}" )->escaped() );
                }
 
-               $header = wfMsgExt( 'wikilog-comment-header', array( 'content', 
'parsemag', 'replaceafter' ), $params );
+               $header = wfMessage( 'wikilog-comment-header' )->rawParams( 
$params )->inContentLanguage()->parse();
                if ( $header ) {
                        $header = WikilogUtils::wrapDiv( 'wl-comment-header', 
$header );
                }
@@ -671,7 +671,10 @@
         * @return HTML-formatted comment footer.
         */
        public function formatCommentFooter( $comment, $params ) {
-               $footer = wfMsgExt( 'wikilog-comment-footer', array( 'content', 
'parsemag', 'replaceafter' ), $params );
+               $footer = wfMessage( 'wikilog-comment-footer' )
+                       ->rawParams( $params )
+                       ->inContentLanguage()
+                       ->parse();
                if ( $footer ) {
                        return WikilogUtils::wrapDiv( 'wl-comment-footer', 
$footer );
                } else {
@@ -690,7 +693,7 @@
         * 300+ languages suported by MediaWiki.
         *
         * Parameters should be HTML-formated. They are substituded using
-        * 'replaceafter' parameter to wfMsgExt().
+        * 'replaceafter' parameter to wfMessage().
         *
         * @param $comment Comment.
         * @return Array with message parameters.
@@ -700,19 +703,19 @@
 
                if ( $comment->mUserID ) {
                        $authorPlain = htmlspecialchars( $comment->mUserText );
-                       $authorFmt = wfMsgExt( 'wikilog-simple-signature',
-                               array( 'content', 'parseinline', 'replaceafter' 
),
+                       $authorFmt = wfMessage( 'wikilog-simple-signature' )
+                       ->rawParams( array(
                                Xml::wrapClass( Linker::userLink( 
$comment->mUserID, $comment->mUserText ), 'wl-comment-author' ),
                                Linker::userTalkLink( $comment->mUserID, 
$comment->mUserText ),
                                $comment->mUserText
-                       );
+                       ) )->inContentLanguage()->parse();
                } else {
                        $authorPlain = htmlspecialchars( $comment->mAnonName );
-                       $authorFmt = wfMsgForContent( 'wikilog-comment-anonsig',
+                       $authorFmt = wfMessage( 'wikilog-comment-anonsig',
                                Xml::wrapClass( Linker::userLink( 
$comment->mUserID, $comment->mUserText ), 'wl-comment-author' ),
                                Linker::userTalkLink( $comment->mUserID, 
$comment->mUserText ),
                                htmlspecialchars( $comment->mAnonName )
-                       );
+                       )->inContentLanguage()->text();
                }
 
                list( $date, $time, $tz ) = WikilogUtils::getLocalDateTime( 
$comment->mTimestamp );
@@ -721,9 +724,9 @@
                $extra = array();
                if ( $this->mShowItem && $comment->mItem ) {
                        # Display item title.
-                       $extra[] = wfMsgForContent( 'wikilog-comment-note-item',
+                       $extra[] = wfMessage( 'wikilog-comment-note-item',
                                Linker::link( $comment->mItem->mTitle, 
$comment->mItem->mName )
-                       );
+                       )->inContentLanguage()->text();
                }
                if ( $comment->mID && $comment->mCommentTitle &&
                                $comment->mCommentTitle->exists() )
@@ -732,14 +735,18 @@
                                # Comment was edited.
                                list( $updDate, $updTime, $updTz ) = 
WikilogUtils::getLocalDateTime( $comment->mUpdated );
                                $extra[] = Linker::link( 
$comment->mCommentTitle,
-                                       wfMsgForContent( 
'wikilog-comment-note-edited', $updDate, $updTime, $updTz ),
-                                       array( 'title' => wfMsg( 
'wikilog-comment-history' ) ),
+                                       wfMessage( 
'wikilog-comment-note-edited', $updDate, $updTime, $updTz )
+                                               ->inContentLanguage()
+                                               ->text(),
+                                       array( 'title' => wfmessage( 
'wikilog-comment-history' )->escaped() ),
                                        array( 'action' => 'history' ), 'known'
                                );
                        }
                }
                if ( $extra ) {
-                       $extra = wfMsgForContent( 'parentheses', 
$wgContLang->pipeList( $extra ) );
+                       $extra = wfMessage( 'parentheses', 
$wgContLang->pipeList( $extra ) )
+                               ->inContentLanguage()
+                               ->text();
                } else {
                        $extra = "";
                }
@@ -799,7 +806,7 @@
 
                # Create omitted comment thread(s).
                for ( ; $i < $thread-1; $i++ ) {
-                       $msg = wfMsgExt( 'wikilog-comment-omitted-x', array( 
'parseinline' ), $comment->mThread[$i] );
+                       $msg = wfMessage( 'wikilog-comment-omitted-x', 
$comment->mThread[$i] )->parse();
                        $msg = WikilogUtils::wrapDiv( 'wl-comment-placeholder', 
$msg );
                        $msg = WikilogUtils::wrapDiv( 'wl-comment 
wl-comment-omitted', $msg );
                        $html .= '<div class="wl-thread">' . $msg;
@@ -840,11 +847,11 @@
                                $title = $comment->mCommentTitle;
                        }
                        return Linker::link( $title,
-                               wfMsg( 'wikilog-comment-permalink', $date, 
$time, $tz ),
-                               array( 'title' => wfMsg( 'permalink' ) )
+                               wfMessage( 'wikilog-comment-permalink', $date, 
$time, $tz )->escaped(),
+                               array( 'title' => wfMessage( 'permalink' 
)->escaped() )
                        );
                } else {
-                       return wfMsg( 'wikilog-comment-permalink', $date, 
$time, $tz );
+                       return wfMessage( 'wikilog-comment-permalink', $date, 
$time, $tz )->escaped();
                }
        }
 
@@ -867,17 +874,17 @@
                                );
                                $tools['reply'] = Xml::tags( 'a',
                                        array(
-                                               'title' => wfMsg( 
'wikilog-reply-to-comment' ),
+                                               'title' => wfMessage( 
'wikilog-reply-to-comment' )->escaped(),
                                                'href' => $replyUrl
                                        ),
-                                       wfMsg( 'wikilog-reply-lc' )
+                                       wfMessage( 'wikilog-reply-lc' 
)->escaped()
                                );
                        }
                        if ( $this->mAllowModeration && $comment->mStatus == 
WikilogComment::S_PENDING ) {
                                $token = $wgUser->getEditToken();
                                $tools['approve'] = Linker::link( 
$comment->mCommentTitle,
-                                       wfMsg( 'wikilog-approve-lc' ),
-                                       array( 'title' => wfMsg( 
'wikilog-comment-approve' ) ),
+                                       wfMessage( 'wikilog-approve-lc' 
)->escaped(),
+                                       array( 'title' => efMessage( 
'wikilog-comment-approve' )->escaped() ),
                                        array(
                                                'action' => 'wikilog',
                                                'wlActionCommentApprove' => 
'approve',
@@ -886,8 +893,8 @@
                                        'known'
                                );
                                $tools['reject'] = Linker::link( 
$comment->mCommentTitle,
-                                       wfMsg( 'wikilog-reject-lc' ),
-                                       array( 'title' => wfMsg( 
'wikilog-comment-reject' ) ),
+                                       wfMessage( 'wikilog-reject-lc' 
)->escaped(),
+                                       array( 'title' => wfMessage( 
'wikilog-comment-reject' )->escaped() ),
                                        array(
                                                'action' => 'wikilog',
                                                'wlActionCommentApprove' => 
'reject',
@@ -898,24 +905,24 @@
                        }
                        if ( $this->mAllowModeration ) {
                                $tools['page'] = Linker::link( 
$comment->mCommentTitle,
-                                       wfMsg( 'wikilog-page-lc' ),
-                                       array( 'title' => wfMsg( 
'wikilog-comment-page' ) ),
+                                       wfmessage( 'wikilog-page-lc' 
)->escaped(),
+                                       array( 'title' => wfMessage( 
'wikilog-comment-page' )->escaped() ),
                                        array(),
                                        'known'
                                );
                        }
                        if ( $comment->mCommentTitle->quickUserCan( 'edit' ) ) {
                                $tools['edit'] = Linker::link( 
$comment->mCommentTitle,
-                                       wfMsg( 'wikilog-edit-lc' ),
-                                       array( 'title' => wfMsg( 
'wikilog-comment-edit' ) ),
+                                       wfMessage( 'wikilog-edit-lc' 
)->escaped(),
+                                       array( 'title' => wfMessage( 
'wikilog-comment-edit' )->escaped() ),
                                        array( 'action' => 'edit' ),
                                        'known'
                                );
                        }
                        if ( $comment->mCommentTitle->quickUserCan( 'delete' ) 
) {
                                $tools['delete'] = Linker::link( 
$comment->mCommentTitle,
-                                       wfMsg( 'wikilog-delete-lc' ),
-                                       array( 'title' => wfMsg( 
'wikilog-comment-delete' ) ),
+                                       wfMessage( 'wikilog-delete-lc' 
)->escaped(),
+                                       array( 'title' => wfMessage( 
'wikilog-comment-delete' )->escaped() ),
                                        array( 'action' => 'delete' ),
                                        'known'
                                );
diff --git a/WikilogCommentsPage.php b/WikilogCommentsPage.php
index 5013259..351f5ec 100644
--- a/WikilogCommentsPage.php
+++ b/WikilogCommentsPage.php
@@ -147,20 +147,20 @@
 
                        # Set a more human-friendly title to the comments page.
                        # NOTE (MW1.16+): Must come after parent::view().
-                       # Note: Sorry for the three-level cascade of 
wfMsg()'s...
-                       $fullPageTitle = wfMsg( 'wikilog-title-item-full',
+                       # Note: Sorry for the three-level cascade of 
wfMessage()'s...
+                       $fullPageTitle = wfMessage( 'wikilog-title-item-full',
                                $this->mItem->mName,
                                $this->mItem->mParentTitle->getPrefixedText()
-                       );
-                       $fullPageTitle = wfMsg( 'wikilog-title-comments', 
$fullPageTitle );
-                       $wgOut->setPageTitle( wfMsg( 'wikilog-title-comments', 
$this->mItem->mName ) );
-                       $wgOut->setHTMLTitle( wfMsg( 'pagetitle', 
$fullPageTitle ) );
+                       )->text();
+                       $fullPageTitle = wfMessage( 'wikilog-title-comments', 
$fullPageTitle )->text();
+                       $wgOut->setPageTitle( wfMessage( 
'wikilog-title-comments', $this->mItem->mName ) );
+                       $wgOut->setHTMLTitle( wfMessage( 'pagetitle', 
$fullPageTitle ) );
                }
 
                # Add a backlink to the original article.
                $link = Linker::link( $this->mItem->mTitle,
                        Sanitizer::escapeHtmlAllowEntities( $this->mItem->mName 
) );
-               $wgOut->setSubtitle( wfMsg( 'wikilog-backlink', $link ) );
+               $wgOut->setSubtitle( wfMessage( 'wikilog-backlink', $link 
)->text() );
 
                # Retrieve comments (or replies) from database and display them.
                $this->viewComments( $query );
@@ -199,7 +199,7 @@
 
                # Comments/Replies header.
                $header = Xml::tags( 'h2', array( 'id' => 'wl-comments-header' 
),
-                       wfMsgExt( $headerMsg, array( 'parseinline' ) )
+                       wfMessage( $headerMsg )->parse()
                );
                $wgOut->addHtml( $header );
 
@@ -301,11 +301,11 @@
                if ( $comment && $comment->mParent == $pid ) {
                        $check = $this->validateComment( $comment );
                        if ( $check ) {
-                               $preview = Xml::wrapClass( wfMsg( $check ), 
'mw-warning', 'div' );
+                               $preview = Xml::wrapClass( wfMessage( $check 
)->text(), 'mw-warning', 'div' );
                        } else {
                                $preview = $this->mFormatter->formatComment( 
$this->mPostedComment );
                        }
-                       $header = wfMsgHtml( 'wikilog-form-preview' );
+                       $header = wfMessage( 'wikilog-form-preview' 
)->escaped();
                        $preview = "<b>{$header}</b>{$preview}<hr/>";
                }
 
@@ -319,18 +319,18 @@
 
                if ( $wgUser->isLoggedIn() ) {
                        $fields[] = array(
-                               wfMsg( 'wikilog-form-name' ),
+                               wfMessage( 'wikilog-form-name' )->text(),
                                Linker::userLink( $wgUser->getId(), 
$wgUser->getName() )
                        );
                } else {
                        $loginTitle = SpecialPage::getTitleFor( 'Userlogin' );
                        $loginLink = Linker::link( $loginTitle,
-                               wfMsgHtml( 'loginreqlink' ), array(),
+                               wfMessage( 'loginreqlink' )->escaped(), array(),
                                array( 'returnto' => 
$this->getTitle()->getPrefixedUrl() )
                        );
-                       $message = wfMsg( 'wikilog-posting-anonymously', 
$loginLink );
+                       $message = wfMessage( 'wikilog-posting-anonymously', 
$loginLink )->text();
                        $fields[] = array(
-                               Xml::label( wfMsg( 'wikilog-form-name' ), 
'wl-name' ),
+                               Xml::label( wfMessage( 'wikilog-form-name' 
)->text(), 'wl-name' ),
                                Xml::input( 'wlAnonName', 25, 
$opts->consumeValue( 'wlAnonName' ),
                                        array( 'id' => 'wl-name', 'maxlength' 
=> 255 ) ) .
                                        "<p>{$message}</p>"
@@ -339,7 +339,7 @@
 
                $autofocus = $parent ? array( 'autofocus' => 'autofocus' ) : 
array();
                $fields[] = array(
-                       Xml::label( wfMsg( 'wikilog-form-comment' ), 
'wl-comment' ),
+                       Xml::label( wfMessage( 'wikilog-form-comment' 
)->text(), 'wl-comment' ),
                        Xml::textarea( 'wlComment', $opts->consumeValue( 
'wlComment' ),
                                40, 5, array( 'id' => 'wl-comment' ) + 
$autofocus )
                );
@@ -349,12 +349,12 @@
                }
 
                if ( $wgWikilogModerateAnonymous && $wgUser->isAnon() ) {
-                       $fields[] = array( '', wfMsg( 
'wikilog-anonymous-moderated' ) );
+                       $fields[] = array( '', wfMessage( 
'wikilog-anonymous-moderated' )->text() );
                }
 
                $fields[] = array( '',
-                       Xml::submitbutton( wfMsg( 'wikilog-submit' ), array( 
'name' => 'wlActionCommentSubmit' ) ) . WL_NBSP .
-                       Xml::submitbutton( wfMsg( 'wikilog-preview' ), array( 
'name' => 'wlActionCommentPreview' ) )
+                       Xml::submitbutton( wfMessage( 'wikilog-submit' 
)->text(), array( 'name' => 'wlActionCommentSubmit' ) ) . WL_NBSP .
+                       Xml::submitbutton( wfMessage( 'wikilog-preview' 
)->text(), array( 'name' => 'wlActionCommentPreview' ) )
                );
 
                $form .= WikilogUtils::buildForm( $fields );
@@ -369,7 +369,7 @@
                ), $form );
 
                $msgid = ( $parent ? 'wikilog-post-reply' : 
'wikilog-post-comment' );
-               return Xml::fieldset( wfMsg( $msgid ), $preview . $form,
+               return Xml::fieldset( wfMessage( $msgid )->text(), $preview . 
$form,
                        array( 'id' => 'wl-comment-form' ) ) . "\n";
        }
 
@@ -395,17 +395,16 @@
                        $log->addEntry( 'c-approv', $title, '' );
                        $wgOut->redirect( $this->mTalkTitle->getFullUrl() );
                } elseif ( $approval == 'reject' ) {
-                       $reason = wfMsgExt( 'wikilog-log-cmt-rejdel',
-                               array( 'content', 'parsemag' ),
-                               $comment->mUserText
-                       );
+                       $reason = wfMessage( 'wikilog-log-cmt-rejdel', 
$comment->mUserText )
+                               ->inContentLanguage()
+                               ->parse();
                        if ( $this->doDeleteArticle( $reason, false ) ) {
                                $comment->deleteComment();
                                $log->addEntry( 'c-reject', $title, '' );
                                $wgOut->redirect( 
$this->mTalkTitle->getFullUrl() );
                        } else {
                                $log = new LogPage( 'delete' );
-                               $wgOut->showFatalError( wfMsgExt( 
'cannotdelete', array( 'parse' ) ) );
+                               $wgOut->showFatalError( wfMessage( 
'cannotdelete' )->parse() );
                                $wgOut->addHTML( Xml::element( 'h2', null, 
$log->getName() ) );
                                LogEventsList::showLogExtract( $wgOut, 
'delete', $this->mTitle->getPrefixedText() );
                        }
@@ -450,10 +449,10 @@
 
                if ( !$this->exists() ) {
                        # Initialize a blank talk page.
-                       $user = User::newFromName( wfMsgForContent( 
'wikilog-auto' ), false );
+                       $user = User::newFromName( wfMessage( 'wikilog-auto' 
)->inContentLanguage()->text(), false );
                        $this->doEdit(
-                               wfMsgForContent( 'wikilog-newtalk-text' ),
-                               wfMsgForContent( 'wikilog-newtalk-summary' ),
+                               wfMessage( 'wikilog-newtalk-text' 
)->inContentLanguage()->text(),
+                               wfMessage( 'wikilog-newtalk-summary' 
)->inContentLanguage()->text(),
                                EDIT_NEW | EDIT_SUPPRESS_RC, false, $user
                        );
                }
diff --git a/WikilogItemPage.php b/WikilogItemPage.php
index a63aba1..d450629 100644
--- a/WikilogItemPage.php
+++ b/WikilogItemPage.php
@@ -80,10 +80,9 @@
                        $params = $this->mItem->getMsgParams( true );
 
                        # Set page subtitle
-                       $subtitleTxt = wfMsgExt( 'wikilog-entry-sub',
-                               array( 'parsemag', 'content' ),
+                       $subtitleTxt = wfMessage( 'wikilog-entry-sub',
                                $params
-                       );
+                       )->inContentLanguage()->parse();
                        if ( !empty( $subtitleTxt ) ) {
                                $wgOut->setSubtitle( $wgOut->parse( 
$subtitleTxt ) );
                        }
@@ -94,10 +93,9 @@
                        }
 
                        # Item page header.
-                       $headerTxt = wfMsgExt( 'wikilog-entry-header',
-                               array( 'parse', 'content' ),
+                       $headerTxt = wfMessage( 'wikilog-entry-header',
                                $params
-                       );
+                       )->inContentLanguage()->parse();
                        if ( !empty( $headerTxt ) ) {
                                $wgOut->addHtml( WikilogUtils::wrapDiv( 
'wl-entry-header', $headerTxt ) );
                        }
@@ -107,18 +105,17 @@
 
                        # Override page title.
                        # NOTE (MW1.16+): Must come after parent::view().
-                       $fullPageTitle = wfMsg( 'wikilog-title-item-full',
+                       $fullPageTitle = wfMessage( 'wikilog-title-item-full',
                                        $this->mItem->mName,
                                        
$this->mItem->mParentTitle->getPrefixedText()
-                       );
+                       )->text();
                        $wgOut->setPageTitle( 
Sanitizer::escapeHtmlAllowEntities( $this->mItem->mName ) );
-                       $wgOut->setHTMLTitle( wfMsg( 'pagetitle', 
$fullPageTitle ) );
+                       $wgOut->setHTMLTitle( wfMessage( 'pagetitle', 
$fullPageTitle ) );
 
                        # Item page footer.
-                       $footerTxt = wfMsgExt( 'wikilog-entry-footer',
-                               array( 'parse', 'content' ),
+                       $footerTxt = wfMessage( 'wikilog-entry-footer',
                                $params
-                       );
+                       )->inContentLanguage()->parse();
                        if ( !empty( $footerTxt ) ) {
                                $wgOut->addHtml( WikilogUtils::wrapDiv( 
'wl-entry-footer', $footerTxt ) );
                        }
@@ -129,11 +126,10 @@
                                        $wgOut->addLink( array(
                                                'rel' => 'alternate',
                                                'type' => 
"application/{$format}+xml",
-                                               'title' => wfMsgExt(
+                                               'title' => wfMessage(
                                                        "page-{$format}-feed",
-                                                       array( 'content', 
'parsemag' ),
                                                        
$this->mItem->mParentTitle->getPrefixedText()
-                                               ),
+                                               )->inContentLanguage()->parse(),
                                                'href' => 
$this->mItem->mParentTitle->getLocalUrl( "feed={$format}" )
                                        ) );
                                }
diff --git a/WikilogItemPager.php b/WikilogItemPager.php
index 4495b58..fee1849 100644
--- a/WikilogItemPager.php
+++ b/WikilogItemPager.php
@@ -131,7 +131,7 @@
        }
 
        function getEmptyBody() {
-               return '<div class="wl-empty">' . wfMsgExt( 
'wikilog-pager-empty', array( 'parsemag' ) ) . "</div>";
+               return '<div class="wl-empty">' . wfMessage( 
'wikilog-pager-empty' )->parse() . "</div>";
        }
 
        function getNavigationBar() {
@@ -159,7 +159,7 @@
                # edit link (if user can edit the article).
                $titleText = Sanitizer::escapeHtmlAllowEntities( $item->mName );
                if ( !$item->getIsPublished() )
-                       $titleText .= wfMsgForContent( 
'wikilog-draft-title-mark' );
+                       $titleText .= wfMessage( 'wikilog-draft-title-mark' 
)->inContentLanguage()->escaped();
                $heading = Linker::link( $item->mTitle, $titleText, array(), 
array(),
                        array( 'known', 'noclasses' )
                );
@@ -172,7 +172,7 @@
                $key = $this->mQuery->isSingleWikilog()
                        ? 'wikilog-summary-header-single'
                        : 'wikilog-summary-header';
-               $msg = wfMsgExt( $key, array( 'content', 'parsemag' ), $params 
);
+               $msg = wfMessage( $key, $params )->inContentLanguage()->parse();
                if ( !empty( $msg ) ) {
                        $header = WikilogUtils::wrapDiv( 'wl-summary-header', 
$this->parse( $msg ) );
                }
@@ -189,7 +189,7 @@
                $key = $this->mQuery->isSingleWikilog()
                        ? 'wikilog-summary-footer-single'
                        : 'wikilog-summary-footer';
-               $msg = wfMsgExt( $key, array( 'content', 'parsemag' ), $params 
);
+               $msg = wfMessage( $key, $params )->inContentLanguage()->parse();
                if ( !empty( $msg ) ) {
                        $footer = WikilogUtils::wrapDiv( 'wl-summary-footer', 
$this->parse( $msg ) );
                }
@@ -239,9 +239,9 @@
                $skin = $this->getSkin();
                $attribs = array();
                if ( !is_null( $tooltip ) ) {
-                       $attribs['title'] = wfMsg( 'wikilog-edit-hint', 
$tooltip );
+                       $attribs['title'] = wfMessage( 'wikilog-edit-hint', 
$tooltip )->escaped();
                }
-               $link = Linker::link( $title, wfMsg( 'wikilog-edit-lc' ),
+               $link = Linker::link( $title, wfMessage( 'wikilog-edit-lc' 
)->escaped(),
                        $attribs,
                        array( 'action' => 'edit' ),
                        array( 'noclasses', 'known' )
@@ -333,7 +333,7 @@
 
                # Some general data.
                $authors = WikilogUtils::authorList( array_keys( 
$item->mAuthors ) );
-               $tags = implode( wfMsgForContent( 'comma-separator' ), 
array_keys( $item->mTags ) );
+               $tags = implode( wfMessage( 'comma-separator' 
)->inContentLanguage()->text(), array_keys( $item->mTags ) );
                $comments = WikilogUtils::getCommentsWikiText( $item );
                $divclass = 'wl-entry' . ( $item->getIsPublished() ? '' : ' 
wl-draft' );
 
@@ -486,7 +486,7 @@
                                $s = Linker::link( $page, $text, array(), 
array(),
                                        array( 'known', 'noclasses' ) );
                                if ( !$this->mCurrentRow->wlp_publish ) {
-                                       $draft = wfMsg( 
'wikilog-draft-title-mark' );
+                                       $draft = wfMessage( 
'wikilog-draft-title-mark' )->text();
                                        $s = Xml::wrapClass( "$s $draft", 
'wl-draft-inline' );
                                }
                                return $s;
@@ -518,19 +518,18 @@
 
                $fields = array();
 
-               $fields['wlp_pubdate']                  = wfMsgHtml( 
'wikilog-published' );
-               // $fields['wlp_updated']                       = wfMsgHtml( 
'wikilog-updated' );
-               $fields['wlp_authors']                  = wfMsgHtml( 
'wikilog-authors' );
+               $fields['wlp_pubdate']                  = wfMessage( 
'wikilog-published' )->escaped();
+               $fields['wlp_authors']                  = wfMessage( 
'wikilog-authors' )->escaped();
 
                if ( !$this->mQuery->isSingleWikilog() )
-                       $fields['wlw_title']            = wfMsgHtml( 
'wikilog-wikilog' );
+                       $fields['wlw_title']            = wfMessage( 
'wikilog-wikilog' )->escaped();
 
-               $fields['wlp_title']                    = wfMsgHtml( 
'wikilog-title' );
+               $fields['wlp_title']                    = wfMessage( 
'wikilog-title' )->escaped();
 
                if ( $wgWikilogEnableComments )
-                       $fields['wlp_num_comments']     = wfMsgHtml( 
'wikilog-comments' );
+                       $fields['wlp_num_comments']     = wfMessage( 
'wikilog-comments' )->escaped();
 
-               $fields['_wl_actions']                  = wfMsgHtml( 
'wikilog-actions' );
+               $fields['_wl_actions']                  = wfMessage( 
'wikilog-actions' )->escaped();
                return $fields;
        }
 
@@ -573,9 +572,9 @@
        private function doEditLink( $title, $tooltip = null ) {
                $attribs = array();
                if ( !is_null( $tooltip ) ) {
-                       $attribs['title'] = wfMsg( 'wikilog-edit-hint', 
$tooltip );
+                       $attribs['title'] = wfMessage( 'wikilog-edit-hint', 
$tooltip )->escaped();
                }
-               $link = Linker::link( $title, wfMsg( 'wikilog-edit-lc' ),
+               $link = Linker::link( $title, wfMessage( 'wikilog-edit-lc' 
)->escaped(),
                        $attribs,
                        array( 'action' => 'edit' ),
                        array( 'noclasses', 'known' )
diff --git a/WikilogMainPage.php b/WikilogMainPage.php
index d7a7ce5..fa9a8e0 100644
--- a/WikilogMainPage.php
+++ b/WikilogMainPage.php
@@ -121,8 +121,7 @@
                                        'rel' => 'alternate',
                                        'href' => $this->mTitle->getLocalURL( 
$altquery ),
                                        'type' => $wgMimeType,
-                                       'title' => wfMsgExt( 
"wikilog-view-{$alt}",
-                                               array( 'content', 'parsemag' ) )
+                                       'title' => wfMessage( 
"wikilog-view-{$alt}" )->inContentlanguage()->parse()
                                ) );
                        }
                }
@@ -137,7 +136,7 @@
                if ( $this->mTitle->exists() && $wgRequest->getBool( 
'wlActionNewItem' ) )
                        return $this->actionNewItem();
 
-               $wgOut->setPageTitle( wfMsg( 'wikilog-tab-title' ) );
+               $wgOut->setPageTitle( wfMessage( 'wikilog-tab-title' ) );
                $wgOut->setRobotpolicy( 'noindex,nofollow' );
 
                if ( $this->mTitle->exists() ) {
@@ -147,7 +146,7 @@
                                $wgOut->addHTML( $this->formNewItem() );
                        }
                } elseif ( $this->mTitle->userCan( 'create' ) ) {
-                       $text = wfMsgExt( 'wikilog-missing-wikilog', 'parse' );
+                       $text = wfMessage( 'wikilog-missing-wikilog' )->parse();
                        $text = WikilogUtils::wrapDiv( 'noarticletext', $text );
                        $wgOut->addHTML( $text );
                } else {
@@ -210,7 +209,7 @@
                $cont .= $this->formatPostCount( 'li', 'all', $n_total );
                $cont .= Xml::closeElement( 'ul' );
 
-               return Xml::fieldset( wfMsg( 'wikilog-information' ), $cont ) . 
"\n";
+               return Xml::fieldset( wfMessage( 'wikilog-information' 
)->text(), $cont ) . "\n";
        }
 
        /**
@@ -221,7 +220,7 @@
 
                // Uses messages 'wikilog-post-count-published', 
'wikilog-post-count-drafts', 'wikilog-post-count-all'
                $s = Linker::link( $this->mTitle,
-                       wfMsgExt( "wikilog-post-count-{$type}", array( 
'parsemag' ), $num ),
+                       wfMessage( "wikilog-post-count-{$type}", $num 
)->parse(),
                        array(),
                        array( 'view' => "archives", 'show' => $type ),
                        array( 'knwon', 'noclasses' )
@@ -230,7 +229,7 @@
                        $f = array();
                        foreach ( $wgWikilogFeedClasses as $format => $class ) {
                                $f[] = Linker::link( $this->mTitle,
-                                       wfMsg( "feed-{$format}" ),
+                                       wfMessage( "feed-{$format}" 
)->escaped(),
                                        array( 'class' => "feedlink", 'type' => 
"application/{$format}+xml" ),
                                        array( 'view' => "archives", 'show' => 
$type, 'feed' => $format ),
                                        array( 'known', 'noclasses' )
@@ -250,9 +249,9 @@
                $fields = array();
                $fields[] = Html::hidden( 'title', 
$this->mTitle->getPrefixedText() );
                $fields[] = Html::hidden( 'action', 'wikilog' );
-               $fields[] = Xml::inputLabel( wfMsg( 'wikilog-item-name' ),
+               $fields[] = Xml::inputLabel( wfMessage( 'wikilog-item-name' 
)->text(),
                        'wlItemName', 'wl-item-name', 50 );
-               $fields[] = Xml::submitButton( wfMsg( 'wikilog-new-item-go' ),
+               $fields[] = Xml::submitButton( wfMessage( 'wikilog-new-item-go' 
)->text(),
                        array( 'name' => 'wlActionNewItem' ) );
 
                $form = Xml::tags( 'form',
@@ -260,7 +259,7 @@
                        implode( "\n", $fields )
                );
 
-               return Xml::fieldset( wfMsg( 'wikilog-new-item' ), $form ) . 
"\n";
+               return Xml::fieldset( wfMessage( 'wikilog-new-item' )->text(), 
$form ) . "\n";
        }
 
        /**
diff --git a/WikilogParser.php b/WikilogParser.php
index 41c0259..1c63dce 100644
--- a/WikilogParser.php
+++ b/WikilogParser.php
@@ -242,7 +242,7 @@
                                $output = $parser->parse( $value, 
$parser->getTitle(), $popt, true, false );
                                $parser->mExtWikilog->mSummary = 
$output->getText();
                        } else {
-                               $warning = wfMsg( 'wikilog-error-msg', wfMsg( 
'wikilog-invalid-param', htmlspecialchars( $key ) ) );
+                               $warning = wfMessage( 'wikilog-error-msg', 
wfMessage( 'wikilog-invalid-param', $key )->text() )->text();
                                $parser->mOutput->addWarning( $warning );
                        }
                }
@@ -268,7 +268,7 @@
                                $parser->mExtWikilog->mPubDate = wfTimestamp( 
TS_MW, $ts );
                        }
                        else {
-                               $warning = wfMsg( 'wikilog-error-msg', wfMsg( 
'wikilog-invalid-date', $pubdate ) );
+                               $warning = wfMessage( 'wikilog-error-msg', 
wfMessage( 'wikilog-invalid-date', $pubdate )->text() )->text();
                                $parser->mOutput->addWarning( $warning );
                        }
                }
@@ -463,7 +463,7 @@
                global $wgWikilogMaxAuthors;
 
                if ( count( $parser->mExtWikilog->mAuthors ) >= 
$wgWikilogMaxAuthors ) {
-                       $warning = wfMsg( 'wikilog-error-msg', wfMsg( 
'wikilog-too-many-authors' ) );
+                       $warning = wfMessage( 'wikilog-error-msg', wfMessage( 
'wikilog-too-many-authors' )->text() )->text();
                        $parser->mOutput->addWarning( $warning );
                        return false;
                }
@@ -473,7 +473,7 @@
                        $parser->mExtWikilog->mAuthors[$user->getName()] = 
$user->getID();
                }
                else {
-                       $warning = wfMsg( 'wikilog-error-msg', wfMsg( 
'wikilog-invalid-author', $name ) );
+                       $warning = wfMessage( 'wikilog-error-msg', wfMessage( 
'wikilog-invalid-author', $name )->text() )->text();
                        $parser->mOutput->addWarning( $warning );
                }
                return true;
@@ -490,7 +490,7 @@
                if ( !$tcre ) { $tcre = '/[^' . Title::legalChars() . ']/'; }
 
                if ( count( $parser->mExtWikilog->mTags ) >= $wgWikilogMaxTags 
) {
-                       $warning = wfMsg( 'wikilog-error-msg', wfMsg( 
'wikilog-too-many-tags' ) );
+                       $warning = wfMessage( 'wikilog-error-msg', wfMessage( 
'wikilog-too-many-tags' )->text() )->text();
                        $parser->mOutput->addWarning( $warning );
                        return false;
                }
@@ -499,7 +499,7 @@
                        $parser->mExtWikilog->mTags[$tag] = 1;
                }
                else {
-                       $warning = wfMsg( 'wikilog-error-msg', wfMsg( 
'wikilog-invalid-tag', $tag ) );
+                       $warning = wfMessage( 'wikilog-error-msg', wfMessage( 
'wikilog-invalid-tag', $tag )->text() )->text();
                        $parser->mOutput->addWarning( $warning );
                }
                return true;
@@ -516,7 +516,7 @@
                if ( !$tested ) {
                        $title = $parser->getTitle();
                        if ( !in_array( $title->getNamespace(), 
$wgWikilogNamespaces ) ) {
-                               $warning = wfMsg( 'wikilog-error-msg', wfMsg( 
'wikilog-out-of-context' ) );
+                               $warning = wfMessage( 'wikilog-error-msg', 
wfMessage( 'wikilog-out-of-context' )->text() )->text();
                                $parser->mOutput->addWarning( $warning );
                        }
                        $tested = true;
@@ -534,21 +534,21 @@
        private static function parseImageLink( &$parser, $text ) {
                $obj = self::parseMediaLink( $parser, $text );
                if ( !$obj ) {
-                       $warning = wfMsg( 'wikilog-error-msg', wfMsg( 
'wikilog-invalid-file', htmlspecialchars( $text ) ) );
+                       $warning = wfMessage( 'wikilog-error-msg', wfMessage( 
'wikilog-invalid-file', htmlspecialchars( $text ) )->text() )->text();
                        $parser->mOutput->addWarning( $warning );
                        return null;
                }
 
                list( $t1, $t2, $file ) = $obj;
                if ( !$file ) {
-                       $warning = wfMsg( 'wikilog-error-msg', wfMsg( 
'wikilog-file-not-found', htmlspecialchars( $t1 ) ) );
+                       $warning = wfMessage( 'wikilog-error-msg', wfMessage( 
'wikilog-file-not-found', $t1 )->escaped() )->text();
                        $parser->mOutput->addWarning( $warning );
                        return null;
                }
 
                $type = $file->getMediaType();
                if ( $type != MEDIATYPE_BITMAP && $type != MEDIATYPE_DRAWING ) {
-                       $warning = wfMsg( 'wikilog-error-msg', wfMsg( 
'wikilog-not-an-image', $file->getName() ) );
+                       $warning = wfMessage( 'wikilog-error-msg', wfMessage( 
'wikilog-not-an-image', $file->getName() )->text() )->text();
                        $parser->mOutput->addWarning( $warning );
                        return null;
                }
diff --git a/WikilogUtils.php b/WikilogUtils.php
index abd8cae..5801ec6 100644
--- a/WikilogUtils.php
+++ b/WikilogUtils.php
@@ -207,7 +207,8 @@
        public static function authorSig( $author ) {
                static $authorSigCache = array();
                if ( !isset( $authorSigCache[$author] ) )
-                       $authorSigCache[$author] = wfMsgForContent( 
'wikilog-author-signature', $author );
+                       $authorSigCache[$author] =
+                               wfMessage( 'wikilog-author-signature', $author 
)->inContentLanguage()->text();
                return $authorSigCache[$author];
        }
 
@@ -301,7 +302,7 @@
                $commentsNum = $item->getNumComments();
                $commentsMsg = ( $commentsNum ? 'wikilog-has-comments' : 
'wikilog-no-comments' );
                $commentsUrl = $item->mTitle->getTalkPage()->getPrefixedURL();
-               $commentsTxt = wfMsgExt( $commentsMsg, array( 'parsemag', 
'content' ), $commentsNum );
+               $commentsTxt = wfMessage( $commentsMsg, $commentsNum 
)->inContentLanguage()->parse();
                return "[[{$commentsUrl}|{$commentsTxt}]]";
        }
 
@@ -419,7 +420,7 @@
 
                # Check for translation of timezones.
                $key = 'timezone-' . strtolower( trim( $tz ) );
-               $value = wfMsgForContent( $key );
+               $value = wfMessage( $key )->inContentLanguage()->text();
                if ( !Message::newFromKey( $key, $value )->isDisabled() ) $tz = 
$value;
 
                return array( $date, $time, $tz );
@@ -499,14 +500,14 @@
                $opts = array( 'parsemag', 'escapenoentities' );
                $linkTexts = $disabledTexts = array();
                foreach ( self::$linkTextMsgs[$this->mType] as $type => $msg ) {
-                       $label = wfMsgExt( $msg, $opts, $limit );
+                       $label = wfMessage( $msg, $opts, $limit )->text();
                        $linkTexts[$type] = wfMsgReplaceArgs( 
self::$pagingLabels[$type], array( $label ) );
                        $disabledTexts[$type] = Xml::wrapClass( 
$linkTexts[$type], 'disabled' );
                }
 
                $pagingLinks = $this->mPager->getPagingLinks( $linkTexts, 
$disabledTexts );
 //             $limitLinks = $this->mPager->getLimitLinks(); // XXX: Not used 
yet.
-               $ellipsis = wfMsg( 'ellipsis' );
+               $ellipsis = wfMessage( 'ellipsis' )->escaped();
                $html = "{$pagingLinks['first']} {$pagingLinks['prev']} 
{$ellipsis} {$pagingLinks['next']} {$pagingLinks['last']}";
                $html = WikilogUtils::wrapDiv( 'wl-pagination', $html );
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia9c931b6528edb03b62ada4aeb416371fb45bfa0
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikilog
Gerrit-Branch: master
Gerrit-Owner: Florianschmidtwelzow <[email protected]>

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

Reply via email to