Use local context to get messages.
authorAlexandre Emsenhuber <ialex.wiki@gmail.com>
Fri, 11 May 2012 09:09:48 +0000 (11:09 +0200)
committerAlexandre Emsenhuber <ialex.wiki@gmail.com>
Fri, 11 May 2012 20:22:06 +0000 (22:22 +0200)
Also added "false, false" to Language::time() and Language::date() calls in Special:Lockdb, this is to have the date using the default format and not in the format of the user locking the database.

Change-Id: I9309022b005fcc7d31350242b8989ca7eabf69a8

includes/specials/SpecialLockdb.php
includes/specials/SpecialRandompage.php
includes/specials/SpecialUserlogout.php
includes/specials/SpecialWantedfiles.php

index c145351..d71ac6e 100644 (file)
@@ -87,13 +87,11 @@ class SpecialLockdb extends FormSpecialPage {
                }
                fwrite( $fp, $data['Reason'] );
                $timestamp = wfTimestampNow();
-               fwrite( $fp, "\n<p>" . wfMsgExt(
-                       'lockedbyandtime',
-                       array( 'content', 'parsemag' ),
+               fwrite( $fp, "\n<p>" . $this->msg( 'lockedbyandtime',
                        $this->getUser()->getName(),
-                       $wgContLang->date( $timestamp ),
-                       $wgContLang->time( $timestamp )
-               ) . "</p>\n" );
+                       $wgContLang->date( $timestamp, false, false ),
+                       $wgContLang->time( $timestamp, false, false )
+               )->inContentLanguage()->text() . "</p>\n" );
                fclose( $fp );
 
                return Status::newGood();
index 0b6239b..307088e 100644 (file)
@@ -85,7 +85,7 @@ class RandomPage extends SpecialPage {
                $nsNames = array();
                foreach( $this->namespaces as $n ) {
                        if( $n === NS_MAIN ) {
-                               $nsNames[] = wfMsgNoTrans( 'blanknamespace' );
+                               $nsNames[] = $this->msg( 'blanknamespace' )->plain();
                        } else {
                                $nsNames[] = $wgContLang->getNsText( $n );
                        }
index d747448..ab2bf0a 100644 (file)
@@ -39,7 +39,7 @@ class SpecialUserlogout extends UnlistedSpecialPage {
                 */
                if ( isset( $_SERVER['REQUEST_URI'] ) && strpos( $_SERVER['REQUEST_URI'], '&amp;' ) !== false ) {
                        wfDebug( "Special:Userlogout request {$_SERVER['REQUEST_URI']} looks suspicious, denying.\n" );
-                       throw new HttpError( 400, wfMessage( 'suspicious-userlogout' ), wfMessage( 'loginerror' ) );
+                       throw new HttpError( 400, $this->msg( 'suspicious-userlogout' ), $this->msg( 'loginerror' ) );
                }
 
                $this->setHeaders();
index 25b93b1..2475189 100644 (file)
@@ -39,7 +39,7 @@ class WantedFilesPage extends WantedQueryPage {
                # Specifically setting to use "Wanted Files" (NS_MAIN) as title, so as to get what
                # category would be used on main namespace pages, for those tricky wikipedia
                # admins who like to do {{#ifeq:{{NAMESPACE}}|foo|bar|....}}.
-               $catMessage = wfMessage( 'broken-file-category' )
+               $catMessage = $this->msg( 'broken-file-category' )
                        ->title( Title::newFromText( "Wanted Files", NS_MAIN ) )
                        ->inContentLanguage();