Or $this->msg in special pages.
Change-Id: I774a89d646615053c8424050e42ad95601f92543
* @return String
*/
protected function getDescription() {
- return wfMsgHtml( strtolower( $this->getName() ) );
+ return $this->msg( strtolower( $this->getName() ) )->escaped();
}
/**
$text = '';
}
} else {
- $text = wfMsgExt( $this->getContext()->getUser()->isLoggedIn() ? 'noarticletext' : 'noarticletextanon', 'parsemag' );
+ $message = $this->getContext()->getUser()->isLoggedIn() ? 'noarticletext' : 'noarticletextanon';
+ $text = wfMessage( $message )->text();
}
wfProfileOut( __METHOD__ );
$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>'
);
}
$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',
$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',
) + $extraParams
);
$nextdiff = $current
- ? wfMsgHtml( 'diff' )
+ ? wfMessage( 'diff' )->escaped()
: Linker::linkKnown(
$this->getTitle(),
- wfMsgHtml( 'diff' ),
+ wfMessage( 'diff' )->escaped(),
array(),
array(
'diff' => 'next',
$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
$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;
}
$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>'
$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>";
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(
<tr>
<td></td>
<td class='mw-input'>" .
- Xml::checkLabel( wfMsg( 'watchthis' ),
+ Xml::checkLabel( wfMessage( 'watchthis' )->text(),
'wpWatch', 'wpWatch', $checkWatch, array( 'tabindex' => '3' ) ) .
"</td>
</tr>";
<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>" .
$title = Title::makeTitle( NS_MEDIAWIKI, 'Deletereason-dropdown' );
$link = Linker::link(
$title,
- wfMsgHtml( 'delete-edit-reasonlist' ),
+ wfMessage( 'delete-edit-reasonlist' )->escaped(),
array(),
array( 'action' => 'edit' )
);
$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 );
}
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;
$keys = array( 'infiniteblock', 'expiringblock' );
foreach ( $keys as $key ) {
- $msg[$key] = wfMsgHtml( $key );
+ $msg[$key] = wfMessage( $key )->escaped();
}
}
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";
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 ) {
}
$html = implode( ' ', $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 );
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 );
$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
* @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();
}
/**
$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();
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();
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(
/**
* 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
if( $img ) {
$fileSize = htmlspecialchars( $wgLang->formatSize( $img->getSize() ) );
} else {
- $fileSize = wfMsgHtml( 'filemissing' );
+ $fileSize = wfMessage( 'filemissing' )->escaped();
}
$fileSize = "$fileSize<br />\n";
} else {
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();
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() );
* 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();
$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 );
}
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;
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();
}
}
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' ) )
} 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 );
}
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' );
}
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' );
}
$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' )
);
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 ),
'',
);
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(
// 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();
}
}
$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();
*/
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>";
$feedItems[] = $this->createFeedItem( $info );
}
- $msg = wfMsgForContent( 'watchlist' );
+ $msg = wfMessage( 'watchlist' )->inContentLanguage()->text();
$feedTitle = $wgSitename . ' - ' . $msg . ' [' . $wgLanguageCode . ']';
$feedUrl = SpecialPage::getTitleFor( 'Watchlist' )->getFullURL();
// 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();
return '';
}
- $s = htmlspecialchars( wfMsg( 'otherlanguages' ) . wfMsg( 'colon-separator' ) );
+ $s = htmlspecialchars( wfMessage( 'otherlanguages' )->text() . wfMessage( 'colon-separator' )->text() );
$langs = array();
foreach ( $languages as $l ) {
$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 );
}
* @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();
}
/**
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() );
}
}
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 <$1>', $text );
return html_entity_decode( strip_tags( $text ), ENT_QUOTES );
$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' ) .
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' ) .
$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' ) {
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();
}
$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' ) .
$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;
*/
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();
$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'] ) {
$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'] ) {
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 ) );
$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;
}
// 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() );
}
}
}
if( trim( $comment ) != '' ) {
- $reason .= wfMsgForContent( 'colon-separator' ) . $comment;
+ $reason .= wfMessage( 'colon-separator' )->inContentLanguage()->text() . $comment;
}
if ( $user === null ) {
!$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
$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;
*/
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 );
}
/**
$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' ) {
} 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 ) {
} 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;
}
$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 );
* @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 ) );
}
$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;
}
if ( in_array( $msgName, $wgForceUIMsgAsContentMsg ) ) {
$msg[$msgName] = "{{int:$msgName}}";
} else {
- $msg[$msgName] = wfMsgForContent( $msgName );
+ $msg[$msgName] = wfMessage( $msgName )->inContentLanguage()->text();
}
}
/** 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 {
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
$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']}`" );
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',
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' );
'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 ) {
'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',
);
}
* @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";
'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();
}
/**
$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() . ")";
// 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 ) {
$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__ );
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]";
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 ) );
*/
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.
$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";
}
for ( $i = 0; $i < $cnt; ++$i ) {
$tags[$i] = "<{$tags[$i]}>";
}
- $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";
}
# 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;
}
}
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 = '';
$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();
}
}
$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 ) {
$list = array();
foreach( (array)$authors as $item ) {
if( $item == '...' ) {
- $list[] = wfMsg( 'version-poweredby-others' );
+ $list[] = $this->msg( 'version-poweredby-others' )->text();
} else {
$list[] = $item;
}
'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 ) {
$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' );
}
$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
* @return string
*/
function getMessageFromDB( $msg ) {
- return wfMsgExt( $msg, array( 'parsemag', 'language' => $this ) );
+ return wfMessage( $msg )->inLanguage( $this )->text();
}
/**
*
* 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
$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;
}
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 );
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__ );
}
$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 ) );
$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" );
//
// 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 );
$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">';
array( 'known', 'noclasses' )
),
$this->getSkin()->aboutLink(),
- $this->searchForm( wfMsg( 'qbfind' ) )
+ $this->searchForm( $this->msg( 'qbfind' )->text() )
) );
$s .= "\n<br />" . $this->pageStats();
$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' )
);
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
);
$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'] ) {
if ( $this->data['loggedin'] ) {
$tl = Linker::link(
$user->getTalkPage(),
- wfMsg( 'mytalk' ),
+ $this->msg( 'mytalk' )->text(),
array(),
array(),
array( 'known', 'noclasses' )
$s .= Linker::link(
$user->getUserPage(),
- wfMsg( 'mypage' ),
+ $this->msg( 'mypage' )->text(),
array(),
array(),
array( 'known', 'noclasses' )
. $sep .
Linker::link(
SpecialPage::getSafeTitleFor( 'Contributions', $user->getName() ),
- wfMsg( 'mycontris' ),
+ $this->msg( 'mycontris' )->text(),
array(),
array(),
array( 'known', 'noclasses' )
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' )
* @return string
*/
function menuHead( $key ) {
- $s = "\n<h6>" . wfMsg( $key ) . "</h6>";
+ $s = "\n<h6>" . $this->msg( $key )->text() . "</h6>";
return $s;
}
$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>';
} 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 .= ' *';
}
/* 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 */
$s.= Linker::specialLink( 'Watchlist' ) ;
$s .= $sep . Linker::linkKnown(
SpecialPage::getTitleFor( 'Contributions' ),
- wfMsg( 'mycontris' ),
+ $this->msg( 'mycontris' )->text(),
array(),
array( 'target' => $this->data['username'] )
);
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();
} 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>';
}
}
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',
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";
// 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;
}
// 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;
}
// Check the source file storage path
if ( !$img ) {
- wfThumbError( 404, wfMsg( 'badtitletext' ) );
+ wfThumbError( 404, wfMessage( 'badtitletext' )->text() );
wfProfileOut( __METHOD__ );
return;
}
// 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 ) {