Doing this in steps of roughly 100 changes per commit, so that it remains reviewable.
Change-Id: I4950fdf8be669b52446290768ece0b8df8399d5d
if ( $actionComment == '' ) {
$actionComment = $comment;
} else {
- $actionComment .= wfMsgForContent( 'colon-separator' ) . $comment;
+ $actionComment .= wfMessage( 'colon-separator' )->inContentLanguage()->text() . $comment;
}
}
$entry = $this->entry;
$parameters = $entry->getParameters();
// @see LogPage::actionText()
- $msgOpts = array( 'parsemag', 'escape', 'replaceafter', 'content' );
// Text of title the action is aimed at.
$target = $entry->getTarget()->getPrefixedText() ;
$text = null;
switch( $entry->getSubtype() ) {
case 'move':
$movesource = $parameters['4::target'];
- $text = wfMsgExt( '1movedto2', $msgOpts, $target, $movesource );
+ $text = wfMessage( '1movedto2' )
+ ->rawParams( $target, $movesource )->inContentLanguage()->escaped();
break;
case 'move_redir':
$movesource = $parameters['4::target'];
- $text = wfMsgExt( '1movedto2_redir', $msgOpts, $target, $movesource );
+ $text = wfMessage( '1movedto2_redir' )
+ ->rawParams( $target, $movesource )->inContentLanguage()->escaped();
break;
case 'move-noredirect':
break;
case 'delete':
switch( $entry->getSubtype() ) {
case 'delete':
- $text = wfMsgExt( 'deletedarticle', $msgOpts, $target );
+ $text = wfMessage( 'deletedarticle' )
+ ->rawParams( $target )->inContentLanguage()->escaped();
break;
case 'restore':
- $text = wfMsgExt( 'undeletedarticle', $msgOpts, $target );
+ $text = wfMessage( 'undeletedarticle' )
+ ->rawParams( $target )->inContentLanguage()->escaped();
break;
//case 'revision': // Revision deletion
//case 'event': // Log deletion
// Create a diff link to the patrolled revision
if ( $entry->getSubtype() === 'patrol' ) {
$diffLink = htmlspecialchars(
- wfMsgForContent( 'patrol-log-diff', $parameters['4::curid'] ) );
- $text = wfMsgForContent( 'patrol-log-line', $diffLink, "[[$target]]", "" );
+ wfMessage( 'patrol-log-diff', $parameters['4::curid'] )
+ ->inContentLanguage()->text() );
+ $text = wfMessage( 'patrol-log-line', $diffLink, "[[$target]]", "" )
+ ->inContentLanguage()->text();
} else {
// broken??
}
case 'protect':
switch( $entry->getSubtype() ) {
case 'protect':
- $text = wfMsgExt( 'protectedarticle', $msgOpts, $target . ' ' . $parameters[0] );
- break;
+ $text = wfMessage( 'protectedarticle' )
+ ->rawParams( $target . ' ' . $parameters[0] )->inContentLanguage()->escaped();
+ break;
case 'unprotect':
- $text = wfMsgExt( 'unprotectedarticle', $msgOpts, $target );
- break;
+ $text = wfMessage( 'unprotectedarticle' )
+ ->rawParams( $target )->inContentLanguage()->escaped();
+ break;
case 'modify':
- $text = wfMsgExt( 'modifiedarticleprotection', $msgOpts, $target . ' ' . $parameters[0] );
- break;
+ $text = wfMessage( 'modifiedarticleprotection' )
+ ->rawParams( $target . ' ' . $parameters[0] )->inContentLanguage()->escaped();
+ break;
}
break;
switch( $entry->getSubtype() ) {
case 'newusers':
case 'create':
- $text = wfMsgExt( 'newuserlog-create-entry', $msgOpts /* no params */ );
+ $text = wfMessage( 'newuserlog-create-entry' )
+ ->inContentLanguage()->escaped();
break;
case 'create2':
- $text = wfMsgExt( 'newuserlog-create2-entry', $msgOpts, $target );
+ $text = wfMessage( 'newuserlog-create2-entry' )
+ ->rawParams( $target )->inContentLanguage()->escaped();
break;
case 'autocreate':
- $text = wfMsgExt( 'newuserlog-autocreate-entry', $msgOpts /* no params */ );
+ $text = wfMessage( 'newuserlog-autocreate-entry' )
+ ->inContentLanguage()->escaped();
break;
}
break;
case 'upload':
switch( $entry->getSubtype() ) {
case 'upload':
- $text = wfMsgExt( 'uploadedimage', $msgOpts, $target );
+ $text = wfMessage( 'uploadedimage' )
+ ->rawParams( $target )->inContentLanguage()->escaped();
break;
case 'overwrite':
- $text = wfMsgExt( 'overwroteimage', $msgOpts, $target );
+ $text = wfMessage( 'overwroteimage' )
+ ->rawParams( $target )->inContentLanguage()->escaped();
break;
}
break;
if ( $rcComment == '' ) {
$rcComment = $this->comment;
} else {
- $rcComment .= wfMsgForContent( 'colon-separator' ) . $this->comment;
+ $rcComment .= wfMessage( 'colon-separator' )->inContentLanguage()->text() .
+ $this->comment;
}
}
if ( $rcComment == '' ) {
$rcComment = $this->comment;
} else {
- $rcComment .= wfMsgForContent( 'colon-separator' ) . $this->comment;
+ $rcComment .= wfMessage( 'colon-separator' )->inContentLanguage()->text() .
+ $this->comment;
}
}
global $wgLogNames;
if( isset( $wgLogNames[$type] ) ) {
- return str_replace( '_', ' ', wfMsg( $wgLogNames[$type] ) );
+ return str_replace( '_', ' ', wfMessage( $wgLogNames[$type] )->text() );
} else {
// Bogus log types? Perhaps an extension was removed.
return $type;
*/
public static function logHeader( $type ) {
global $wgLogHeaders;
- return wfMsgExt( $wgLogHeaders[$type], array( 'parseinline' ) );
+ return wfMessage( $wgLogHeaders[$type] )->parse();
}
/**
if( isset( $wgLogActions[$key] ) ) {
if( is_null( $title ) ) {
- $rv = wfMsgExt( $wgLogActions[$key], array( 'parsemag', 'escape', 'language' => $langObj ) );
+ $rv = wfMessage( $wgLogActions[$key] )->inLanguage( $langObj )->escaped();
} else {
$titleLink = self::getTitleLink( $type, $langObjOrNull, $title, $params );
if( preg_match( '/^rights\/(rights|autopromote)/', $key ) ) {
- $rightsnone = wfMsgExt( 'rightsnone', array( 'parsemag', 'language' => $langObj ) );
+ $rightsnone = wfMessage( 'rightsnone' )->inLanguage( $langObj )->text();
if( $skin ) {
$username = $title->getText();
}
if( count( $params ) == 0 ) {
- $rv = wfMsgExt( $wgLogActions[$key], array( 'parsemag', 'escape', 'replaceafter', 'language' => $langObj ), $titleLink );
+ $rv = wfMessage( $wgLogActions[$key] )->rawParams( $titleLink )->inLanguage( $langObj )->escaped();
} else {
$details = '';
array_unshift( $params, $titleLink );
// Cascading flag...
if( $params[2] ) {
- $details .= ' [' . wfMsgExt( 'protect-summary-cascade', array( 'parsemag', 'language' => $langObj ) ) . ']';
+ $details .= ' [' . wfMessage( 'protect-summary-cascade' )->inLanguage( $langObj )->text() . ']';
}
}
- $rv = wfMsgExt( $wgLogActions[$key], array( 'parsemag', 'escape', 'replaceafter', 'language' => $langObj ), $params ) . $details;
+ $rv = wfMessage( $wgLogActions[$key] )->rawParams( $params )->inLanguage( $langObj )->escaped() . $details;
}
}
} else {
* @param $action String: one of '', 'block', 'protect', 'rights', 'delete', 'upload', 'move', 'move_redir'
* @param $target Title object
* @param $comment String: description associated
- * @param $params Array: parameters passed later to wfMsg.* functions
+ * @param $params Array: parameters passed later to wfMessage function
* @param $doer User object: the user doing the action
*
* @return int log_id of the inserted log entry
if ( !isset( $typemap[$params['mimeType']] ) ) {
$err = 'Image type not supported';
wfDebug( "$err\n" );
- $errMsg = wfMsg( 'thumbnail_image-type' );
+ $errMsg = wfMessage( 'thumbnail_image-type' )->text();
return $this->getMediaTransformError( $params, $errMsg );
}
list( $loader, $colorStyle, $saveType ) = $typemap[$params['mimeType']];
if ( !function_exists( $loader ) ) {
$err = "Incomplete GD library configuration: missing function $loader";
wfDebug( "$err\n" );
- $errMsg = wfMsg( 'thumbnail_gd-library', $loader );
+ $errMsg = wfMessage( 'thumbnail_gd-library', $loader )->text();
return $this->getMediaTransformError( $params, $errMsg );
}
if ( !file_exists( $params['srcPath'] ) ) {
$err = "File seems to be missing: {$params['srcPath']}";
wfDebug( "$err\n" );
- $errMsg = wfMsg( 'thumbnail_image-missing', $params['srcPath'] );
+ $errMsg = wfMessage( 'thumbnail_image-missing', $params['srcPath'] )->text();
return $this->getMediaTransformError( $params, $errMsg );
}
$width = isset( $params['width'] ) ? $params['width'] : 0;
$height = isset( $params['height'] ) ? $params['height'] : 0;
return new MediaTransformError( 'thumbnail_error', $width, $height,
- wfMsg( 'djvu_no_xml' ) );
+ wfMessage( 'djvu_no_xml' )->text() );
}
if ( !$this->normaliseParams( $image, $params ) ) {
$height = $params['height'];
$page = $params['page'];
if ( $page > $this->pageCount( $image ) ) {
- return new MediaTransformError( 'thumbnail_error', $width, $height, wfMsg( 'djvu_page_error' ) );
+ return new MediaTransformError(
+ 'thumbnail_error',
+ $width,
+ $height,
+ wfMessage( 'djvu_page_error' )->text()
+ );
}
if ( $flags & self::TRANSFORM_LATER ) {
}
if ( !wfMkdirParents( dirname( $dstPath ), null, __METHOD__ ) ) {
- return new MediaTransformError( 'thumbnail_error', $width, $height, wfMsg( 'thumbnail_dest_directory' ) );
+ return new MediaTransformError(
+ 'thumbnail_error',
+ $width,
+ $height,
+ wfMessage( 'thumbnail_dest_directory' )->text()
+ );
}
$srcPath = $image->getLocalRefPath();
case 'dc-date':
case 'DateTimeMetadata':
if ( $val == '0000:00:00 00:00:00' || $val == ' : : : : ' ) {
- $val = wfMsg( 'exif-unknowndate' );
+ $val = wfMessage( 'exif-unknowndate' )->text();
} elseif ( preg_match( '/^(?:\d{4}):(?:\d\d):(?:\d\d) (?:\d\d):(?:\d\d):(?:\d\d)$/D', $val ) ) {
// Full date.
$time = wfTimestamp( TS_MW, $val );
case 'Software':
if ( is_array( $val ) ) {
//if its a software, version array.
- $val = wfMsg( 'exif-software-version-value', $val[0], $val[1] );
+ $val = wfMessage( 'exif-software-version-value', $val[0], $val[1] )->text();
} else {
$val = self::msg( $tag, '', $val );
}
case 'ExposureTime':
// Show the pretty fraction as well as decimal version
- $val = wfMsg( 'exif-exposuretime-format',
- self::formatFraction( $val ), self::formatNum( $val ) );
+ $val = wfMessage( 'exif-exposuretime-format',
+ self::formatFraction( $val ), self::formatNum( $val ) )->text();
break;
case 'ISOSpeedRatings':
// If its = 65535 that means its at the
}
break;
case 'FNumber':
- $val = wfMsg( 'exif-fnumber-format',
- self::formatNum( $val ) );
+ $val = wfMessage( 'exif-fnumber-format',
+ self::formatNum( $val ) )->text();
break;
case 'FocalLength': case 'FocalLengthIn35mmFilm':
- $val = wfMsg( 'exif-focallength-format',
- self::formatNum( $val ) );
+ $val = wfMessage( 'exif-focallength-format',
+ self::formatNum( $val ) )->text();
break;
case 'MaxApertureValue':
if ( is_numeric( $val ) ) {
$fNumber = pow( 2, $val / 2 );
if ( $fNumber !== false ) {
- $val = wfMsg( 'exif-maxaperturevalue-value',
+ $val = wfMessage( 'exif-maxaperturevalue-value',
self::formatNum( $val ),
self::formatNum( $fNumber, 2 )
- );
+ )->text();
}
}
break;
case 'PixelYDimension':
case 'ImageWidth':
case 'ImageLength':
- $val = self::formatNum( $val ) . ' ' . wfMsg( 'unit-pixel' );
+ $val = self::formatNum( $val ) . ' ' . wfMessage( 'unit-pixel' )->text();
break;
// Do not transform fields with pure text.
if ( $lang === false ) {
if ( $noHtml ) {
- return wfMsg( 'metadata-langitem-default',
- $wrappedValue ) . "\n\n";
+ return wfMessage( 'metadata-langitem-default',
+ $wrappedValue )->text() . "\n\n";
} /* else */
return '<li class="mw-metadata-lang-default">'
- . wfMsg( 'metadata-langitem-default',
- $wrappedValue )
+ . wfMessage( 'metadata-langitem-default',
+ $wrappedValue )->text()
. "</li>\n";
}
// else we have a language specified
if ( $noHtml ) {
- return '*' . wfMsg( 'metadata-langitem',
- $wrappedValue, $langName, $lang );
+ return '*' . wfMessage( 'metadata-langitem',
+ $wrappedValue, $langName, $lang )->text();
} /* else: */
$item = '<li class="mw-metadata-lang-code-'
$item .= ' mw-metadata-lang-default';
}
$item .= '" lang="' . $lang . '">';
- $item .= wfMsg( 'metadata-langitem',
- $wrappedValue, $langName, $lang );
+ $item .= wfMessage( 'metadata-langitem',
+ $wrappedValue, $langName, $lang )->text();
$item .= "</li>\n";
return $item;
}
* @param $val String: the value of the tag
* @param $arg String: an argument to pass ($1)
* @param $arg2 String: a 2nd argument to pass ($2)
- * @return string A wfMsg of "exif-$tag-$val" in lower case
+ * @return string A wfMessage of "exif-$tag-$val" in lower case
*/
static function msg( $tag, $val, $arg = null, $arg2 = null ) {
global $wgContLang;
if ($val === '')
$val = 'value';
- return wfMsg( $wgContLang->lc( "exif-$tag-$val" ), $arg, $arg2 );
+ return wfMessage( $wgContLang->lc( "exif-$tag-$val" ), $arg, $arg2 )->text();
}
/**
$min = self::formatNum( $min );
$sec = self::formatNum( $sec );
- return wfMsg( 'exif-coordinate-format', $deg, $min, $sec, $ref, $coord );
+ return wfMessage( 'exif-coordinate-format', $deg, $min, $sec, $ref, $coord )->text();
}
/**
. htmlspecialchars( $vals['CiUrlWork'] )
. '</span>';
}
- return wfMsg( 'exif-contact-value', $email, $url,
+ return wfMessage( 'exif-contact-value', $email, $url,
$street, $city, $region, $postal, $country,
- $tel );
+ $tel )->text();
}
}
}
*/
function visibleMetadataFields() {
$fields = array();
- $lines = explode( "\n", wfMsgForContent( 'metadata-fields' ) );
+ $lines = explode( "\n", wfMessage( 'metadata-fields' )->inContentLanguage()->text() );
foreach( $lines as $line ) {
$matches = array();
if( preg_match( '/^\\*\s*(.*?)\s*$/', $line, $matches ) ) {
parent::__construct( 'thumbnail_error',
max( isset( $params['width'] ) ? $params['width'] : 0, 120 ),
max( isset( $params['height'] ) ? $params['height'] : 0, 120 ),
- wfMsg( 'thumbnail_invalid_params' ) );
+ wfMessage( 'thumbnail_invalid_params' )->text() );
}
}
if ( !wfMkdirParents( dirname( $dstPath ), null, __METHOD__ ) ) {
return new MediaTransformError( 'thumbnail_error', $clientWidth, $clientHeight,
- wfMsg( 'thumbnail_dest_directory' ) );
+ wfMessage( 'thumbnail_dest_directory' )->text() );
}
$srcPath = $image->getLocalRefPath();
*/
function getLongDesc( $file ) {
global $wgLang;
- return wfMsgExt( 'svg-long-desc', 'parseinline',
- $wgLang->formatNum( $file->getWidth() ),
- $wgLang->formatNum( $file->getHeight() ),
- $wgLang->formatSize( $file->getSize() ) );
+ return wfMessage( 'svg-long-desc' )->numParams( $file->getWidth(), $file->getHeight() )
+ ->params( $wgLang->formatSize( $file->getSize() ) )->parse();
}
function getMetadata( $file, $filename ) {
$title = SpecialPage::getTitleFor( $page, $subpage );
return $title->getPrefixedText();
} else {
- return wfMsgForContent( 'nosuchspecialpage' );
+ return wfMessage( 'nosuchspecialpage' )->inContentLanguage()->text();
}
}
return '';
} else {
return( '<span class="error">' .
- wfMsgForContent( 'duplicate-defaultsort',
- htmlspecialchars( $old ),
- htmlspecialchars( $text ) ) .
+ wfMessage( 'duplicate-defaultsort', $old, $text )->inContentLanguage()->escaped() .
'</span>' );
}
}
$stripList = $parser->getStripList();
if ( !in_array( $tagName, $stripList ) ) {
return '<span class="error">' .
- wfMsgForContent( 'unknown_extension_tag', $tagName ) .
+ wfMessage( 'unknown_extension_tag', $tagName )->inContentLanguage()->text() .
'</span>';
}
throw new MWException( __METHOD__.': unrecognised match type "' .
substr( $m[0], 0, 20 ) . '"' );
}
- $url = wfMsgForContent( $urlmsg, $id );
+ $url = wfMessage( $urlmsg, $id )->inContentLanguage()->text();
return Linker::makeExternalLink( $url, "{$keyword} {$id}", true, $CssClass );
} elseif ( isset( $m[5] ) && $m[5] !== '' ) {
# ISBN
}
if ( !$text && $this->mOptions->getEnableImageWhitelist()
&& preg_match( self::EXT_IMAGE_REGEX, $url ) ) {
- $whitelist = explode( "\n", wfMsgForContent( 'external_image_whitelist' ) );
+ $whitelist = explode( "\n", wfMessage( 'external_image_whitelist' )->inContentLanguage()->text() );
foreach ( $whitelist as $entry ) {
# Sanitize the regex fragment, make it case-insensitive, ignore blank entries/comments
if ( strpos( $entry, '#' ) === 0 || $entry === '' ) {
if ( $useLinkPrefixExtension ) {
# Match the end of a line for a word that's not followed by whitespace,
# e.g. in the case of 'The Arab al[[Razi]]', 'al' will be matched
- $e2 = wfMsgForContent( 'linkprefix' );
+ $e2 = wfMessage( 'linkprefix' )->inContentLanguage()->text();
}
if ( is_null( $this->mTitle ) ) {
*/
function limitationWarn( $limitationType, $current = null, $max = null) {
# does no harm if $current and $max are present but are unnecessary for the message
- $warning = wfMsgExt( "$limitationType-warning", array( 'parsemag', 'escape' ), $current, $max );
+ $warning = wfMessage( "$limitationType-warning" )->numParams( $current, $max )
+ ->inContentLanguage()->escaped();
$this->mOutput->addWarning( $warning );
$this->addTrackingCategory( "$limitationType-category" );
}
if ( $frame->depth >= $limit ) {
$found = true;
$text = '<span class="error">'
- . wfMsgForContent( 'parser-template-recursion-depth-warning', $limit )
+ . wfMessage( 'parser-template-recursion-depth-warning' )
+ ->numParams( $limit )->inContentLanguage()->text()
. '</span>';
}
}
# This has to be done after redirect resolution to avoid infinite loops via redirects
if ( !$frame->loopCheck( $title ) ) {
$found = true;
- $text = '<span class="error">' . wfMsgForContent( 'parser-template-loop-warning', $titleText ) . '</span>';
+ $text = '<span class="error">'
+ . wfMessage( 'parser-template-loop-warning', $titleText )->inContentLanguage()->text()
+ . '</span>';
wfDebug( __METHOD__.": template loop broken at '$titleText'\n" );
}
wfProfileOut( __METHOD__ . '-loadtpl' );
global $wgEnableScaryTranscluding;
if ( !$wgEnableScaryTranscluding ) {
- return wfMsgForContent('scarytranscludedisabled');
+ return wfMessage('scarytranscludedisabled')->inContentLanguage()->text();
}
$url = $title->getFullUrl( "action=$action" );
if ( strlen( $url ) > 255 ) {
- return wfMsgForContent( 'scarytranscludetoolong' );
+ return wfMessage( 'scarytranscludetoolong' )->inContentLanguage()->text();
}
return $this->fetchScaryTemplateMaybeFromCache( $url );
}
$text = Http::get( $url );
if ( !$text ) {
- return wfMsgForContent( 'scarytranscludefailed', $url );
+ return wfMessage( 'scarytranscludefailed', $url )->inContentLanguage()->text();
}
$dbw = wfGetDB( DB_MASTER );
$text = $this->replaceVariables( $text );
# This works almost by chance, as the replaceVariables are done before the getUserSig(),
- # which may corrupt this parser instance via its wfMsgExt( parsemag ) call-
+ # which may corrupt this parser instance via its wfMessage()->text() call-
# Signatures
$sigText = $this->getUserSig( $user );
$marker = $m[1];
if ( isset( $this->data[$this->tempType][$marker] ) ) {
if ( isset( $this->circularRefGuard[$marker] ) ) {
- return '<span class="error">' . wfMsgForContent( 'parser-unstrip-loop-warning' ) . '</span>';
+ return '<span class="error">'
+ . wfMessage( 'parser-unstrip-loop-warning' )->inContentLanguage()->text()
+ . '</span>';
}
if ( $this->recursionLevel >= self::UNSTRIP_RECURSION_LIMIT ) {
return '<span class="error">' .
- wfMsgForContent( 'parser-unstrip-recursion-limit', self::UNSTRIP_RECURSION_LIMIT ) .
+ wfMessage( 'parser-unstrip-recursion-limit' )
+ ->numParams( self::UNSTRIP_RECURSION_LIMIT )->inContentLanguage()->text() .
'</span>';
}
$this->circularRefGuard[$marker] = true;
<td></td>
<td class="mw-input">
<?php
- global $wgCookieExpiration, $wgLang;
+ global $wgCookieExpiration;
+ $expirationDays = ceil( $wgCookieExpiration / ( 3600 * 24 ) );
echo Xml::checkLabel(
- wfMsgExt( 'remembermypassword', 'parsemag', $wgLang->formatNum( ceil( $wgCookieExpiration / ( 3600 * 24 ) ) ) ),
+ wfMessage( 'remembermypassword' )->numParams( $expirationDays )->text(),
'wpRemember',
'wpRemember',
$this->data['remember'],
<td></td>
<td class="mw-input">
<?php
- global $wgCookieExpiration, $wgLang;
+ global $wgCookieExpiration;
+ $expirationDays = ceil( $wgCookieExpiration / ( 3600 * 24 ) );
echo Xml::checkLabel(
- wfMsgExt( 'remembermypassword', 'parsemag', $wgLang->formatNum( ceil( $wgCookieExpiration / ( 3600 * 24 ) ) ) ),
+ wfMessage( 'remembermypassword' )->numParams( $expirationDays )->text(),
'wpRemember',
'wpRemember',
$this->data['remember'],
<td class="mw-input">
<?php
echo Xml::checkLabel(
- wfMsg( 'securelogin-stick-https' ),
+ wfMessage( 'securelogin-stick-https' )->text(),
'wpStickHTTPS',
'wpStickHTTPS',
$this->data['stickHTTPS'],
<td></td>
<td class="mw-submit">
<?php
- echo Html::input( 'wpLoginAttempt', wfMsg( 'login' ), 'submit', array(
+ echo Html::input( 'wpLoginAttempt', wfMessage( 'login' )->text(), 'submit', array(
'id' => 'wpLoginAttempt',
'tabindex' => '9'
) );
);
} elseif( $this->data['resetlink'] === null ) {
echo ' ';
- echo Html::input( 'wpMailmypassword', wfMsg( 'mailmypassword' ), 'submit', array(
- 'id' => 'wpMailmypassword',
- 'tabindex' => '10'
- ) );
+ echo Html::input(
+ 'wpMailmypassword',
+ wfMessage( 'mailmypassword' )->text(),
+ 'submit', array(
+ 'id' => 'wpMailmypassword',
+ 'tabindex' => '10'
+ )
+ );
}
} ?>
if ( $wgAntivirusRequired ) {
wfProfileOut( __METHOD__ );
- return wfMsg( 'virus-scanfailed', array( $exitCode ) );
+ return wfMessage( 'virus-scanfailed', array( $exitCode ) )->text();
} else {
wfProfileOut( __METHOD__ );
return null;
*/
function commaList( array $list ) {
return implode(
- wfMsgExt(
- 'comma-separator',
- array( 'parsemag', 'escapenoentities', 'language' => $this )
- ),
+ wfMessage( 'comma-separator' )->inLanguage( $this )->escaped(),
$list
);
}
*/
function semicolonList( array $list ) {
return implode(
- wfMsgExt(
- 'semicolon-separator',
- array( 'parsemag', 'escapenoentities', 'language' => $this )
- ),
+ wfMessage( 'semicolon-separator' )->inLanguage( $this )->escaped(),
$list
);
}
*/
function pipeList( array $list ) {
return implode(
- wfMsgExt(
- 'pipe-separator',
- array( 'escapenoentities', 'language' => $this )
- ),
+ wfMessage( 'pipe-separator' )->inLanguage( $this )->escaped(),
$list
);
}
function truncate( $string, $length, $ellipsis = '...', $adjustLength = true ) {
# Use the localized ellipsis character
if ( $ellipsis == '...' ) {
- $ellipsis = wfMsgExt( 'ellipsis', array( 'escapenoentities', 'language' => $this ) );
+ $ellipsis = wfMessage( 'ellipsis' )->inLanguage( $this )->escaped();
}
# Check if there is no need to truncate
if ( $length == 0 ) {
function truncateHtml( $text, $length, $ellipsis = '...' ) {
# Use the localized ellipsis character
if ( $ellipsis == '...' ) {
- $ellipsis = wfMsgExt( 'ellipsis', array( 'escapenoentities', 'language' => $this ) );
+ $ellipsis = wfMessage( 'ellipsis' )->inLanguage( $this )->escaped();
}
# Check if there is clearly no need to truncate
if ( $length <= 0 ) {
$dirmark = ( $oppositedm ? $this->getDirMark( true ) : '' ) .
$this->getDirMark();
$details = $details ? $dirmark . $this->getMessageFromDB( 'word-separator' ) .
- wfMsgExt( 'parentheses', array( 'escape', 'replaceafter', 'language' => $this ), $details ) : '';
+ wfMessage( 'parentheses' )->rawParams( $details )->inLanguage( $this )->escaped() : '';
return $page . $details;
}
wfDebug( "TextDumpPass::readDump encountered XML parsing error\n" );
$byte = xml_get_current_byte_index( $parser );
- $msg = wfMsgHtml( 'xml-error-string',
+ $msg = wfMessage( 'xml-error-string',
'XML import parse failure',
xml_get_current_line_number( $parser ),
xml_get_current_column_number( $parser ),
$byte . ( is_null( $chunk ) ? null : ( '; "' . substr( $chunk, $byte -$offset, 16 ) . '"' ) ),
- xml_error_string( xml_get_error_code( $parser ) ) );
+ xml_error_string( xml_get_error_code( $parser ) ) )->escaped();
xml_parser_free( $parser );
},
/**
- * Gets a message string, similar to wfMsg()
+ * Gets a message string, similar to wfMessage()
*
* @param key string Key of message to get
* @param parameters mixed First argument in a list of variadic arguments,
*/
function testTrackingCategory() {
$title = Title::newFromText( __FUNCTION__ );
- $catName = wfMsgForContent( 'broken-file-category' );
+ $catName = wfMessage( 'broken-file-category' )->inContentLanguage()->text();
$cat = Title::makeTitleSafe( NS_CATEGORY, $catName );
$expected = array( $cat->getDBkey() );
$parserOutput = $this->parser->parse( "[[file:nonexistent]]" , $title, $this->options );