From 9eb3a01061e851629d7cb844ca88a4a58e0e83c8 Mon Sep 17 00:00:00 2001 From: Alexandre Emsenhuber Date: Sun, 26 Feb 2012 13:34:58 +0000 Subject: [PATCH] Use local context to get messages --- includes/specials/SpecialImport.php | 45 ++++++++++++++--------------- 1 file changed, 22 insertions(+), 23 deletions(-) diff --git a/includes/specials/SpecialImport.php b/includes/specials/SpecialImport.php index a2380fbe7a..a23f1d732e 100644 --- a/includes/specials/SpecialImport.php +++ b/includes/specials/SpecialImport.php @@ -179,7 +179,7 @@ class SpecialImport extends SpecialPage { if( $user->isAllowed( 'importupload' ) ) { $out->addWikiMsg( "importtext" ); $out->addHTML( - Xml::fieldset( wfMsg( 'import-upload' ) ). + Xml::fieldset( $this->msg( 'import-upload' )->text() ). Xml::openElement( 'form', array( 'enctype' => 'multipart/form-data', 'method' => 'post', 'action' => $action, 'id' => 'mw-import-upload-form' ) ) . Html::hidden( 'action', 'submit' ) . @@ -188,7 +188,7 @@ class SpecialImport extends SpecialPage { " " . - Xml::label( wfMsg( 'import-upload-filename' ), 'xmlimport' ) . + Xml::label( $this->msg( 'import-upload-filename' )->text(), 'xmlimport' ) . " " . Xml::input( 'xmlimport', 50, '', array( 'type' => 'file' ) ) . ' ' . @@ -196,7 +196,7 @@ class SpecialImport extends SpecialPage { " . - Xml::label( wfMsg( 'import-comment' ), 'mw-import-comment' ) . + Xml::label( $this->msg( 'import-comment' )->text(), 'mw-import-comment' ) . " " . Xml::input( 'log-comment', 50, '', @@ -206,7 +206,7 @@ class SpecialImport extends SpecialPage { " . - Xml::submitButton( wfMsg( 'uploadbtn' ) ) . + Xml::submitButton( $this->msg( 'uploadbtn' )->text() ) . " " . Xml::closeElement( 'table' ). @@ -226,7 +226,7 @@ class SpecialImport extends SpecialPage { if( $wgExportMaxLinkDepth > 0 ) { $importDepth = " " . - wfMsgExt( 'export-pagelinks', 'parseinline' ) . + $this->msg( 'export-pagelinks' )->parse() . " " . Xml::input( 'pagelink-depth', 3, 0 ) . @@ -235,16 +235,16 @@ class SpecialImport extends SpecialPage { } $out->addHTML( - Xml::fieldset( wfMsg( 'importinterwiki' ) ) . + Xml::fieldset( $this->msg( 'importinterwiki' )->text() ) . Xml::openElement( 'form', array( 'method' => 'post', 'action' => $action, 'id' => 'mw-import-interwiki-form' ) ) . - wfMsgExt( 'import-interwiki-text', array( 'parse' ) ) . + $this->msg( 'import-interwiki-text' )->parseAsBlock() . Html::hidden( 'action', 'submit' ) . Html::hidden( 'source', 'interwiki' ) . Html::hidden( 'editToken', $user->getEditToken() ) . Xml::openElement( 'table', array( 'id' => 'mw-import-table' ) ) . " " . - Xml::label( wfMsg( 'import-interwiki-source' ), 'interwiki' ) . + Xml::label( $this->msg( 'import-interwiki-source' )->text(), 'interwiki' ) . " " . Xml::openElement( 'select', array( 'name' => 'interwiki' ) ) @@ -263,20 +263,20 @@ class SpecialImport extends SpecialPage { " . - Xml::checkLabel( wfMsg( 'import-interwiki-history' ), 'interwikiHistory', 'interwikiHistory', $this->history ) . + Xml::checkLabel( $this->msg( 'import-interwiki-history' )->text(), 'interwikiHistory', 'interwikiHistory', $this->history ) . " " . - Xml::checkLabel( wfMsg( 'import-interwiki-templates' ), 'interwikiTemplates', 'interwikiTemplates', $this->includeTemplates ) . + Xml::checkLabel( $this->msg( 'import-interwiki-templates' )->text(), 'interwikiTemplates', 'interwikiTemplates', $this->includeTemplates ) . " $importDepth " . - Xml::label( wfMsg( 'import-interwiki-namespace' ), 'namespace' ) . + Xml::label( $this->msg( 'import-interwiki-namespace' )->text(), 'namespace' ) . " " . Xml::namespaceSelector( $this->namespace, '' ) . @@ -284,7 +284,7 @@ class SpecialImport extends SpecialPage { " . - Xml::label( wfMsg( 'import-comment' ), 'mw-interwiki-comment' ) . + Xml::label( $this->msg( 'import-comment' )->text(), 'mw-interwiki-comment' ) . " " . Xml::input( 'log-comment', 50, '', @@ -295,7 +295,7 @@ class SpecialImport extends SpecialPage { " . - Xml::submitButton( wfMsg( 'import-interwiki-submit' ), Linker::tooltipAndAccesskeyAttribs( 'import' ) ) . + Xml::submitButton( $this->msg( 'import-interwiki-submit' )->text(), Linker::tooltipAndAccesskeyAttribs( 'import' ) ) . " " . Xml::closeElement( 'table' ). @@ -369,25 +369,25 @@ class ImportReporter extends ContextSource { if( $successCount > 0 ) { $this->getOutput()->addHTML( "
  • " . Linker::linkKnown( $title ) . " " . - wfMsgExt( 'import-revision-count', array( 'parsemag', 'escape' ), $localCount ) . + $this->msg( 'import-revision-count', $localCount ) . "
  • \n" ); $log = new LogPage( 'import' ); if( $this->mIsUpload ) { - $detail = wfMsgExt( 'import-logentry-upload-detail', array( 'content', 'parsemag' ), - $contentCount ); + $detail = $this->msg( 'import-logentry-upload-detail', + $contentCount )->inContentLanguage()->text(); if ( $this->reason ) { - $detail .= wfMsgForContent( 'colon-separator' ) . $this->reason; + $detail .= $this->msg( 'colon-separator' )->inContentLanguage()->text() . $this->reason; } $log->addEntry( 'upload', $title, $detail ); } else { $interwiki = '[[:' . $this->mInterwiki . ':' . $origTitle->getPrefixedText() . ']]'; - $detail = wfMsgExt( 'import-logentry-interwiki-detail', array( 'content', 'parsemag' ), - $contentCount, $interwiki ); + $detail = $this->msg( 'import-logentry-interwiki-detail', + $contentCount, $interwiki )->inContentLanguage()->text(); if ( $this->reason ) { - $detail .= wfMsgForContent( 'colon-separator' ) . $this->reason; + $detail .= $this->msg( 'colon-separator' )->inContentLanguage()->text() . $this->reason; } $log->addEntry( 'interwiki', $title, $detail ); } @@ -405,15 +405,14 @@ class ImportReporter extends ContextSource { } } else { $this->getOutput()->addHTML( "
  • " . Linker::linkKnown( $title ) . " " . - wfMsgHtml( 'import-nonewrevisions' ) . "
  • \n" ); + $this->msg( 'import-nonewrevisions' )->escaped() . "\n" ); } } function close() { $out = $this->getOutput(); if ( $this->mLogItemCount > 0 ) { - $msg = wfMsgExt( 'imported-log-entries', 'parseinline', - $this->getLanguage()->formatNum( $this->mLogItemCount ) ); + $msg = $this->msg( 'imported-log-entries' )->numParams( $this->mLogItemCount )->parse(); $out->addHTML( Xml::tags( 'li', null, $msg ) ); } elseif( $this->mPageCount == 0 && $this->mLogItemCount == 0 ) { $out->addHTML( "\n" ); -- 2.20.1