r112797 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r112796‎ | r112797 | r112798 >
Date:12:04, 1 March 2012
Author:hashar
Status:ok
Tags:
Comment:
MFT to 1.19wmf1 r111882

Bug 34835 - watchlist shows times in UTC
Modified paths:
  • /branches/wmf/1.19wmf1/includes/specials/SpecialWatchlist.php (modified) (history)

Diff [purge]

Index: branches/wmf/1.19wmf1/includes/specials/SpecialWatchlist.php
@@ -58,18 +58,18 @@
5959 $output->setPageTitle( $this->msg( 'watchnologin' ) );
6060 $llink = Linker::linkKnown(
6161 SpecialPage::getTitleFor( 'Userlogin' ),
62 - wfMsgHtml( 'loginreqlink' ),
 62+ $this->msg( 'loginreqlink' )->escaped(),
6363 array(),
6464 array( 'returnto' => $this->getTitle()->getPrefixedText() )
6565 );
66 - $output->addHTML( wfMessage( 'watchlistanontext' )->rawParams( $llink )->parse() );
 66+ $output->addHTML( $this->msg( 'watchlistanontext' )->rawParams( $llink )->parse() );
6767 return;
6868 }
6969
7070 $this->setHeaders();
7171 $this->outputHeader();
7272
73 - $output->addSubtitle( $this->msg( 'watchlistfor2', $this->getUser()->getName()
 73+ $output->addSubtitle( $this->msg( 'watchlistfor2', $user->getName()
7474 )->rawParams( SpecialEditWatchlist::buildTools( null ) ) );
7575
7676 $request = $this->getRequest();
@@ -240,23 +240,21 @@
241241 $output->showLagWarning( $lag );
242242 }
243243
244 - $lang = $this->getLanguage();
245 -
246244 # Create output form
247 - $form = Xml::fieldset( wfMsg( 'watchlist-options' ), false, array( 'id' => 'mw-watchlist-options' ) );
 245+ $form = Xml::fieldset( $this->msg( 'watchlist-options' )->text(), false, array( 'id' => 'mw-watchlist-options' ) );
248246
249247 # Show watchlist header
250 - $form .= wfMsgExt( 'watchlist-details', array( 'parseinline' ), $lang->formatNum( $nitems ) );
 248+ $form .= $this->msg( 'watchlist-details' )->numParams( $nitems )->parse();
251249
252250 if( $user->getOption( 'enotifwatchlistpages' ) && $wgEnotifWatchlist) {
253 - $form .= wfMsgExt( 'wlheader-enotif', 'parse' ) . "\n";
 251+ $form .= $this->msg( 'wlheader-enotif' )->parseAsBlock() . "\n";
254252 }
255253 if( $wgShowUpdatedMarker ) {
256254 $form .= Xml::openElement( 'form', array( 'method' => 'post',
257255 'action' => $this->getTitle()->getLocalUrl(),
258256 'id' => 'mw-watchlist-resetbutton' ) ) .
259 - wfMsgExt( 'wlheader-showupdated', array( 'parseinline' ) ) . ' ' .
260 - Xml::submitButton( wfMsg( 'enotif_reset' ), array( 'name' => 'dummy' ) ) .
 257+ $this->msg( 'wlheader-showupdated' )->parse() . ' ' .
 258+ Xml::submitButton( $this->msg( 'enotif_reset' )->text(), array( 'name' => 'dummy' ) ) .
261259 Html::hidden( 'reset', 'all' ) .
262260 Xml::closeElement( 'form' );
263261 }
@@ -292,15 +290,12 @@
293291
294292 /* Start bottom header */
295293
 294+ $lang = $this->getLanguage();
296295 $wlInfo = '';
297296 if( $values['days'] > 0 ) {
298297 $timestamp = wfTimestampNow();
299 - $wlInfo = wfMsgExt( 'wlnote', 'parseinline',
300 - $lang->formatNum( $numRows ),
301 - $lang->formatNum( round( $values['days'] * 24 ) ),
302 - $lang->date( $timestamp, true ),
303 - $lang->time( $timestamp, true )
304 - ) . '<br />';
 298+ $wlInfo = $this->msg( 'wlnote' )->numParams( $numRows, round( $values['days'] * 24 ) )->params(
 299+ $lang->userDate( $timestamp, $user ), $lang->userTime( $timestamp, $user ) )->parse() . '<br />';
305300 }
306301
307302 $cutofflinks = "\n" . $this->cutoffLinks( $values['days'], $nondefaults ) . "<br />\n";
@@ -333,10 +328,10 @@
334329 $form .= $lang->pipeList( $links );
335330 $form .= Xml::openElement( 'form', array( 'method' => 'post', 'action' => $this->getTitle()->getLocalUrl(), 'id' => 'mw-watchlist-form-namespaceselector' ) );
336331 $form .= '<hr /><p>';
337 - $form .= Xml::label( wfMsg( 'namespace' ), 'namespace' ) . '&#160;';
 332+ $form .= Xml::label( $this->msg( 'namespace' )->text(), 'namespace' ) . '&#160;';
338333 $form .= Xml::namespaceSelector( $nameSpace, '' ) . '&#160;';
339 - $form .= Xml::checkLabel( wfMsg('invert'), 'invert', 'nsinvert', $invert ) . '&#160;';
340 - $form .= Xml::submitButton( wfMsg( 'allpagessubmit' ) ) . '</p>';
 334+ $form .= Xml::checkLabel( $this->msg( 'invert' )->text(), 'invert', 'nsinvert', $invert ) . '&#160;';
 335+ $form .= Xml::submitButton( $this->msg( 'allpagessubmit' )->text() ) . '</p>';
341336 $form .= Html::hidden( 'days', $values['days'] );
342337 foreach ( $filters as $key => $msg ) {
343338 if ( $values[$key] ) {
@@ -405,13 +400,10 @@
406401 }
407402
408403 protected function showHideLink( $options, $message, $name, $value ) {
409 - $showLinktext = wfMsgHtml( 'show' );
410 - $hideLinktext = wfMsgHtml( 'hide' );
411 -
412 - $label = $value ? $showLinktext : $hideLinktext;
 404+ $label = $this->msg( $value ? 'show' : 'hide' )->escaped();
413405 $options[$name] = 1 - (int) $value;
414406
415 - return wfMsgHtml( $message, Linker::linkKnown( $this->getTitle(), $label, array(), $options ) );
 407+ return $this->msg( $message )->rawParams( Linker::linkKnown( $this->getTitle(), $label, array(), $options ) )->escaped();
416408 }
417409
418410 protected function hoursLink( $h, $options = array() ) {
@@ -427,7 +419,7 @@
428420
429421 protected function daysLink( $d, $options = array() ) {
430422 $options['days'] = $d;
431 - $message = ( $d ? $this->getLanguage()->formatNum( $d ) : wfMsgHtml( 'watchlistall2' ) );
 423+ $message = ( $d ? $this->getLanguage()->formatNum( $d ) : $this->msg( 'watchlistall2' )->escaped() );
432424
433425 return Linker::linkKnown(
434426 $this->getTitle(),
@@ -453,11 +445,10 @@
454446 foreach( $days as $d ) {
455447 $days[$i++] = $this->daysLink( $d, $options );
456448 }
457 - return wfMsgExt('wlshowlast',
458 - array('parseinline', 'replaceafter'),
 449+ return $this->msg( 'wlshowlast' )->rawParams(
459450 $this->getLanguage()->pipeList( $hours ),
460451 $this->getLanguage()->pipeList( $days ),
461 - $this->daysLink( 0, $options ) );
 452+ $this->daysLink( 0, $options ) )->parse();
462453 }
463454
464455 /**
Property changes on: branches/wmf/1.19wmf1/includes/specials/SpecialWatchlist.php
___________________________________________________________________
Added: svn:mergeinfo
465456 Merged /branches/JSTesting/includes/specials/SpecialWatchlist.php:r100352-107913
466457 Merged /branches/REL1_15/phase3/includes/specials/SpecialWatchlist.php:r51646
467458 Merged /branches/sqlite/includes/specials/SpecialWatchlist.php:r58211-58321
468459 Merged /trunk/phase3/includes/specials/SpecialWatchlist.php:r111085,111128,111144,111251,111750,111882,112397,112408,112474
469460 Merged /branches/wmf-deployment/includes/specials/SpecialWatchlist.php:r53381,56967

Follow-up revisions

RevisionCommit summaryAuthorDate
r112798MFT to REL1_19 r111882...hashar12:04, 1 March 2012

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r111882Use local context to get messagesialex19:47, 19 February 2012

Status & tagging log