r112434 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r112433‎ | r112434 | r112435 >
Date:13:34, 26 February 2012
Author:ialex
Status:ok
Tags:
Comment:
Use local context to get messages
Modified paths:
  • /trunk/phase3/includes/specials/SpecialImport.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/specials/SpecialImport.php
@@ -179,7 +179,7 @@
180180 if( $user->isAllowed( 'importupload' ) ) {
181181 $out->addWikiMsg( "importtext" );
182182 $out->addHTML(
183 - Xml::fieldset( wfMsg( 'import-upload' ) ).
 183+ Xml::fieldset( $this->msg( 'import-upload' )->text() ).
184184 Xml::openElement( 'form', array( 'enctype' => 'multipart/form-data', 'method' => 'post',
185185 'action' => $action, 'id' => 'mw-import-upload-form' ) ) .
186186 Html::hidden( 'action', 'submit' ) .
@@ -188,7 +188,7 @@
189189
190190 "<tr>
191191 <td class='mw-label'>" .
192 - Xml::label( wfMsg( 'import-upload-filename' ), 'xmlimport' ) .
 192+ Xml::label( $this->msg( 'import-upload-filename' )->text(), 'xmlimport' ) .
193193 "</td>
194194 <td class='mw-input'>" .
195195 Xml::input( 'xmlimport', 50, '', array( 'type' => 'file' ) ) . ' ' .
@@ -196,7 +196,7 @@
197197 </tr>
198198 <tr>
199199 <td class='mw-label'>" .
200 - Xml::label( wfMsg( 'import-comment' ), 'mw-import-comment' ) .
 200+ Xml::label( $this->msg( 'import-comment' )->text(), 'mw-import-comment' ) .
201201 "</td>
202202 <td class='mw-input'>" .
203203 Xml::input( 'log-comment', 50, '',
@@ -206,7 +206,7 @@
207207 <tr>
208208 <td></td>
209209 <td class='mw-submit'>" .
210 - Xml::submitButton( wfMsg( 'uploadbtn' ) ) .
 210+ Xml::submitButton( $this->msg( 'uploadbtn' )->text() ) .
211211 "</td>
212212 </tr>" .
213213 Xml::closeElement( 'table' ).
@@ -226,7 +226,7 @@
227227 if( $wgExportMaxLinkDepth > 0 ) {
228228 $importDepth = "<tr>
229229 <td class='mw-label'>" .
230 - wfMsgExt( 'export-pagelinks', 'parseinline' ) .
 230+ $this->msg( 'export-pagelinks' )->parse() .
231231 "</td>
232232 <td class='mw-input'>" .
233233 Xml::input( 'pagelink-depth', 3, 0 ) .
@@ -235,16 +235,16 @@
236236 }
237237
238238 $out->addHTML(
239 - Xml::fieldset( wfMsg( 'importinterwiki' ) ) .
 239+ Xml::fieldset( $this->msg( 'importinterwiki' )->text() ) .
240240 Xml::openElement( 'form', array( 'method' => 'post', 'action' => $action, 'id' => 'mw-import-interwiki-form' ) ) .
241 - wfMsgExt( 'import-interwiki-text', array( 'parse' ) ) .
 241+ $this->msg( 'import-interwiki-text' )->parseAsBlock() .
242242 Html::hidden( 'action', 'submit' ) .
243243 Html::hidden( 'source', 'interwiki' ) .
244244 Html::hidden( 'editToken', $user->getEditToken() ) .
245245 Xml::openElement( 'table', array( 'id' => 'mw-import-table' ) ) .
246246 "<tr>
247247 <td class='mw-label'>" .
248 - Xml::label( wfMsg( 'import-interwiki-source' ), 'interwiki' ) .
 248+ Xml::label( $this->msg( 'import-interwiki-source' )->text(), 'interwiki' ) .
249249 "</td>
250250 <td class='mw-input'>" .
251251 Xml::openElement( 'select', array( 'name' => 'interwiki' ) )
@@ -263,20 +263,20 @@
264264 <td>
265265 </td>
266266 <td class='mw-input'>" .
267 - Xml::checkLabel( wfMsg( 'import-interwiki-history' ), 'interwikiHistory', 'interwikiHistory', $this->history ) .
 267+ Xml::checkLabel( $this->msg( 'import-interwiki-history' )->text(), 'interwikiHistory', 'interwikiHistory', $this->history ) .
268268 "</td>
269269 </tr>
270270 <tr>
271271 <td>
272272 </td>
273273 <td class='mw-input'>" .
274 - Xml::checkLabel( wfMsg( 'import-interwiki-templates' ), 'interwikiTemplates', 'interwikiTemplates', $this->includeTemplates ) .
 274+ Xml::checkLabel( $this->msg( 'import-interwiki-templates' )->text(), 'interwikiTemplates', 'interwikiTemplates', $this->includeTemplates ) .
275275 "</td>
276276 </tr>
277277 $importDepth
278278 <tr>
279279 <td class='mw-label'>" .
280 - Xml::label( wfMsg( 'import-interwiki-namespace' ), 'namespace' ) .
 280+ Xml::label( $this->msg( 'import-interwiki-namespace' )->text(), 'namespace' ) .
281281 "</td>
282282 <td class='mw-input'>" .
283283 Xml::namespaceSelector( $this->namespace, '' ) .
@@ -284,7 +284,7 @@
285285 </tr>
286286 <tr>
287287 <td class='mw-label'>" .
288 - Xml::label( wfMsg( 'import-comment' ), 'mw-interwiki-comment' ) .
 288+ Xml::label( $this->msg( 'import-comment' )->text(), 'mw-interwiki-comment' ) .
289289 "</td>
290290 <td class='mw-input'>" .
291291 Xml::input( 'log-comment', 50, '',
@@ -295,7 +295,7 @@
296296 <td>
297297 </td>
298298 <td class='mw-submit'>" .
299 - Xml::submitButton( wfMsg( 'import-interwiki-submit' ), Linker::tooltipAndAccesskeyAttribs( 'import' ) ) .
 299+ Xml::submitButton( $this->msg( 'import-interwiki-submit' )->text(), Linker::tooltipAndAccesskeyAttribs( 'import' ) ) .
300300 "</td>
301301 </tr>" .
302302 Xml::closeElement( 'table' ).
@@ -369,25 +369,25 @@
370370
371371 if( $successCount > 0 ) {
372372 $this->getOutput()->addHTML( "<li>" . Linker::linkKnown( $title ) . " " .
373 - wfMsgExt( 'import-revision-count', array( 'parsemag', 'escape' ), $localCount ) .
 373+ $this->msg( 'import-revision-count', $localCount ) .
374374 "</li>\n"
375375 );
376376
377377 $log = new LogPage( 'import' );
378378 if( $this->mIsUpload ) {
379 - $detail = wfMsgExt( 'import-logentry-upload-detail', array( 'content', 'parsemag' ),
380 - $contentCount );
 379+ $detail = $this->msg( 'import-logentry-upload-detail',
 380+ $contentCount )->inContentLanguage()->text();
381381 if ( $this->reason ) {
382 - $detail .= wfMsgForContent( 'colon-separator' ) . $this->reason;
 382+ $detail .= $this->msg( 'colon-separator' )->inContentLanguage()->text() . $this->reason;
383383 }
384384 $log->addEntry( 'upload', $title, $detail );
385385 } else {
386386 $interwiki = '[[:' . $this->mInterwiki . ':' .
387387 $origTitle->getPrefixedText() . ']]';
388 - $detail = wfMsgExt( 'import-logentry-interwiki-detail', array( 'content', 'parsemag' ),
389 - $contentCount, $interwiki );
 388+ $detail = $this->msg( 'import-logentry-interwiki-detail',
 389+ $contentCount, $interwiki )->inContentLanguage()->text();
390390 if ( $this->reason ) {
391 - $detail .= wfMsgForContent( 'colon-separator' ) . $this->reason;
 391+ $detail .= $this->msg( 'colon-separator' )->inContentLanguage()->text() . $this->reason;
392392 }
393393 $log->addEntry( 'interwiki', $title, $detail );
394394 }
@@ -405,15 +405,14 @@
406406 }
407407 } else {
408408 $this->getOutput()->addHTML( "<li>" . Linker::linkKnown( $title ) . " " .
409 - wfMsgHtml( 'import-nonewrevisions' ) . "</li>\n" );
 409+ $this->msg( 'import-nonewrevisions' )->escaped() . "</li>\n" );
410410 }
411411 }
412412
413413 function close() {
414414 $out = $this->getOutput();
415415 if ( $this->mLogItemCount > 0 ) {
416 - $msg = wfMsgExt( 'imported-log-entries', 'parseinline',
417 - $this->getLanguage()->formatNum( $this->mLogItemCount ) );
 416+ $msg = $this->msg( 'imported-log-entries' )->numParams( $this->mLogItemCount )->parse();
418417 $out->addHTML( Xml::tags( 'li', null, $msg ) );
419418 } elseif( $this->mPageCount == 0 && $this->mLogItemCount == 0 ) {
420419 $out->addHTML( "</ul>\n" );

Status & tagging log