Use wfMessage instead of deprecated wfMsg*
authorAlex Monk <krenair@gmail.com>
Tue, 24 Jul 2012 01:04:15 +0000 (02:04 +0100)
committerSiebrand Mazeland <s.mazeland@xs4all.nl>
Sat, 18 Aug 2012 12:11:05 +0000 (14:11 +0200)
Or $this->msg in special pages.

Change-Id: I774a89d646615053c8424050e42ad95601f92543

46 files changed:
includes/Action.php
includes/Article.php
includes/Block.php
includes/CategoryViewer.php
includes/ChangeTags.php
includes/ChangesFeed.php
includes/DefaultSettings.php
includes/GlobalFunctions.php
includes/Html.php
includes/ImageGallery.php
includes/Licenses.php
includes/OutputPage.php
includes/Status.php
includes/Xml.php
includes/actions/HistoryAction.php
includes/api/ApiEditPage.php
includes/api/ApiFeedContributions.php
includes/api/ApiFeedWatchlist.php
includes/api/ApiParse.php
includes/db/DatabaseError.php
includes/db/DatabaseSqlite.php
includes/filerepo/file/File.php
includes/installer/CliInstaller.php
includes/installer/Ibm_db2Installer.php
includes/installer/MysqlInstaller.php
includes/installer/OracleInstaller.php
includes/installer/PostgresInstaller.php
includes/job/DoubleRedirectJob.php
includes/media/GIF.php
includes/media/PNG.php
includes/search/SearchEngine.php
includes/specials/SpecialEditWatchlist.php
includes/specials/SpecialUndelete.php
includes/specials/SpecialUpload.php
includes/specials/SpecialVersion.php
includes/upload/UploadBase.php
languages/Language.php
languages/LanguageConverter.php
maintenance/cleanupSpam.php
maintenance/language/dumpMessages.php
maintenance/moveBatch.php
opensearch_desc.php
skins/CologneBlue.php
skins/Nostalgia.php
skins/Standard.php
thumb.php

index f4343d1..5192225 100644 (file)
@@ -341,7 +341,7 @@ abstract class Action {
         * @return String
         */
        protected function getDescription() {
-               return wfMsgHtml( strtolower( $this->getName() ) );
+               return $this->msg( strtolower( $this->getName() ) )->escaped();
        }
 
        /**
index 237f0ce..92b6991 100644 (file)
@@ -245,7 +245,8 @@ class Article extends Page {
                                        $text = '';
                                }
                        } else {
-                               $text = wfMsgExt( $this->getContext()->getUser()->isLoggedIn() ? 'noarticletext' : 'noarticletextanon', 'parsemag' );
+                               $message = $this->getContext()->getUser()->isLoggedIn() ? 'noarticletext' : 'noarticletextanon';
+                               $text = wfMessage( $message )->text();
                        }
                        wfProfileOut( __METHOD__ );
 
@@ -961,21 +962,20 @@ class Article extends Page {
                $token = $user->getEditToken( $rcid );
                $outputPage->preventClickjacking();
 
+               $link = Linker::linkKnown(
+                       $this->getTitle(),
+                       wfMessage( 'markaspatrolledtext' )->escaped(),
+                       array(),
+                       array(
+                               'action' => 'markpatrolled',
+                               'rcid' => $rcid,
+                               'token' => $token,
+                       )
+               );
+
                $outputPage->addHTML(
                        "<div class='patrollink'>" .
-                               wfMsgHtml(
-                                       'markaspatrolledlink',
-                                       Linker::linkKnown(
-                                               $this->getTitle(),
-                                               wfMsgHtml( 'markaspatrolledtext' ),
-                                               array(),
-                                               array(
-                                                       'action' => 'markpatrolled',
-                                                       'rcid' => $rcid,
-                                                       'token' => $token,
-                                               )
-                                       )
-                               ) .
+                               wfMessage( 'markaspatrolledlink' )->rawParams( $link )->escaped() .
                        '</div>'
                );
        }
@@ -1148,18 +1148,18 @@ class Article extends Page {
                        $tdtime, $revision->getUser() )->parse() . "</div>" );
 
                $lnk = $current
-                       ? wfMsgHtml( 'currentrevisionlink' )
+                       ? wfMessage( 'currentrevisionlink' )->escaped()
                        : Linker::linkKnown(
                                $this->getTitle(),
-                               wfMsgHtml( 'currentrevisionlink' ),
+                               wfMessage( 'currentrevisionlink' )->escaped(),
                                array(),
                                $extraParams
                        );
                $curdiff = $current
-                       ? wfMsgHtml( 'diff' )
+                       ? wfMessage( 'diff' )->escaped()
                        : Linker::linkKnown(
                                $this->getTitle(),
-                               wfMsgHtml( 'diff' ),
+                               wfMessage( 'diff' )->escaped(),
                                array(),
                                array(
                                        'diff' => 'cur',
@@ -1170,30 +1170,30 @@ class Article extends Page {
                $prevlink = $prev
                        ? Linker::linkKnown(
                                $this->getTitle(),
-                               wfMsgHtml( 'previousrevision' ),
+                               wfMessage( 'previousrevision' )->escaped(),
                                array(),
                                array(
                                        'direction' => 'prev',
                                        'oldid' => $oldid
                                ) + $extraParams
                        )
-                       : wfMsgHtml( 'previousrevision' );
+                       : wfMessage( 'previousrevision' )->escaped();
                $prevdiff = $prev
                        ? Linker::linkKnown(
                                $this->getTitle(),
-                               wfMsgHtml( 'diff' ),
+                               wfMessage( 'diff' )->escaped(),
                                array(),
                                array(
                                        'diff' => 'prev',
                                        'oldid' => $oldid
                                ) + $extraParams
                        )
-                       : wfMsgHtml( 'diff' );
+                       : wfMessage( 'diff' )->escaped();
                $nextlink = $current
-                       ? wfMsgHtml( 'nextrevision' )
+                       ? wfMessage( 'nextrevision' )->escaped()
                        : Linker::linkKnown(
                                $this->getTitle(),
-                               wfMsgHtml( 'nextrevision' ),
+                               wfMessage( 'nextrevision' )->escaped(),
                                array(),
                                array(
                                        'direction' => 'next',
@@ -1201,10 +1201,10 @@ class Article extends Page {
                                ) + $extraParams
                        );
                $nextdiff = $current
-                       ? wfMsgHtml( 'diff' )
+                       ? wfMessage( 'diff' )->escaped()
                        : Linker::linkKnown(
                                $this->getTitle(),
-                               wfMsgHtml( 'diff' ),
+                               wfMessage( 'diff' )->escaped(),
                                array(),
                                array(
                                        'diff' => 'next',
@@ -1241,7 +1241,8 @@ class Article extends Page {
                $imageDir = $lang->getDir();
 
                if ( $appendSubtitle ) {
-                       $this->getContext()->getOutput()->appendSubtitle( wfMsgHtml( 'redirectpagesub' ) );
+                       $out = $this->getContext()->getOutput();
+                       $out->appendSubtitle( wfMessage( 'redirectpagesub' )->escaped() );
                }
 
                // the loop prepends the arrow image before the link, so the first case needs to be outside
@@ -1347,7 +1348,8 @@ class Article extends Page {
                        $reason = $deleteReason;
                } elseif ( $deleteReason != '' ) {
                        // Entry from drop down menu + additional comment
-                       $reason = $deleteReasonList . wfMsgForContent( 'colon-separator' ) . $deleteReason;
+                       $colonseparator = wfMessage( 'colon-separator' )->inContentLanguage()->text();
+                       $reason = $deleteReasonList . $colonseparator . $deleteReason;
                } else {
                        $reason = $deleteReasonList;
                }
@@ -1382,9 +1384,9 @@ class Article extends Page {
                        $revisions = $this->mTitle->estimateRevisionCount();
                        // @todo FIXME: i18n issue/patchwork message
                        $this->getContext()->getOutput()->addHTML( '<strong class="mw-delete-warning-revisions">' .
-                               wfMsgExt( 'historywarning', array( 'parseinline' ), $this->getContext()->getLanguage()->formatNum( $revisions ) ) .
-                               wfMsgHtml( 'word-separator' ) . Linker::linkKnown( $title,
-                                       wfMsgHtml( 'history' ),
+                               wfMessage( 'historywarning' )->numParams( $revisions )->parse() .
+                               wfMessage( 'word-separator' )->plain() . Linker::linkKnown( $title,
+                                       wfMessage( 'history' )->escaped(),
                                        array( 'rel' => 'archives' ),
                                        array( 'action' => 'history' ) ) .
                                '</strong>'
@@ -1422,7 +1424,7 @@ class Article extends Page {
                        $suppress = "<tr id=\"wpDeleteSuppressRow\">
                                        <td></td>
                                        <td class='mw-input'><strong>" .
-                                               Xml::checkLabel( wfMsg( 'revdelete-suppress' ),
+                                               Xml::checkLabel( wfMessage( 'revdelete-suppress' )->text(),
                                                        'wpSuppress', 'wpSuppress', false, array( 'tabindex' => '4' ) ) .
                                        "</strong></td>
                                </tr>";
@@ -1438,17 +1440,17 @@ class Article extends Page {
                        Xml::openElement( 'table', array( 'id' => 'mw-deleteconfirm-table' ) ) .
                        "<tr id=\"wpDeleteReasonListRow\">
                                <td class='mw-label'>" .
-                                       Xml::label( wfMsg( 'deletecomment' ), 'wpDeleteReasonList' ) .
+                                       Xml::label( wfMessage( 'deletecomment' )->text(), 'wpDeleteReasonList' ) .
                                "</td>
                                <td class='mw-input'>" .
                                        Xml::listDropDown( 'wpDeleteReasonList',
-                                               wfMsgForContent( 'deletereason-dropdown' ),
-                                               wfMsgForContent( 'deletereasonotherlist' ), '', 'wpReasonDropDown', 1 ) .
+                                               wfMessage( 'deletereason-dropdown' )->inContentLanguage()->text(),
+                                               wfMessage( 'deletereasonotherlist' )->inContentLanguage()->text(), '', 'wpReasonDropDown', 1 ) .
                                "</td>
                        </tr>
                        <tr id=\"wpDeleteReasonRow\">
                                <td class='mw-label'>" .
-                                       Xml::label( wfMsg( 'deleteotherreason' ), 'wpReason' ) .
+                                       Xml::label( wfMessage( 'deleteotherreason' )->text(), 'wpReason' ) .
                                "</td>
                                <td class='mw-input'>" .
                                Html::input( 'wpReason', $reason, 'text', array(
@@ -1467,7 +1469,7 @@ class Article extends Page {
                        <tr>
                                <td></td>
                                <td class='mw-input'>" .
-                                       Xml::checkLabel( wfMsg( 'watchthis' ),
+                                       Xml::checkLabel( wfMessage( 'watchthis' )->text(),
                                                'wpWatch', 'wpWatch', $checkWatch, array( 'tabindex' => '3' ) ) .
                                "</td>
                        </tr>";
@@ -1478,7 +1480,7 @@ class Article extends Page {
                        <tr>
                                <td></td>
                                <td class='mw-submit'>" .
-                                       Xml::submitButton( wfMsg( 'deletepage' ),
+                                       Xml::submitButton( wfMessage( 'deletepage' )->text(),
                                                array( 'name' => 'wpConfirmB', 'id' => 'wpConfirmB', 'tabindex' => '5' ) ) .
                                "</td>
                        </tr>" .
@@ -1491,7 +1493,7 @@ class Article extends Page {
                                $title = Title::makeTitle( NS_MEDIAWIKI, 'Deletereason-dropdown' );
                                $link = Linker::link(
                                        $title,
-                                       wfMsgHtml( 'delete-edit-reasonlist' ),
+                                       wfMessage( 'delete-edit-reasonlist' )->escaped(),
                                        array(),
                                        array( 'action' => 'edit' )
                                );
index 301a45a..6e8f9f3 100644 (file)
@@ -613,7 +613,7 @@ class Block {
                $key = wfMemcKey( 'ipb', 'autoblock', 'whitelist' );
                $lines = $wgMemc->get( $key );
                if ( !$lines ) {
-                       $lines = explode( "\n", wfMsgForContentNoTrans( 'autoblock_whitelist' ) );
+                       $lines = explode( "\n", wfMessage( 'autoblock_whitelist' )->inContentLanguage()->plain() );
                        $wgMemc->set( $key, $lines, 3600 * 24 );
                }
 
@@ -687,7 +687,7 @@ class Block {
                wfDebug( "Autoblocking {$this->getTarget()}@" . $autoblockIP . "\n" );
                $autoblock->setTarget( $autoblockIP );
                $autoblock->setBlocker( $this->getBlocker() );
-               $autoblock->mReason = wfMsgForContent( 'autoblocker', $this->getTarget(), $this->mReason );
+               $autoblock->mReason = wfMessage( 'autoblocker', $this->getTarget(), $this->mReason )->inContentLanguage()->text();
                $timestamp = wfTimestampNow();
                $autoblock->mTimestamp = $timestamp;
                $autoblock->mAuto = 1;
@@ -1020,7 +1020,7 @@ class Block {
                        $keys = array( 'infiniteblock', 'expiringblock' );
 
                        foreach ( $keys as $key ) {
-                               $msg[$key] = wfMsgHtml( $key );
+                               $msg[$key] = wfMessage( $key )->escaped();
                        }
                }
 
index ddd01eb..4e4f311 100644 (file)
@@ -526,7 +526,7 @@ class CategoryViewer extends ContextSource {
                                if ( $first && $char === $prevchar ) {
                                        # We're continuing a previous chunk at the top of a new
                                        # column, so add " cont." after the letter.
-                                       $ret .= ' ' . wfMsgHtml( 'listingcontinuesabbrev' );
+                                       $ret .= ' ' . wfMessage( 'listingcontinuesabbrev' )->escaped();
                                }
                                $ret .= "</h3>\n";
 
index 34e9eba..0ebc926 100644 (file)
@@ -227,7 +227,7 @@ class ChangeTags {
                if ( !$wgUseTagFilter || !count( self::listDefinedTags() ) )
                        return $fullForm ? '' : array();
 
-               $data = array( Html::rawElement( 'label', array( 'for' => 'tagfilter' ), wfMsgExt( 'tag-filter', 'parseinline' ) ),
+               $data = array( Html::rawElement( 'label', array( 'for' => 'tagfilter' ), wfMessage( 'tag-filter' )->parse() ),
                        Xml::input( 'tagfilter', 20, $selected, array( 'class' => 'mw-tagfilter-input' ) ) );
 
                if ( !$fullForm ) {
@@ -235,7 +235,7 @@ class ChangeTags {
                }
 
                $html = implode( '&#160;', $data );
-               $html .= "\n" . Xml::element( 'input', array( 'type' => 'submit', 'value' => wfMsg( 'tag-filter-submit' ) ) );
+               $html .= "\n" . Xml::element( 'input', array( 'type' => 'submit', 'value' => wfMessage( 'tag-filter-submit' )->text() ) );
                $html .= "\n" . Html::hidden( 'title', $title->getPrefixedText() );
                $html = Xml::tags( 'form', array( 'action' => $title->getLocalURL(), 'class' => 'mw-tagfilter-form', 'method' => 'get' ), $html );
 
index 2954920..ee4c2d6 100644 (file)
@@ -206,7 +206,7 @@ class ChangesFeed {
                                FeedUtils::formatDiff( $obj ),
                                $url,
                                $obj->rc_timestamp,
-                               ($obj->rc_deleted & Revision::DELETED_USER) ? wfMsgHtml('rev-deleted-user') : $obj->rc_user_text,
+                               ( $obj->rc_deleted & Revision::DELETED_USER ) ? wfMessage( 'rev-deleted-user' )->escaped() : $obj->rc_user_text,
                                $talkpage
                        );
                        $feed->outItem( $item );
index a6244ed..807658d 100644 (file)
@@ -2317,16 +2317,16 @@ $wgVariantArticlePath = false;
 $wgLoginLanguageSelector = false;
 
 /**
- * When translating messages with wfMsg(), it is not always clear what should
- * be considered UI messages and what should be content messages.
+ * When translating messages with wfMessage(), it is not always clear what 
+ * should be considered UI messages and what should be content messages.
  *
  * For example, for the English Wikipedia, there should be only one 'mainpage',
  * so when getting the link for 'mainpage', we should treat it as site content
- * and call wfMsgForContent(), but for rendering the text of the link, we call
- * wfMsg(). The code behaves this way by default. However, sites like the
- * Wikimedia Commons do offer different versions of 'mainpage' and the like for
- * different languages. This array provides a way to override the default
- * behavior.
+ * and call ->inContentLanguage()->text(), but for rendering the text of the
+ * link, we call ->text(). The code behaves this way by default. However,
+ * sites like the Wikimedia Commons do offer different versions of 'mainpage'
+ * and the like for different languages. This array provides a way to override
+ * the default behavior.
  *
  * @par Example:
  * To allow language-specific main page and community
index 010ac70..c592c7c 100644 (file)
@@ -1906,13 +1906,7 @@ function wfFormatStackFrame( $frame ) {
  * @return String
  */
 function wfShowingResults( $offset, $limit ) {
-       global $wgLang;
-       return wfMsgExt(
-               'showingresults',
-               array( 'parseinline' ),
-               $wgLang->formatNum( $limit ),
-               $wgLang->formatNum( $offset + 1 )
-       );
+       return wfMessage( 'showingresults' )->numParams( $limit, $offset + 1 )->parse();
 }
 
 /**
@@ -3969,7 +3963,7 @@ function wfIsBadImage( $name, $contextTitle = false, $blacklist = null ) {
                $badImages = $badImageCache;
        } else { // cache miss
                if ( $blacklist === null ) {
-                       $blacklist = wfMsgForContentNoTrans( 'bad_image_list' ); // site list
+                       $blacklist = wfMessage( 'bad_image_list' )->inContentLanguage()->plain(); // site list
                }
                # Build the list now
                $badImages = array();
index 7fa98e1..23fead7 100644 (file)
@@ -749,7 +749,7 @@ class Html {
                if ( isset( $params['all'] ) ) {
                        // add an option that would let the user select all namespaces.
                        // Value is provided by user, the name shown is localized for the user.
-                       $options[$params['all']] = wfMsg( 'namespacesall' );
+                       $options[$params['all']] = wfMessage( 'namespacesall' )->text();
                }
                // Add all namespaces as options (in the content langauge)
                $options += $wgContLang->getFormattedNamespaces();
@@ -763,7 +763,7 @@ class Html {
                        if ( $nsId === 0 ) {
                                // For other namespaces use use the namespace prefix as label, but for
                                // main we don't use "" but the user message descripting it (e.g. "(Main)" or "(Article)")
-                               $nsName = wfMsg( 'blanknamespace' );
+                               $nsName = wfMessage( 'blanknamespace' )->text();
                        }
                        $optionsHtml[] = Html::element(
                                'option', array(
@@ -859,7 +859,7 @@ class Html {
        /**
         * Get HTML for an info box with an icon.
         *
-        * @param $text String: wikitext, get this with wfMsgNoTrans()
+        * @param $text String: wikitext, get this with wfMessage()->plain()
         * @param $icon String: icon name, file in skins/common/images
         * @param $alt String: alternate text for the icon
         * @param $class String: additional class name to add to the wrapper div
index d391ead..91c3190 100644 (file)
@@ -339,7 +339,7 @@ class ImageGallery {
                                if( $img ) {
                                        $fileSize = htmlspecialchars( $wgLang->formatSize( $img->getSize() ) );
                                } else {
-                                       $fileSize = wfMsgHtml( 'filemissing' );
+                                       $fileSize = wfMessage( 'filemissing' )->escaped();
                                }
                                $fileSize = "$fileSize<br />\n";
                        } else {
index c498a57..0cfb047 100644 (file)
@@ -52,7 +52,7 @@ class Licenses extends HTMLFormField {
        public function __construct( $params ) {
                parent::__construct( $params );
 
-               $this->msg = empty( $params['licenses'] ) ? wfMsgForContent( 'licenses' ) : $params['licenses'];
+               $this->msg = empty( $params['licenses'] ) ? wfMessage( 'licenses' )->inContentLanguage()->plain() : $params['licenses'];
                $this->selected = null;
 
                $this->makeLicenses();
@@ -182,7 +182,7 @@ class Licenses extends HTMLFormField {
        public function getInputHTML( $value ) {
                $this->selected = $value;
 
-               $this->html = $this->outputOption( wfMsg( 'nolicense' ), '',
+               $this->html = $this->outputOption( wfMessage( 'nolicense' )->text(), '',
                        (bool)$this->selected ? null : array( 'selected' => 'selected' ) );
                $this->makeHtml( $this->getLicenses() );
 
index a9c7d14..d170722 100644 (file)
@@ -3521,7 +3521,7 @@ $templates
         * Add a wikitext-formatted message to the output.
         * This is equivalent to:
         *
-        *    $wgOut->addWikiText( wfMsgNoTrans( ... ) )
+        *    $wgOut->addWikiText( wfMessage( ... )->plain() )
         */
        public function addWikiMsg( /*...*/ ) {
                $args = func_get_args();
index a2df380..29dc2f4 100644 (file)
@@ -172,7 +172,7 @@ class Status {
                $params = $this->cleanParams( $item['params'] );
                $xml = "<{$item['type']}>\n" .
                        Xml::element( 'message', null, $item['message'] ) . "\n" .
-                       Xml::element( 'text', null, wfMsg( $item['message'], $params ) ) ."\n";
+                       Xml::element( 'text', null, wfMessage( $item['message'], $params )->text() ) ."\n";
                foreach ( $params as $param ) {
                        $xml .= Xml::element( 'param', null, $param );
                }
@@ -214,17 +214,17 @@ class Status {
                if ( count( $this->errors ) == 1 ) {
                        $s = $this->getWikiTextForError( $this->errors[0], $this->errors[0]  );
                        if ( $shortContext ) {
-                               $s = wfMsgNoTrans( $shortContext, $s );
+                               $s = wfMessage( $shortContext, $s )->plain();
                        } elseif ( $longContext ) {
-                               $s = wfMsgNoTrans( $longContext, "* $s\n" );
+                               $s = wfMessage( $longContext, "* $s\n" )->plain();
                        }
                } else {
                        $s = '* '. implode("\n* ",
                                $this->getWikiTextArray( $this->errors ) ) . "\n";
                        if ( $longContext ) {
-                               $s = wfMsgNoTrans( $longContext, $s );
+                               $s = wfMessage( $longContext, $s )->plain();
                        } elseif ( $shortContext ) {
-                               $s = wfMsgNoTrans( $shortContext, "\n$s\n" );
+                               $s = wfMessage( $shortContext, "\n$s\n" )->plain();
                        }
                }
                return $s;
@@ -242,15 +242,15 @@ class Status {
        protected function getWikiTextForError( $error ) {
                if ( is_array( $error ) ) {
                        if ( isset( $error['message'] ) && isset( $error['params'] ) ) {
-                               return wfMsgNoTrans( $error['message'],
-                                       array_map( 'wfEscapeWikiText', $this->cleanParams( $error['params'] ) )  );
+                               return wfMessage( $error['message'],
+                                       array_map( 'wfEscapeWikiText', $this->cleanParams( $error['params'] ) )  )->plain();
                        } else {
                                $message = array_shift($error);
-                               return wfMsgNoTrans( $message,
-                                       array_map( 'wfEscapeWikiText', $this->cleanParams( $error ) ) );
+                               return wfMessage( $message,
+                                       array_map( 'wfEscapeWikiText', $this->cleanParams( $error ) ) )->plain();
                        }
                } else {
-                       return wfMsgNoTrans( $error );
+                       return wfMessage( $error )->plain();
                }
        }
 
index 505cb7f..120312d 100644 (file)
@@ -166,7 +166,7 @@ class Xml {
                if( is_null( $selected ) )
                        $selected = '';
                if( !is_null( $allmonths ) )
-                       $options[] = self::option( wfMsg( 'monthsall' ), $allmonths, $selected === $allmonths );
+                       $options[] = self::option( wfMessage( 'monthsall' )->text(), $allmonths, $selected === $allmonths );
                for( $i = 1; $i < 13; $i++ )
                        $options[] = self::option( $wgLang->getMonthName( $i ), $i, $selected === $i );
                return self::openElement( 'select', array( 'id' => $id, 'name' => 'month', 'class' => 'mw-month-selector' ) )
@@ -198,9 +198,9 @@ class Xml {
                } else {
                        $encYear = '';
                }
-               return Xml::label( wfMsg( 'year' ), 'year' ) . ' '.
+               return Xml::label( wfMessage( 'year' )->text(), 'year' ) . ' '.
                        Xml::input( 'year', 4, $encYear, array('id' => 'year', 'maxlength' => 4) ) . ' '.
-                       Xml::label( wfMsg( 'month' ), 'month' ) . ' '.
+                       Xml::label( wfMessage( 'month' )->text(), 'month' ) . ' '.
                        Xml::monthSelector( $encMonth, -1 );
        }
 
@@ -772,7 +772,7 @@ class Xml {
                foreach( $fields as $labelmsg => $input ) {
                        $id = "mw-$labelmsg";
                        $form .= Xml::openElement( 'tr', array( 'id' => $id ) );
-                       $form .= Xml::tags( 'td', array('class' => 'mw-label'), wfMsgExt( $labelmsg, array('parseinline') ) );
+                       $form .= Xml::tags( 'td', array('class' => 'mw-label'), wfMessage( $labelmsg )->parse() );
                        $form .= Xml::openElement( 'td', array( 'class' => 'mw-input' ) ) . $input . Xml::closeElement( 'td' );
                        $form .= Xml::closeElement( 'tr' );
                }
@@ -780,7 +780,7 @@ class Xml {
                if( $submitLabel ) {
                        $form .= Xml::openElement( 'tr' );
                        $form .= Xml::tags( 'td', array(), '' );
-                       $form .= Xml::openElement( 'td', array( 'class' => 'mw-submit' ) ) . Xml::submitButton( wfMsg( $submitLabel ) ) . Xml::closeElement( 'td' );
+                       $form .= Xml::openElement( 'td', array( 'class' => 'mw-submit' ) ) . Xml::submitButton( wfMessage( $submitLabel )->text() ) . Xml::closeElement( 'td' );
                        $form .= Xml::closeElement( 'tr' );
                }
 
index 1dacabc..89aca98 100644 (file)
@@ -248,8 +248,8 @@ class HistoryAction extends FormlessAction {
 
                $feed = new $wgFeedClasses[$type](
                        $this->getTitle()->getPrefixedText() . ' - ' .
-                       wfMsgForContent( 'history-feed-title' ),
-                       wfMsgForContent( 'history-feed-description' ),
+                       wfMessage( 'history-feed-title' )->inContentLanguage()->text(),
+                       wfMessage( 'history-feed-description' )->inContentLanguage()->text(),
                        $this->getTitle()->getFullUrl( 'action=history' )
                );
 
@@ -275,8 +275,8 @@ class HistoryAction extends FormlessAction {
 
        function feedEmpty() {
                return new FeedItem(
-                       wfMsgForContent( 'nohistory' ),
-                       $this->getOutput()->parse( wfMsgForContent( 'history-feed-empty' ) ),
+                       wfMessage( 'nohistory' )->inContentLanguage()->text(),
+                       $this->getOutput()->parse( wfMessage( 'history-feed-empty' )->inContentLanguage()->text() ),
                        $this->getTitle()->getFullUrl(),
                        wfTimestamp( TS_MW ),
                        '',
@@ -304,15 +304,15 @@ class HistoryAction extends FormlessAction {
                );
                if ( $rev->getComment() == '' ) {
                        global $wgContLang;
-                       $title = wfMsgForContent( 'history-feed-item-nocomment',
+                       $title = wfMessage( 'history-feed-item-nocomment',
                                $rev->getUserText(),
                                $wgContLang->timeanddate( $rev->getTimestamp() ),
                                $wgContLang->date( $rev->getTimestamp() ),
-                               $wgContLang->time( $rev->getTimestamp() )
+                               $wgContLang->time( $rev->getTimestamp() )->inContentLanguage()->text()
                        );
                } else {
                        $title = $rev->getUserText() .
-                       wfMsgForContent( 'colon-separator' ) .
+                       wfMessage( 'colon-separator' )->inContentLanguage()->text() .
                        FeedItem::stripComment( $rev->getComment() );
                }
                return new FeedItem(
index e75c4ad..3be4b00 100644 (file)
@@ -162,7 +162,7 @@ class ApiEditPage extends ApiBase {
                        // If no summary was given and we only undid one rev,
                        // use an autosummary
                        if ( is_null( $params['summary'] ) && $titleObj->getNextRevisionID( $undoafterRev->getID() ) == $params['undo'] ) {
-                               $params['summary'] = wfMsgForContent( 'undo-summary', $params['undo'], $undoRev->getUserText() );
+                               $params['summary'] = wfMessage( 'undo-summary', $params['undo'], $undoRev->getUserText() )->inContentLanguage()->text();
                        }
                }
 
index d808075..1cf760a 100644 (file)
@@ -60,7 +60,7 @@ class ApiFeedContributions extends ApiBase {
                        $this->dieUsage( 'Size difference is disabled in Miser Mode', 'sizediffdisabled' );
                }
 
-               $msg = wfMsgForContent( 'Contributions' );
+               $msg = wfMessage( 'Contributions' )->inContentLanguage()->text();
                $feedTitle = $wgSitename . ' - ' . $msg . ' [' . $wgLanguageCode . ']';
                $feedUrl = SpecialPage::getTitleFor( 'Contributions', $params['user'] )->getFullURL();
 
@@ -129,7 +129,8 @@ class ApiFeedContributions extends ApiBase {
         */
        protected function feedItemDesc( $revision ) {
                if( $revision ) {
-                       return '<p>' . htmlspecialchars( $revision->getUserText() ) . wfMsgForContent( 'colon-separator' ) .
+                       $msg = wfMessage( 'colon-separator' )->inContentLanguage()->text();
+                       return '<p>' . htmlspecialchars( $revision->getUserText() ) . $msg .
                                htmlspecialchars( FeedItem::stripComment( $revision->getComment() ) ) .
                                "</p>\n<hr />\n<div>" .
                                nl2br( htmlspecialchars( $revision->getText() ) ) . "</div>";
index 7f79835..6ccb02f 100644 (file)
@@ -117,7 +117,7 @@ class ApiFeedWatchlist extends ApiBase {
                                $feedItems[] = $this->createFeedItem( $info );
                        }
 
-                       $msg = wfMsgForContent( 'watchlist' );
+                       $msg = wfMessage( 'watchlist' )->inContentLanguage()->text();
 
                        $feedTitle = $wgSitename . ' - ' . $msg . ' [' . $wgLanguageCode . ']';
                        $feedUrl = SpecialPage::getTitleFor( 'Watchlist' )->getFullURL();
@@ -131,11 +131,12 @@ class ApiFeedWatchlist extends ApiBase {
                        // Error results should not be cached
                        $this->getMain()->setCacheMaxAge( 0 );
 
-                       $feedTitle = $wgSitename . ' - Error - ' . wfMsgForContent( 'watchlist' ) . ' [' . $wgLanguageCode . ']';
+                       $feedTitle = $wgSitename . ' - Error - ' . wfMessage( 'watchlist' )->inContentLanguage()->text() . ' [' . $wgLanguageCode . ']';
                        $feedUrl = SpecialPage::getTitleFor( 'Watchlist' )->getFullURL();
 
                        $feedFormat = isset( $params['feedformat'] ) ? $params['feedformat'] : 'rss';
-                       $feed = new $wgFeedClasses[$feedFormat] ( $feedTitle, htmlspecialchars( wfMsgForContent( 'watchlist' ) ), $feedUrl );
+                       $msg = wfMessage( 'watchlist' )->inContentLanguage()->escaped();
+                       $feed = new $wgFeedClasses[$feedFormat] ( $feedTitle, $msg, $feedUrl );
 
                        if ( $e instanceof UsageException ) {
                                $errorCode = $e->getCodeString();
index f64b3e5..8aac2f4 100644 (file)
@@ -413,7 +413,7 @@ class ApiParse extends ApiBase {
                        return '';
                }
 
-               $s = htmlspecialchars( wfMsg( 'otherlanguages' ) . wfMsg( 'colon-separator' ) );
+               $s = htmlspecialchars( wfMessage( 'otherlanguages' )->text() . wfMessage( 'colon-separator' )->text() );
 
                $langs = array();
                foreach ( $languages as $l ) {
index 53341c3..a53a674 100644 (file)
@@ -318,7 +318,7 @@ class DBQueryError extends DBError {
                                $fname = $this->fname;
                                $error = $this->error;
                        }
-                       return wfMsg( $msg, $sql, $fname, $this->errno, $error );
+                       return wfMessage( $msg )->rawParams( $sql, $fname, $this->errno, $error )->text();
                } else {
                        return parent::getContentMessage( $html );
                }
index 952b497..cb3da1e 100644 (file)
@@ -622,7 +622,7 @@ class DatabaseSqlite extends DatabaseBase {
         * @return string User-friendly database information
         */
        public function getServerInfo() {
-               return wfMsg( self::getFulltextSearchModule() ? 'sqlite-has-fts' : 'sqlite-no-fts', $this->getServerVersion() );
+               return wfMessage( self::getFulltextSearchModule() ? 'sqlite-has-fts' : 'sqlite-no-fts', $this->getServerVersion() )->text();
        }
 
        /**
index b183040..133a956 100644 (file)
@@ -804,7 +804,7 @@ abstract class File {
                        return $this->handler->getTransform( $this, $thumbPath, $thumbUrl, $params );
                } else {
                        return new MediaTransformError( 'thumbnail_error',
-                               $params['width'], 0, wfMsg( 'thumbnail-dest-create' ) );
+                               $params['width'], 0, wfMessage( 'thumbnail-dest-create' )->text() );
                }
        }
 
index 28b34a8..38b4a82 100644 (file)
@@ -163,7 +163,7 @@ class CliInstaller extends Installer {
        protected function getMessageText( $params ) {
                $msg = array_shift( $params );
 
-               $text = wfMsgExt( $msg, array( 'parseinline' ), $params );
+               $text = wfMessage( $msg, $params )->parse();
 
                $text = preg_replace( '/<a href="(.*?)".*?>(.*?)<\/a>/', '$2 &lt;$1&gt;', $text );
                return html_entity_decode( strip_tags( $text ), ENT_QUOTES );
index 76df7af..ca9bdf4 100644 (file)
@@ -68,7 +68,7 @@ class Ibm_db2Installer extends DatabaseInstaller {
                        $this->getTextBox( 'wgDBserver', 'config-db-host', array(), $this->parent->getHelpBox( 'config-db-host-help' ) ) .
                        $this->getTextBox( 'wgDBport', 'config-db-port', array(), $this->parent->getHelpBox( 'config-db-port' ) ) .
                        Html::openElement( 'fieldset' ) .
-                       Html::element( 'legend', array(), wfMsg( 'config-db-wiki-settings' ) ) .
+                       Html::element( 'legend', array(), wfMessage( 'config-db-wiki-settings' )->text() ) .
                        $this->getTextBox( 'wgDBname', 'config-db-name', array(), $this->parent->getHelpBox( 'config-db-name-help' ) ) .
                        $this->getTextBox( 'wgDBmwschema', 'config-db-schema', array(), $this->parent->getHelpBox( 'config-db-schema-help' ) ) .
                        Html::closeElement( 'fieldset' ) .
index 5230c81..f66f15f 100644 (file)
@@ -89,7 +89,7 @@ class MysqlInstaller extends DatabaseInstaller {
                return
                        $this->getTextBox( 'wgDBserver', 'config-db-host', array(), $this->parent->getHelpBox( 'config-db-host-help' ) ) .
                        Html::openElement( 'fieldset' ) .
-                       Html::element( 'legend', array(), wfMsg( 'config-db-wiki-settings' ) ) .
+                       Html::element( 'legend', array(), wfMessage( 'config-db-wiki-settings' )->text() ) .
                        $this->getTextBox( 'wgDBname', 'config-db-name', array( 'dir' => 'ltr' ), $this->parent->getHelpBox( 'config-db-name-help' ) ) .
                        $this->getTextBox( 'wgDBprefix', 'config-db-prefix', array( 'dir' => 'ltr' ), $this->parent->getHelpBox( 'config-db-prefix-help' ) ) .
                        Html::closeElement( 'fieldset' ) .
@@ -351,7 +351,7 @@ class MysqlInstaller extends DatabaseInstaller {
                $s .= Xml::openElement( 'div', array(
                        'id' => 'dbMyisamWarning'
                ));
-               $s .= $this->parent->getWarningBox( wfMsg( 'config-mysql-myisam-dep' ) );
+               $s .= $this->parent->getWarningBox( wfMessage( 'config-mysql-myisam-dep' )->text() );
                $s .= Xml::closeElement( 'div' );
 
                if( $this->getVar( '_MysqlEngine' ) != 'MyISAM' ) {
index 863a625..72ec800 100644 (file)
@@ -62,12 +62,12 @@ class OracleInstaller extends DatabaseInstaller {
                return
                        $this->getTextBox( 'wgDBserver', 'config-db-host-oracle', array(), $this->parent->getHelpBox( 'config-db-host-oracle-help' ) ) .
                        Html::openElement( 'fieldset' ) .
-                       Html::element( 'legend', array(), wfMsg( 'config-db-wiki-settings' ) ) .
+                       Html::element( 'legend', array(), wfMessage( 'config-db-wiki-settings' )->text() ) .
                        $this->getTextBox( 'wgDBprefix', 'config-db-prefix' ) .
                        $this->getTextBox( '_OracleDefTS', 'config-oracle-def-ts' ) .
                        $this->getTextBox( '_OracleTempTS', 'config-oracle-temp-ts', array(), $this->parent->getHelpBox( 'config-db-oracle-help' ) ) .
                        Html::closeElement( 'fieldset' ) .
-                       $this->parent->getWarningBox( wfMsg( 'config-db-account-oracle-warn' ) ).
+                       $this->parent->getWarningBox( wfMessage( 'config-db-account-oracle-warn' )->text() ).
                        $this->getInstallUserBox().
                        $this->getWebUserBox();
        }
index 641f6e3..3ac2b3a 100644 (file)
@@ -60,7 +60,7 @@ class PostgresInstaller extends DatabaseInstaller {
                        $this->getTextBox( 'wgDBserver', 'config-db-host', array(), $this->parent->getHelpBox( 'config-db-host-help' ) ) .
                        $this->getTextBox( 'wgDBport', 'config-db-port' ) .
                        Html::openElement( 'fieldset' ) .
-                       Html::element( 'legend', array(), wfMsg( 'config-db-wiki-settings' ) ) .
+                       Html::element( 'legend', array(), wfMessage( 'config-db-wiki-settings' )->text() ) .
                        $this->getTextBox( 'wgDBname', 'config-db-name', array(), $this->parent->getHelpBox( 'config-db-name-help' ) ) .
                        $this->getTextBox( 'wgDBmwschema', 'config-db-schema', array(), $this->parent->getHelpBox( 'config-db-schema-help' ) ) .
                        Html::closeElement( 'fieldset' ) .
index b6f54ea..5b86a90 100644 (file)
@@ -141,8 +141,9 @@ class DoubleRedirectJob extends Job {
                $oldUser = $wgUser;
                $wgUser = $this->getUser();
                $article = WikiPage::factory( $this->title );
-               $reason = wfMsgForContent( 'double-redirect-fixed-' . $this->reason,
-                       $this->redirTitle->getPrefixedText(), $newTitle->getPrefixedText() );
+               $reason = wfMessage( 'double-redirect-fixed-' . $this->reason,
+                       $this->redirTitle->getPrefixedText(), $newTitle->getPrefixedText()
+               )->inContentLanguage()->text();
                $article->doEdit( $newText, $reason, EDIT_UPDATE | EDIT_SUPPRESS_RC, false, $this->getUser() );
                $wgUser = $oldUser;
 
@@ -194,7 +195,7 @@ class DoubleRedirectJob extends Job {
         */
        function getUser() {
                if ( !self::$user ) {
-                       self::$user = User::newFromName( wfMsgForContent( 'double-redirect-fixer' ), false );
+                       self::$user = User::newFromName( wfMessage( 'double-redirect-fixer' )->inContentLanguage()->text(), false );
                        # FIXME: newFromName could return false on a badly configured wiki.
                        if ( !self::$user->isLoggedIn() ) {
                                self::$user->addToDatabase();
index 2ec523d..028fbb0 100644 (file)
@@ -142,11 +142,11 @@ class GIFHandler extends BitmapHandler {
                $info[] = $original;
                
                if ( $metadata['looped'] ) {
-                       $info[] = wfMsgExt( 'file-info-gif-looped', 'parseinline' );
+                       $info[] = wfMessage( 'file-info-gif-looped' )->parse();
                }
                
                if ( $metadata['frameCount'] > 1 ) {
-                       $info[] = wfMsgExt( 'file-info-gif-frames', 'parseinline', $metadata['frameCount'] );
+                       $info[] = wfMessage( 'file-info-gif-frames' )->numParams( $metadata['frameCount'] )->parse();
                }
                
                if ( $metadata['duration'] ) {
index afc7d6a..8289cd4 100644 (file)
@@ -128,13 +128,13 @@ class PNGHandler extends BitmapHandler {
                $info[] = $original;
                
                if ( $metadata['loopCount'] == 0 ) {
-                       $info[] = wfMsgExt( 'file-info-png-looped', 'parseinline' );
+                       $info[] = wfMessage( 'file-info-png-looped' )->parse();
                } elseif ( $metadata['loopCount'] > 1 ) {
-                       $info[] = wfMsgExt( 'file-info-png-repeat', 'parseinline', $metadata['loopCount'] );
+                       $info[] = wfMessage( 'file-info-png-repeat' )->numParams( $metadata['loopCount'] )->parse();
                }
                
                if ( $metadata['frameCount'] > 0 ) {
-                       $info[] = wfMsgExt( 'file-info-png-frames', 'parseinline', $metadata['frameCount'] );
+                       $info[] = wfMessage( 'file-info-png-frames' )->numParams( $metadata['frameCount'] )->parse();
                }
                
                if ( $metadata['duration'] ) {
index b95499f..b505592 100644 (file)
@@ -315,7 +315,7 @@ class SearchEngine {
                        return $parsed;
                }
 
-               $allkeyword = wfMsgForContent( 'searchall' ) . ":";
+               $allkeyword = wfMessage( 'searchall' )->inContentLanguage()->text() . ":";
                if ( strncmp( $query, $allkeyword, strlen( $allkeyword ) ) == 0 ) {
                        $this->namespaces = null;
                        $parsed = substr( $query, strlen( $allkeyword ) );
@@ -417,7 +417,7 @@ class SearchEngine {
                $formatted = array_map( array( $wgContLang, 'getFormattedNsText' ), $namespaces );
                foreach ( $formatted as $key => $ns ) {
                        if ( empty( $ns ) )
-                               $formatted[$key] = wfMsg( 'blanknamespace' );
+                               $formatted[$key] = wfMessage( 'blanknamespace' )->text();
                }
                return $formatted;
        }
index b20348d..25a3e27 100644 (file)
@@ -632,12 +632,12 @@ class SpecialEditWatchlist extends UnlistedSpecialPage {
                        // can use messages 'watchlisttools-view', 'watchlisttools-edit', 'watchlisttools-raw'
                        $tools[] = Linker::linkKnown(
                                SpecialPage::getTitleFor( $arr[0], $arr[1] ),
-                               wfMsgHtml( "watchlisttools-{$mode}" )
+                               wfMessage( "watchlisttools-{$mode}" )->escaped()
                        );
                }
                return Html::rawElement( 'span',
                                        array( 'class' => 'mw-watchlist-toollinks' ),
-                                       wfMsg( 'parentheses', $wgLang->pipeList( $tools ) ) );
+                                       wfMessage( 'parentheses', $wgLang->pipeList( $tools ) )->text() );
        }
 }
 
index 578a940..2b9b523 100644 (file)
@@ -374,7 +374,7 @@ class PageArchive {
                }
 
                if( trim( $comment ) != '' ) {
-                       $reason .= wfMsgForContent( 'colon-separator' ) . $comment;
+                       $reason .= wfMessage( 'colon-separator' )->inContentLanguage()->text() . $comment;
                }
 
                if ( $user === null ) {
index 3072408..8cecd07 100644 (file)
@@ -235,7 +235,7 @@ class SpecialUpload extends SpecialPage {
                        !$this->mTokenOk && !$this->mCancelUpload &&
                        ( $this->mUpload && $this->mUploadClicked )
                ) {
-                       $form->addPreText( wfMsgExt( 'session_fail_preview', 'parseinline' ) );
+                       $form->addPreText( $this->msg( 'session_fail_preview' )->parse() );
                }
 
                # Give a notice if the user is uploading a file that has been deleted or moved
@@ -261,10 +261,10 @@ class SpecialUpload extends SpecialPage {
                $form->addPreText( $message );
 
                # Add footer to form
-               $uploadFooter = wfMessage( 'uploadfooter' );
+               $uploadFooter = $this->msg( 'uploadfooter' );
                if ( !$uploadFooter->isDisabled() ) {
                        $form->addPostText( '<div id="mw-upload-footer-message">'
-                               . $this->getOutput()->parse( $uploadFooter->plain() ) . "</div>\n" );
+                               . $uploadFooter->parseAsBlock() . "</div>\n" );
                }
 
                return $form;
@@ -306,11 +306,11 @@ class SpecialUpload extends SpecialPage {
         */
        protected function showRecoverableUploadError( $message ) {
                $sessionKey = $this->mUpload->stashSession();
-               $message = '<h2>' . wfMsgHtml( 'uploaderror' ) . "</h2>\n" .
+               $message = '<h2>' . $this->msg( 'uploaderror' )->escaped() . "</h2>\n" .
                        '<div class="error">' . $message . "</div>\n";
 
                $form = $this->getUploadForm( $message, $sessionKey );
-               $form->setSubmitText( wfMsg( 'upload-tryagain' ) );
+               $form->setSubmitText( $this->msg( 'upload-tryagain' )->escaped() );
                $this->showUploadForm( $form );
        }
        /**
@@ -335,7 +335,7 @@ class SpecialUpload extends SpecialPage {
 
                $sessionKey = $this->mUpload->stashSession();
 
-               $warningHtml = '<h2>' . wfMsgHtml( 'uploadwarning' ) . "</h2>\n"
+               $warningHtml = '<h2>' . $this->msg( 'uploadwarning' )->escaped() . "</h2>\n"
                        . '<ul class="warning">';
                foreach( $warnings as $warning => $args ) {
                        if( $warning == 'exists' ) {
@@ -343,8 +343,8 @@ class SpecialUpload extends SpecialPage {
                        } elseif( $warning == 'duplicate' ) {
                                $msg = self::getDupeWarning( $args );
                        } elseif( $warning == 'duplicate-archive' ) {
-                               $msg = "\t<li>" . wfMsgExt( 'file-deleted-duplicate', 'parseinline',
-                                               array( Title::makeTitle( NS_FILE, $args )->getPrefixedText() ) )
+                               $msg = "\t<li>" . $this->msg( 'file-deleted-duplicate',
+                                               Title::makeTitle( NS_FILE, $args )->getPrefixedText() )->parse()
                                        . "</li>\n";
                        } else {
                                if ( $args === true ) {
@@ -352,7 +352,7 @@ class SpecialUpload extends SpecialPage {
                                } elseif ( !is_array( $args ) ) {
                                        $args = array( $args );
                                }
-                               $msg = "\t<li>" . wfMsgExt( $warning, 'parseinline', $args ) . "</li>\n";
+                               $msg = "\t<li>" . $this->msg( $warning, $args )->parse() . "</li>\n";
                        }
                        $warningHtml .= $msg;
                }
@@ -360,9 +360,9 @@ class SpecialUpload extends SpecialPage {
                $warningHtml .= wfMsgExt( 'uploadwarning-text', 'parse' );
 
                $form = $this->getUploadForm( $warningHtml, $sessionKey, /* $hideIgnoreWarning */ true );
-               $form->setSubmitText( wfMsg( 'upload-tryagain' ) );
-               $form->addButton( 'wpUploadIgnoreWarning', wfMsg( 'ignorewarning' ) );
-               $form->addButton( 'wpCancelUpload', wfMsg( 'reuploaddesc' ) );
+               $form->setSubmitText( $this->msg( 'upload-tryagain' )->text() );
+               $form->addButton( 'wpUploadIgnoreWarning', $this->msg( 'ignorewarning' )->text() );
+               $form->addButton( 'wpCancelUpload', $this->msg( 'reuploaddesc' )->text() );
 
                $this->showUploadForm( $form );
 
@@ -376,7 +376,7 @@ class SpecialUpload extends SpecialPage {
         * @param $message string HTML string
         */
        protected function showUploadError( $message ) {
-               $message = '<h2>' . wfMsgHtml( 'uploadwarning' ) . "</h2>\n" .
+               $message = '<h2>' . $this->msg( 'uploadwarning' )->escaped() . "</h2>\n" .
                        '<div class="error">' . $message . "</div>\n";
                $this->showUploadForm( $this->getUploadForm( $message ) );
        }
@@ -414,8 +414,7 @@ class SpecialUpload extends SpecialPage {
                $permErrors = $this->mUpload->verifyTitlePermissions( $this->getUser() );
                if( $permErrors !== true ) {
                        $code = array_shift( $permErrors[0] );
-                       $this->showRecoverableUploadError( wfMsgExt( $code,
-                                       'parseinline', $permErrors[0] ) );
+                       $this->showRecoverableUploadError( $this->msg( $code, $permErrors[0] )->parse() );
                        return;
                }
 
@@ -469,7 +468,7 @@ class SpecialUpload extends SpecialPage {
                        if ( in_array( $msgName, $wgForceUIMsgAsContentMsg ) ) {
                                $msg[$msgName] = "{{int:$msgName}}";
                        } else {
-                               $msg[$msgName] = wfMsgForContent( $msgName );
+                               $msg[$msgName] = wfMessage( $msgName )->inContentLanguage()->text();
                        }
                }
 
@@ -536,33 +535,31 @@ class SpecialUpload extends SpecialPage {
 
                        /** Statuses that only require name changing **/
                        case UploadBase::MIN_LENGTH_PARTNAME:
-                               $this->showRecoverableUploadError( wfMsgHtml( 'minlength1' ) );
+                               $this->showRecoverableUploadError( $this->msg( 'minlength1' )->escaped() );
                                break;
                        case UploadBase::ILLEGAL_FILENAME:
-                               $this->showRecoverableUploadError( wfMsgExt( 'illegalfilename',
-                                       'parseinline', $details['filtered'] ) );
+                               $this->showRecoverableUploadError( $this->msg( 'illegalfilename',
+                                       $details['filtered'] )->parse() );
                                break;
                        case UploadBase::FILENAME_TOO_LONG:
-                               $this->showRecoverableUploadError( wfMsgHtml( 'filename-toolong' ) );
+                               $this->showRecoverableUploadError( $this->msg( 'filename-toolong' )->escaped() );
                                break;
                        case UploadBase::FILETYPE_MISSING:
-                               $this->showRecoverableUploadError( wfMsgExt( 'filetype-missing',
-                                       'parseinline' ) );
+                               $this->showRecoverableUploadError( $this->msg( 'filetype-missing' )->parse() );
                                break;
                        case UploadBase::WINDOWS_NONASCII_FILENAME:
-                               $this->showRecoverableUploadError( wfMsgExt( 'windows-nonascii-filename',
-                                       'parseinline' ) );
+                               $this->showRecoverableUploadError( $this->msg( 'windows-nonascii-filename' )->parse() );
                                break;
 
                        /** Statuses that require reuploading **/
                        case UploadBase::EMPTY_FILE:
-                               $this->showUploadError( wfMsgHtml( 'emptyfile' ) );
+                               $this->showUploadError( $this->msg( 'emptyfile' )->escaped() );
                                break;
                        case UploadBase::FILE_TOO_LARGE:
-                               $this->showUploadError( wfMsgHtml( 'largefileserver' ) );
+                               $this->showUploadError( $this->msg( 'largefileserver' )->escaped() );
                                break;
                        case UploadBase::FILETYPE_BADTYPE:
-                               $msg = wfMessage( 'filetype-banned-type' );
+                               $msg = $this->msg( 'filetype-banned-type' );
                                if ( isset( $details['blacklistedExt'] ) ) {
                                        $msg->params( $this->getLanguage()->commaList( $details['blacklistedExt'] ) );
                                } else {
@@ -585,7 +582,7 @@ class SpecialUpload extends SpecialPage {
                        case UploadBase::VERIFICATION_ERROR:
                                unset( $details['status'] );
                                $code = array_shift( $details['details'] );
-                               $this->showUploadError( wfMsgExt( $code, 'parseinline', $details['details'] ) );
+                               $this->showUploadError( $this->msg( $code, $details['details'] )->parse() );
                                break;
                        case UploadBase::HOOK_ABORTED:
                                if ( is_array( $details['error'] ) ) { # allow hooks to return error details in an array
@@ -596,7 +593,7 @@ class SpecialUpload extends SpecialPage {
                                        $args = null;
                                }
 
-                               $this->showUploadError( wfMsgExt( $error, 'parseinline', $args ) );
+                               $this->showUploadError( $this->msg( $error, $args )->parse() );
                                break;
                        default:
                                throw new MWException( __METHOD__ . ": Unknown value `{$details['status']}`" );
@@ -641,30 +638,30 @@ class SpecialUpload extends SpecialPage {
 
                if( $exists['warning'] == 'exists' ) {
                        // Exact match
-                       $warning = wfMsgExt( 'fileexists', 'parseinline', $filename );
+                       $warning = wfMessage( 'fileexists', $filename )->parse();
                } elseif( $exists['warning'] == 'page-exists' ) {
                        // Page exists but file does not
-                       $warning = wfMsgExt( 'filepageexists', 'parseinline', $filename );
+                       $warning = wfMessage( 'filepageexists', $filename )->parse();
                } elseif ( $exists['warning'] == 'exists-normalized' ) {
-                       $warning = wfMsgExt( 'fileexists-extension', 'parseinline', $filename,
-                               $exists['normalizedFile']->getTitle()->getPrefixedText() );
+                       $warning = wfMessage( 'fileexists-extension', $filename,
+                               $exists['normalizedFile']->getTitle()->getPrefixedText() )->parse();
                } elseif ( $exists['warning'] == 'thumb' ) {
                        // Swapped argument order compared with other messages for backwards compatibility
-                       $warning = wfMsgExt( 'fileexists-thumbnail-yes', 'parseinline',
-                               $exists['thumbFile']->getTitle()->getPrefixedText(), $filename );
+                       $warning = wfMessage( 'fileexists-thumbnail-yes', 
+                               $exists['thumbFile']->getTitle()->getPrefixedText(), $filename )->parse();
                } elseif ( $exists['warning'] == 'thumb-name' ) {
                        // Image w/o '180px-' does not exists, but we do not like these filenames
                        $name = $file->getName();
                        $badPart = substr( $name, 0, strpos( $name, '-' ) + 1 );
-                       $warning = wfMsgExt( 'file-thumbnail-no', 'parseinline', $badPart );
+                       $warning = wfMessage( 'file-thumbnail-no', $badPart )->parse();
                } elseif ( $exists['warning'] == 'bad-prefix' ) {
-                       $warning = wfMsgExt( 'filename-bad-prefix', 'parseinline', $exists['prefix'] );
+                       $warning = wfMessage( 'filename-bad-prefix', $exists['prefix'] )->parse();
                } elseif ( $exists['warning'] == 'was-deleted' ) {
                        # If the file existed before and was deleted, warn the user of this
                        $ltitle = SpecialPage::getTitleFor( 'Log' );
                        $llink = Linker::linkKnown(
                                $ltitle,
-                               wfMsgHtml( 'deletionlog' ),
+                               wfMessage( 'deletionlog' )->escaped(),
                                array(),
                                array(
                                        'type' => 'delete',
@@ -775,7 +772,7 @@ class UploadForm extends HTMLForm {
                parent::__construct( $descriptor, $context, 'upload' );
 
                # Set some form properties
-               $this->setSubmitText( wfMsg( 'uploadbtn' ) );
+               $this->setSubmitText( $this->msg( 'uploadbtn' )->text() );
                $this->setSubmitName( 'wpUpload' );
                # Used message keys: 'accesskey-upload', 'tooltip-upload'
                $this->setSubmitTooltip( 'upload' );
@@ -846,7 +843,7 @@ class UploadForm extends HTMLForm {
                        'help' => wfMsgExt( 'upload-maxfilesize',
                                        array( 'parseinline', 'escapenoentities' ),
                                        $this->getContext()->getLanguage()->formatSize( $this->mMaxUploadSize['file'] )
-                               ) . ' ' . wfMsgHtml( 'upload_source_file' ),
+                               ) . ' ' . $this->msg( 'upload_source_file' )->escaped(),
                        'checked' => $selectedSourceType == 'file',
                );
                if ( $canUploadByUrl ) {
@@ -861,7 +858,7 @@ class UploadForm extends HTMLForm {
                                'help' => wfMsgExt( 'upload-maxfilesize',
                                                array( 'parseinline', 'escapenoentities' ),
                                                $this->getContext()->getLanguage()->formatSize( $this->mMaxUploadSize['url'] )
-                                       ) . ' ' . wfMsgHtml( 'upload_source_url' ),
+                                       ) . ' ' . $this->msg( 'upload_source_url' )->escaped(),
                                'checked' => $selectedSourceType == 'url',
                        );
                }
index a1cda0d..fbc2c93 100644 (file)
@@ -80,13 +80,13 @@ class SpecialVersion extends SpecialPage {
         * @return string
         */
        private static function getMediaWikiCredits() {
-               $ret = Xml::element( 'h2', array( 'id' => 'mw-version-license' ), wfMsg( 'version-license' ) );
+               $ret = Xml::element( 'h2', array( 'id' => 'mw-version-license' ), wfMessage( 'version-license' )->text() );
 
                // This text is always left-to-right.
                $ret .= '<div>';
                $ret .= "__NOTOC__
                " . self::getCopyrightAndAuthorList() . "\n
-               " . wfMsg( 'version-license-info' );
+               " . wfMessage( 'version-license-info' )->text();
                $ret .= '</div>';
 
                return str_replace( "\t\t", '', $ret ) . "\n";
@@ -109,11 +109,11 @@ class SpecialVersion extends SpecialPage {
                        'Roan Kattouw', 'Trevor Parscal', 'Bryan Tong Minh', 'Sam Reed',
                        'Victor Vasiliev', 'Rotem Liss', 'Platonides', 'Antoine Musso',
                        'Timo Tijhof',
-                       wfMsg( 'version-poweredby-others' )
+                       wfMessage( 'version-poweredby-others' )->text()
                );
 
-               return wfMsg( 'version-poweredby-credits', date( 'Y' ),
-                       $wgLang->listToText( $authorList ) );
+               return wfMessage( 'version-poweredby-credits', date( 'Y' ),
+                       $wgLang->listToText( $authorList ) )->text();
        }
 
        /**
@@ -125,8 +125,8 @@ class SpecialVersion extends SpecialPage {
                $dbr = wfGetDB( DB_SLAVE );
 
                // Put the software in an array of form 'name' => 'version'. All messages should
-               // be loaded here, so feel free to use wfMsg*() in the 'name'. Raw HTML or wikimarkup
-               // can be used.
+               // be loaded here, so feel free to use wfMessage in the 'name'. Raw HTML or
+               // wikimarkup can be used.
                $software = array();
                $software['[https://www.mediawiki.org/ MediaWiki]'] = self::getVersionLinked();
                $software['[http://www.php.net/ PHP]'] = phpversion() . " (" . php_sapi_name() . ")";
@@ -135,11 +135,11 @@ class SpecialVersion extends SpecialPage {
                // Allow a hook to add/remove items.
                wfRunHooks( 'SoftwareInfo', array( &$software ) );
 
-               $out = Xml::element( 'h2', array( 'id' => 'mw-version-software' ), wfMsg( 'version-software' ) ) .
+               $out = Xml::element( 'h2', array( 'id' => 'mw-version-software' ), wfMessage( 'version-software' )->text() ) .
                           Xml::openElement( 'table', array( 'class' => 'wikitable', 'id' => 'sv-software' ) ) .
                                "<tr>
-                                       <th>" . wfMsg( 'version-software-product' ) . "</th>
-                                       <th>" . wfMsg( 'version-software-version' ) . "</th>
+                                       <th>" . wfMessage( 'version-software-product' )->text() . "</th>
+                                       <th>" . wfMessage( 'version-software-version' )->text() . "</th>
                                </tr>\n";
 
                foreach( $software as $name => $version ) {
@@ -177,11 +177,11 @@ class SpecialVersion extends SpecialPage {
                        $version = "$wgVersion (r{$svnInfo['checkout-rev']})";
                } else {
                        $version = $wgVersion . ' ' .
-                               wfMsg(
+                               wfMessage(
                                        'version-svn-revision',
                                        isset( $info['directory-rev'] ) ? $info['directory-rev'] : '',
                                        $info['checkout-rev']
-                               );
+                               )->text();
                }
 
                wfProfileOut( __METHOD__ );
@@ -227,11 +227,11 @@ class SpecialVersion extends SpecialPage {
                        return false;
                }
 
-               $linkText = wfMsg(
+               $linkText = wfMessage(
                        'version-svn-revision',
                        isset( $info['directory-rev'] ) ? $info['directory-rev'] : '',
                        $info['checkout-rev']
-               );
+               )->text();
 
                if ( isset( $info['viewvc-url'] ) ) {
                        $version = "$wgVersion [{$info['viewvc-url']} $linkText]";
@@ -277,14 +277,14 @@ class SpecialVersion extends SpecialPage {
        public static function getExtensionTypes() {
                if ( self::$extensionTypes === false ) {
                        self::$extensionTypes = array(
-                               'specialpage' => wfMsg( 'version-specialpages' ),
-                               'parserhook' => wfMsg( 'version-parserhooks' ),
-                               'variable' => wfMsg( 'version-variables' ),
-                               'media' => wfMsg( 'version-mediahandlers' ),
-                               'antispam' => wfMsg( 'version-antispam' ),
-                               'skin' => wfMsg( 'version-skins' ),
-                               'api' => wfMsg( 'version-api' ),
-                               'other' => wfMsg( 'version-other' ),
+                               'specialpage' => wfMessage( 'version-specialpages' )->text(),
+                               'parserhook' => wfMessage( 'version-parserhooks' )->text(),
+                               'variable' => wfMessage( 'version-variables' )->text(),
+                               'media' => wfMessage( 'version-mediahandlers' )->text(),
+                               'antispam' => wfMessage( 'version-antispam' )->text(),
+                               'skin' => wfMessage( 'version-skins' )->text(),
+                               'api' => wfMessage( 'version-api' )->text(),
+                               'other' => wfMessage( 'version-other' )->text(),
                        );
 
                        wfRunHooks( 'ExtensionTypes', array( &self::$extensionTypes ) );
@@ -326,7 +326,7 @@ class SpecialVersion extends SpecialPage {
                 */
                wfRunHooks( 'SpecialVersionExtensionTypes', array( &$this, &$extensionTypes ) );
 
-               $out = Xml::element( 'h2', array( 'id' => 'mw-version-ext' ), wfMsg( 'version-extensions' ) ) .
+               $out = Xml::element( 'h2', array( 'id' => 'mw-version-ext' ), $this->msg( 'version-extensions' )->text() ) .
                        Xml::openElement( 'table', array( 'class' => 'wikitable', 'id' => 'sv-ext' ) );
 
                // Make sure the 'other' type is set to an array.
@@ -352,7 +352,7 @@ class SpecialVersion extends SpecialPage {
                $out .= $this->getExtensionCategory( 'other', $extensionTypes['other'] );
 
                if ( count( $wgExtensionFunctions ) ) {
-                       $out .= $this->openExtType( wfMsg( 'version-extension-functions' ), 'extension-functions' );
+                       $out .= $this->openExtType( $this->msg( 'version-extension-functions' )->text(), 'extension-functions' );
                        $out .= '<tr><td colspan="4">' . $this->listToText( $wgExtensionFunctions ) . "</td></tr>\n";
                }
 
@@ -363,13 +363,13 @@ class SpecialVersion extends SpecialPage {
                        for ( $i = 0; $i < $cnt; ++$i ) {
                                $tags[$i] = "&lt;{$tags[$i]}&gt;";
                        }
-                       $out .= $this->openExtType( wfMsg( 'version-parser-extensiontags' ), 'parser-tags' );
+                       $out .= $this->openExtType( $this->msg( 'version-parser-extensiontags' )->text(), 'parser-tags' );
                        $out .= '<tr><td colspan="4">' . $this->listToText( $tags ). "</td></tr>\n";
                }
 
                $fhooks = $wgParser->getFunctionHooks();
                if( count( $fhooks ) ) {
-                       $out .= $this->openExtType( wfMsg( 'version-parser-function-hooks' ), 'parser-function-hooks' );
+                       $out .= $this->openExtType( $this->msg( 'version-parser-function-hooks' )->text(), 'parser-function-hooks' );
                        $out .= '<tr><td colspan="4">' . $this->listToText( $fhooks ) . "</td></tr>\n";
                }
 
@@ -448,7 +448,7 @@ class SpecialVersion extends SpecialPage {
                                # Make subversion text/link.
                                if ( $svnInfo !== false ) {
                                        $directoryRev = isset( $svnInfo['directory-rev'] ) ? $svnInfo['directory-rev'] : null;
-                                       $vcsText = wfMsg( 'version-svn-revision', $directoryRev, $svnInfo['checkout-rev'] );
+                                       $vcsText = $this->msg( 'version-svn-revision', $directoryRev, $svnInfo['checkout-rev'] )->text();
                                        $vcsText = isset( $svnInfo['viewvc-url'] ) ? '[' . $svnInfo['viewvc-url'] . " $vcsText]" : $vcsText;
                                }
                        }
@@ -463,7 +463,7 @@ class SpecialVersion extends SpecialPage {
 
                if ( isset( $extension['version'] ) ) {
                        $versionText = '<span class="mw-version-ext-version">' .
-                               wfMsg( 'version-version', $extension['version'] ) .
+                               $this->msg( 'version-version', $extension['version'] )->text() .
                                '</span>';
                } else {
                        $versionText = '';
@@ -480,9 +480,9 @@ class SpecialVersion extends SpecialPage {
                                $descriptionMsgKey = $descriptionMsg[0]; // Get the message key
                                array_shift( $descriptionMsg ); // Shift out the message key to get the parameters only
                                array_map( "htmlspecialchars", $descriptionMsg ); // For sanity
-                               $description = wfMsg( $descriptionMsgKey, $descriptionMsg );
+                               $description = $this->msg( $descriptionMsgKey, $descriptionMsg )->text();
                        } else {
-                               $description = wfMsg( $descriptionMsg );
+                               $description = $this->msg( $descriptionMsg )->text();
                        }
                }
 
@@ -515,11 +515,11 @@ class SpecialVersion extends SpecialPage {
                        $myWgHooks = $wgHooks;
                        ksort( $myWgHooks );
 
-                       $ret = Xml::element( 'h2', array( 'id' => 'mw-version-hooks' ), wfMsg( 'version-hooks' ) ) .
+                       $ret = Xml::element( 'h2', array( 'id' => 'mw-version-hooks' ), $this->msg( 'version-hooks' )->text() ) .
                                Xml::openElement( 'table', array( 'class' => 'wikitable', 'id' => 'sv-hooks' ) ) .
                                "<tr>
-                                       <th>" . wfMsg( 'version-hook-name' ) . "</th>
-                                       <th>" . wfMsg( 'version-hook-subscribedby' ) . "</th>
+                                       <th>" . $this->msg( 'version-hook-name' )->text() . "</th>
+                                       <th>" . $this->msg( 'version-hook-subscribedby' )->text() . "</th>
                                </tr>\n";
 
                        foreach ( $myWgHooks as $hook => $hooks ) {
@@ -575,7 +575,7 @@ class SpecialVersion extends SpecialPage {
                $list = array();
                foreach( (array)$authors as $item ) {
                        if( $item == '...' ) {
-                               $list[] = wfMsg( 'version-poweredby-others' );
+                               $list[] = $this->msg( 'version-poweredby-others' )->text();
                        } else {
                                $list[] = $item;
                        }
@@ -759,11 +759,11 @@ class SpecialVersion extends SpecialPage {
                        'version-entrypoints-load-php' => wfScript( 'load' ),
                );
 
-               $out = Html::element( 'h2', array( 'id' => 'mw-version-entrypoints' ), wfMsg( 'version-entrypoints' ) ) .
+               $out = Html::element( 'h2', array( 'id' => 'mw-version-entrypoints' ), $this->msg( 'version-entrypoints' )->text() ) .
                        Html::openElement( 'table', array( 'class' => 'wikitable', 'id' => 'mw-version-entrypoints-table' ) ) .
                        Html::openElement( 'tr' ) .
-                       Html::element( 'th', array(), wfMessage( 'version-entrypoints-header-entrypoint' )->text() ) .
-                       Html::element( 'th', array(), wfMessage( 'version-entrypoints-header-url' )->text() ) .
+                       Html::element( 'th', array(), $this->msg( 'version-entrypoints-header-entrypoint' )->text() ) .
+                       Html::element( 'th', array(), $this->msg( 'version-entrypoints-header-url' )->text() ) .
                        Html::closeElement( 'tr' );
 
                foreach ( $entryPoints as $message => $value ) {
@@ -771,7 +771,7 @@ class SpecialVersion extends SpecialPage {
                        $out .= Html::openElement( 'tr' ) .
                                // ->text() looks like it should be ->parse(), but this function
                                // returns wikitext, not HTML, boo
-                               Html::rawElement( 'td', array(), wfMessage( $message )->text() ) .
+                               Html::rawElement( 'td', array(), $this->msg( $message )->text() ) .
                                Html::rawElement( 'td', array(), Html::rawElement( 'code', array(), "[$url $value]" ) ) .
                                Html::closeElement( 'tr' );
                }
index ba3a05c..6ef3be2 100644 (file)
@@ -1184,7 +1184,7 @@ abstract class UploadBase {
                        $wgOut->wrapWikiMsg( "<div class=\"error\">\n$1\n</div>",
                                array( 'virus-badscanner', $wgAntivirus ) );
                        wfProfileOut( __METHOD__ );
-                       return wfMsg( 'virus-unknownscanner' ) . " $wgAntivirus";
+                       return wfMessage( 'virus-unknownscanner' )->text() . " $wgAntivirus";
                }
 
                # look up scanner configuration
index 320cdf2..06f4073 100644 (file)
@@ -800,7 +800,7 @@ class Language {
         * @return string
         */
        function getMessageFromDB( $msg ) {
-               return wfMsgExt( $msg, array( 'parsemag', 'language' => $this ) );
+               return wfMessage( $msg )->inLanguage( $this )->text();
        }
 
        /**
@@ -2865,7 +2865,7 @@ class Language {
          *
          * An example of this function being called:
          * <code>
-         * wfMsg( 'message', $wgLang->formatNum( $num ) )
+         * wfMessage( 'message' )->numParams( $num )->text()
          * </code>
          *
          * See LanguageGu.php for the Gujarati implementation and
index edc4822..cbd5d9a 100644 (file)
@@ -687,8 +687,8 @@ class LanguageConverter {
                                                $inner .= '-{';
                                                if ( !$warningDone ) {
                                                        $inner .= '<span class="error">' .
-                                                               wfMsgForContent( 'language-converter-depth-warning',
-                                                                       $this->mMaxDepth ) .
+                                                               wfMessage( 'language-converter-depth-warning' )
+                                                                       ->numParams( $this->mMaxDepth )->inContentLanguage()->text() .
                                                                '</span>';
                                                        $warningDone = true;
                                                }
index 42d8440..2051c89 100644 (file)
@@ -41,7 +41,7 @@ class CleanupSpam extends Maintenance {
        public function execute() {
                global $wgLocalDatabases, $wgUser;
 
-               $username = wfMsg( 'spambot_username' );
+               $username = wfMessage( 'spambot_username' )->text();
                $wgUser = User::newFromName( $username );
                if ( !$wgUser ) {
                        $this->error( "Invalid username", true );
@@ -118,16 +118,16 @@ class CleanupSpam extends Maintenance {
                        if ( $rev ) {
                                // Revert to this revision
                                $this->output( "reverting\n" );
-                               $page->doEdit( $rev->getText(), wfMsgForContent( 'spam_reverting', $domain ),
+                               $page->doEdit( $rev->getText(), wfMessage( 'spam_reverting', $domain )->inContentLanguage()->text(),
                                        EDIT_UPDATE, $rev->getId() );
                        } elseif ( $this->hasOption( 'delete' ) ) {
                                // Didn't find a non-spammy revision, blank the page
                                $this->output( "deleting\n" );
-                               $page->doDeleteArticle( wfMsgForContent( 'spam_deleting', $domain ) );
+                               $page->doDeleteArticle( wfMessage( 'spam_deleting', $domain )->inContentLanguage()->text() );
                        } else {
                                // Didn't find a non-spammy revision, blank the page
                                $this->output( "blanking\n" );
-                               $page->doEdit( '', wfMsgForContent( 'spam_blanking', $domain ) );
+                               $page->doEdit( '', wfMessage( 'spam_blanking', $domain )->inContentLanguage()->text() );
                        }
                        $dbw->commit( __METHOD__ );
                }
index 9bdda09..b7ca88d 100644 (file)
@@ -35,7 +35,7 @@ class DumpMessages extends Maintenance {
 
                $messages = array();
                foreach ( array_keys( Language::getMessagesFor( 'en' ) ) as $key ) {
-                       $messages[$key] = wfMsg( $key );
+                       $messages[$key] = wfMessage( $key )->text();
                }
                $this->output( "MediaWiki $wgVersion language file\n" );
                $this->output( serialize( $messages ) );
index f846994..78db8b9 100644 (file)
@@ -102,7 +102,7 @@ class MoveBatch extends Maintenance {
                        $err = $source->moveTo( $dest, false, $reason );
                        if ( $err !== true ) {
                                $msg = array_shift( $err[0] );
-                               $this->output( "\nFAILED: " . wfMsg( $msg, $err[0] ) );
+                               $this->output( "\nFAILED: " . wfMessage( $msg, $err[0] )->text() );
                        }
                        $dbw->commit( __METHOD__ );
                        $this->output( "\n" );
index a5e48fa..630b05c 100644 (file)
@@ -54,7 +54,7 @@ print Xml::openElement( 'OpenSearchDescription',
 //
 // Behavior seems about the same between Firefox and IE 7/8 here.
 // 'Description' doesn't appear to be used by either.
-$fullName = wfMsgForContent( 'opensearch-desc' );
+$fullName = wfMessage( 'opensearch-desc' )->inContentLanguage()->text();
 print Xml::element( 'ShortName', null, $fullName );
 print Xml::element( 'Description', null, $fullName );
 
index 214d9bc..155dace 100644 (file)
@@ -84,14 +84,14 @@ class CologneBlueTemplate extends LegacyTemplate {
 
                $s .= '<td class="top" nowrap="nowrap">';
                $s .= '<a href="' . htmlspecialchars( $mainPageObj->getLocalURL() ) . '">';
-               $s .= '<span id="sitetitle">' . wfMsg( 'sitetitle' ) . '</span></a>';
+               $s .= '<span id="sitetitle">' . $this->msg( 'sitetitle' )->text() . '</span></a>';
 
                $s .= '</td><td class="top" id="top-syslinks" width="100%">';
                $s .= $this->sysLinks();
                $s .= '</td></tr><tr><td class="top-subheader">';
 
                $s .= '<font size="-1"><span id="sitesub">';
-               $s .= htmlspecialchars( wfMsg( 'sitesubtitle' ) ) . '</span></font>';
+               $s .= htmlspecialchars( $this->msg( 'sitesubtitle' )->text() ) . '</span></font>';
                $s .= '</td><td class="top-linkcollection">';
 
                $s .= '<font size="-1"><span id="langlinks">';
@@ -136,7 +136,7 @@ class CologneBlueTemplate extends LegacyTemplate {
                                array( 'known', 'noclasses' )
                        ),
                        $this->getSkin()->aboutLink(),
-                       $this->searchForm( wfMsg( 'qbfind' ) )
+                       $this->searchForm( $this->msg( 'qbfind' )->text() )
                ) );
 
                $s .= "\n<br />" . $this->pageStats();
@@ -167,16 +167,16 @@ class CologneBlueTemplate extends LegacyTemplate {
                $s = array(
                        $this->getSkin()->mainPageLink(),
                        Linker::linkKnown(
-                               Title::newFromText( wfMsgForContent( 'aboutpage' ) ),
-                               wfMsg( 'about' )
+                               Title::newFromText( $this->msg( 'aboutpage' )->inContentLanguage()->text() ),
+                               $this->msg( 'about' )->text()
                        ),
                        Linker::linkKnown(
-                               Title::newFromText( wfMsgForContent( 'helppage' ) ),
-                               wfMsg( 'help' )
+                               Title::newFromText( $this->msg( 'helppage' )->inContentLanguage()->text() ),
+                               $this->msg( 'help' )->text()
                        ),
                        Linker::linkKnown(
-                               Title::newFromText( wfMsgForContent( 'faqpage' ) ),
-                               wfMsg( 'faq' )
+                               Title::newFromText( $this->msg( 'faqpage' )->inContentLanguage()->text() ),
+                               $this->msg( 'faq' )->text()
                        ),
                        Linker::specialLink( 'Specialpages' )
                );
@@ -191,14 +191,14 @@ class CologneBlueTemplate extends LegacyTemplate {
                if ( $this->data['loggedin'] ) {
                        $s[] = Linker::linkKnown(
                                $lo,
-                               wfMsg( 'logout' ),
+                               $this->msg( 'logout' )->text(),
                                array(),
                                $q
                        );
                } else {
                        $s[] = Linker::linkKnown(
                                $li,
-                               wfMsg( 'login' ),
+                               $this->msg( 'login' )->text(),
                                array(),
                                $q
                        );
@@ -257,8 +257,8 @@ class CologneBlueTemplate extends LegacyTemplate {
                        $s .= '<strong>' . $this->editThisPage() . '</strong>';
 
                        $s .= $sep . Linker::linkKnown(
-                               Title::newFromText( wfMsgForContent( 'edithelppage' ) ),
-                               wfMsg( 'edithelp' )
+                               Title::newFromText( $this->msg( 'edithelppage' )->inContentLanguage()->text() ),
+                               $this->msg( 'edithelp' )->text()
                        );
 
                        if( $this->data['loggedin'] ) {
@@ -311,7 +311,7 @@ class CologneBlueTemplate extends LegacyTemplate {
                if ( $this->data['loggedin'] ) {
                        $tl = Linker::link(
                                $user->getTalkPage(),
-                               wfMsg( 'mytalk' ),
+                               $this->msg( 'mytalk' )->text(),
                                array(),
                                array(),
                                array( 'known', 'noclasses' )
@@ -322,7 +322,7 @@ class CologneBlueTemplate extends LegacyTemplate {
 
                        $s .= Linker::link(
                                        $user->getUserPage(),
-                                       wfMsg( 'mypage' ),
+                                       $this->msg( 'mypage' )->text(),
                                        array(),
                                        array(),
                                        array( 'known', 'noclasses' )
@@ -330,7 +330,7 @@ class CologneBlueTemplate extends LegacyTemplate {
                                        . $sep .
                                Linker::link(
                                        SpecialPage::getSafeTitleFor( 'Contributions', $user->getName() ),
-                                       wfMsg( 'mycontris' ),
+                                       $this->msg( 'mycontris' )->text(),
                                        array(),
                                        array(),
                                        array( 'known', 'noclasses' )
@@ -352,12 +352,12 @@ class CologneBlueTemplate extends LegacyTemplate {
 
                if( $wgSiteSupportPage ) {
                        $s .= $sep . '<a href="' . htmlspecialchars( $wgSiteSupportPage ) . '" class="internal">'
-                                       . wfMsg( 'sitesupport' ) . '</a>';
+                                       . $this->msg( 'sitesupport' )->text() . '</a>';
                }
 
                $s .= $sep . Linker::link(
                        SpecialPage::getTitleFor( 'Specialpages' ),
-                       wfMsg( 'moredotdotdot' ),
+                       $this->msg( 'moredotdotdot' )->text(),
                        array(),
                        array(),
                        array( 'known', 'noclasses' )
@@ -372,7 +372,7 @@ class CologneBlueTemplate extends LegacyTemplate {
         * @return string
         */
        function menuHead( $key ) {
-               $s = "\n<h6>" . wfMsg( $key ) . "</h6>";
+               $s = "\n<h6>" . $this->msg( $key )->text() . "</h6>";
                return $s;
        }
 
@@ -392,12 +392,12 @@ class CologneBlueTemplate extends LegacyTemplate {
 
                $s .= "<input type='text' id=\"searchInput{$this->searchboxes}\" class=\"mw-searchInput\" name=\"search\" size=\"14\" value=\""
                        . htmlspecialchars( substr( $search, 0, 256 ) ) . "\" /><br />"
-                       . "<input type='submit' id=\"searchGoButton{$this->searchboxes}\" class=\"searchButton\" name=\"go\" value=\"" . htmlspecialchars( wfMsg( 'searcharticle' ) ) . "\" />";
+                       . "<input type='submit' id=\"searchGoButton{$this->searchboxes}\" class=\"searchButton\" name=\"go\" value=\"" . htmlspecialchars( wfMessage( 'searcharticle' )->text() ) . "\" />";
 
                if( $wgUseTwoButtonsSearchForm ) {
-                       $s .= "<input type='submit' id=\"mw-searchButton{$this->searchboxes}\" class=\"searchButton\" name=\"fulltext\" value=\"" . htmlspecialchars( wfMsg( 'search' ) ) . "\" />\n";
+                       $s .= "<input type='submit' id=\"mw-searchButton{$this->searchboxes}\" class=\"searchButton\" name=\"fulltext\" value=\"" . htmlspecialchars( $this->msg( 'search' )->text() ) . "\" />\n";
                } else {
-                       $s .= '<div><a href="' . $action . '" rel="search">' . wfMsg( 'powersearch-legend' ) . "</a></div>\n";
+                       $s .= '<div><a href="' . $action . '" rel="search">' . $this->msg( 'powersearch-legend' )->text() . "</a></div>\n";
                }
 
                $s .= '</form>';
index 98437e2..295058c 100644 (file)
@@ -99,8 +99,8 @@ class NostalgiaTemplate extends LegacyTemplate {
                } else {
                        /* show user page and user talk links */
                        $user = $this->getSkin()->getUser();
-                       $s .= $sep . Linker::link( $user->getUserPage(), wfMsgHtml( 'mypage' ) );
-                       $s .= $sep . Linker::link( $user->getTalkPage(), wfMsgHtml( 'mytalk' ) );
+                       $s .= $sep . Linker::link( $user->getUserPage(), $this->msg( 'mypage' )->escaped() );
+                       $s .= $sep . Linker::link( $user->getTalkPage(), $this->msg( 'mytalk' )->escaped() );
                        if ( $user->getNewtalk() ) {
                                $s .= ' *';
                        }
@@ -109,7 +109,7 @@ class NostalgiaTemplate extends LegacyTemplate {
                        /* show my contributions link */
                        $s .= $sep . Linker::link(
                                SpecialPage::getSafeTitleFor( 'Contributions', $this->data['username'] ),
-                               wfMsgHtml( 'mycontris' ) );
+                               $this->msg( 'mycontris' )->escaped() );
                        /* show my preferences link */
                        $s .= $sep . Linker::specialLink( 'Preferences' );
                        /* show upload file link */
index 1114e7d..0b43a13 100644 (file)
@@ -133,7 +133,7 @@ class StandardTemplate extends LegacyTemplate {
                                        $s.= Linker::specialLink( 'Watchlist' ) ;
                                        $s .= $sep . Linker::linkKnown(
                                                SpecialPage::getTitleFor( 'Contributions' ),
-                                               wfMsg( 'mycontris' ),
+                                               $this->msg( 'mycontris' )->text(),
                                                array(),
                                                array( 'target' => $this->data['username'] )
                                        );
@@ -158,34 +158,34 @@ class StandardTemplate extends LegacyTemplate {
                                                case NS_TEMPLATE_TALK:
                                                case NS_HELP_TALK:
                                                case NS_CATEGORY_TALK:
-                                                       $text = wfMsg('viewtalkpage');
+                                                       $text = $this->msg('viewtalkpage')->text();
                                                        break;
                                                case NS_MAIN:
-                                                       $text = wfMsg( 'articlepage' );
+                                                       $text = $this->msg( 'articlepage' )->text();
                                                        break;
                                                case NS_USER:
-                                                       $text = wfMsg( 'userpage' );
+                                                       $text = $this->msg( 'userpage' )->text();
                                                        break;
                                                case NS_PROJECT:
-                                                       $text = wfMsg( 'projectpage' );
+                                                       $text = $this->msg( 'projectpage' )->text();
                                                        break;
                                                case NS_FILE:
-                                                       $text = wfMsg( 'imagepage' );
+                                                       $text = $this->msg( 'imagepage' )->text();
                                                        break;
                                                case NS_MEDIAWIKI:
-                                                       $text = wfMsg( 'mediawikipage' );
+                                                       $text = $this->msg( 'mediawikipage' )->text();
                                                        break;
                                                case NS_TEMPLATE:
-                                                       $text = wfMsg( 'templatepage' );
+                                                       $text = $this->msg( 'templatepage' )->text();
                                                        break;
                                                case NS_HELP:
-                                                       $text = wfMsg( 'viewhelppage' );
+                                                       $text = $this->msg( 'viewhelppage' )->text();
                                                        break;
                                                case NS_CATEGORY:
-                                                       $text = wfMsg( 'categorypage' );
+                                                       $text = $this->msg( 'categorypage' )->text();
                                                        break;
                                                default:
-                                                       $text = wfMsg( 'articlepage' );
+                                                       $text = $this->msg( 'articlepage' )->text();
                                        }
 
                                        $link = $title->getText();
@@ -198,7 +198,7 @@ class StandardTemplate extends LegacyTemplate {
                                } elseif( $title->getNamespace() != NS_SPECIAL ) {
                                        # we just throw in a "New page" text to tell the user that he's in edit mode,
                                        # and to avoid messing with the separator that is prepended to the next item
-                                       $s .= '<strong>' . wfMsg( 'newpage' ) . '</strong>';
+                                       $s .= '<strong>' . $this->msg( 'newpage' )->text() . '</strong>';
                                }
                        }
 
@@ -206,7 +206,7 @@ class StandardTemplate extends LegacyTemplate {
                        if( ( $title->isTalkPage() || $this->getSkin()->getOutput()->showNewSectionLink() ) && $action != 'edit' && !$wpPreview )
                                $s .= '<br />' . Linker::link(
                                        $title,
-                                       wfMsg( 'postcomment' ),
+                                       $this->msg( 'postcomment' )->text(),
                                        array(),
                                        array(
                                                'action' => 'edit',
@@ -268,7 +268,7 @@ class StandardTemplate extends LegacyTemplate {
                global $wgSiteSupportPage;
                if( $wgSiteSupportPage ) {
                        $s .= "\n<br /><a href=\"" . htmlspecialchars( $wgSiteSupportPage ) .
-                       '" class="internal">' . wfMsg( 'sitesupport' ) . '</a>';
+                       '" class="internal">' . $this->msg( 'sitesupport' )->text() . '</a>';
                }
 
                $s .= "\n<br /></div>\n";
index 9cfdae4..58a8194 100644 (file)
--- a/thumb.php
+++ b/thumb.php
@@ -129,13 +129,13 @@ function wfStreamThumb( array $params ) {
                // Format is <timestamp>!<name>
                $bits = explode( '!', $fileName, 2 );
                if ( count( $bits ) != 2 ) {
-                       wfThumbError( 404, wfMsg( 'badtitletext' ) );
+                       wfThumbError( 404, wfMessage( 'badtitletext' )->text() );
                        wfProfileOut( __METHOD__ );
                        return;
                }
                $title = Title::makeTitleSafe( NS_FILE, $bits[1] );
                if ( !$title ) {
-                       wfThumbError( 404, wfMsg( 'badtitletext' ) );
+                       wfThumbError( 404, wfMessage( 'badtitletext' )->text() );
                        wfProfileOut( __METHOD__ );
                        return;
                }
@@ -147,7 +147,7 @@ function wfStreamThumb( array $params ) {
                // Get the name without the timestamp so hash paths are correctly computed
                $title = Title::makeTitleSafe( NS_FILE, isset( $bits[1] ) ? $bits[1] : $fileName );
                if ( !$title ) {
-                       wfThumbError( 404, wfMsg( 'badtitletext' ) );
+                       wfThumbError( 404, wfMessage( 'badtitletext' )->text() );
                        wfProfileOut( __METHOD__ );
                        return;
                }
@@ -172,7 +172,7 @@ function wfStreamThumb( array $params ) {
 
        // Check the source file storage path
        if ( !$img ) {
-               wfThumbError( 404, wfMsg( 'badtitletext' ) );
+               wfThumbError( 404, wfMessage( 'badtitletext' )->text() );
                wfProfileOut( __METHOD__ );
                return;
        }
@@ -243,15 +243,16 @@ function wfStreamThumb( array $params ) {
 
        // Check for thumbnail generation errors...
        $errorMsg = false;
+       $msg = wfMessage( 'thumbnail_error' );
        if ( !$thumb ) {
-               $errorMsg = wfMsgHtml( 'thumbnail_error', 'File::transform() returned false' );
+               $errorMsg = $msg->rawParams( 'File::transform() returned false' )->escaped();
        } elseif ( $thumb->isError() ) {
                $errorMsg = $thumb->getHtmlMsg();
        } elseif ( !$thumb->hasFile() ) {
-               $errorMsg = wfMsgHtml( 'thumbnail_error', 'No path supplied in thumbnail object' );
+               $errorMsg = $msg->rawParams( 'No path supplied in thumbnail object' )->escaped();
        } elseif ( $thumb->fileIsSource() ) {
-               $errorMsg = wfMsgHtml( 'thumbnail_error',
-                       'Image was not scaled, is the requested width bigger than the source?' );
+               $errorMsg = $msg->
+                       rawParams( 'Image was not scaled, is the requested width bigger than the source?' )->escaped();
        }
 
        if ( $errorMsg !== false ) {