From a06b79ab53f6ef22be6799fa7fb8ce25ec02692a Mon Sep 17 00:00:00 2001 From: Alexandre Emsenhuber Date: Fri, 11 May 2012 11:09:48 +0200 Subject: [PATCH] Use local context to get messages. 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 | 10 ++++------ includes/specials/SpecialRandompage.php | 2 +- includes/specials/SpecialUserlogout.php | 2 +- includes/specials/SpecialWantedfiles.php | 2 +- 4 files changed, 7 insertions(+), 9 deletions(-) diff --git a/includes/specials/SpecialLockdb.php b/includes/specials/SpecialLockdb.php index c1453518e9..d71ac6e191 100644 --- a/includes/specials/SpecialLockdb.php +++ b/includes/specials/SpecialLockdb.php @@ -87,13 +87,11 @@ class SpecialLockdb extends FormSpecialPage { } fwrite( $fp, $data['Reason'] ); $timestamp = wfTimestampNow(); - fwrite( $fp, "\n

" . wfMsgExt( - 'lockedbyandtime', - array( 'content', 'parsemag' ), + fwrite( $fp, "\n

" . $this->msg( 'lockedbyandtime', $this->getUser()->getName(), - $wgContLang->date( $timestamp ), - $wgContLang->time( $timestamp ) - ) . "

\n" ); + $wgContLang->date( $timestamp, false, false ), + $wgContLang->time( $timestamp, false, false ) + )->inContentLanguage()->text() . "

\n" ); fclose( $fp ); return Status::newGood(); diff --git a/includes/specials/SpecialRandompage.php b/includes/specials/SpecialRandompage.php index 0b6239bb23..307088ed35 100644 --- a/includes/specials/SpecialRandompage.php +++ b/includes/specials/SpecialRandompage.php @@ -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 ); } diff --git a/includes/specials/SpecialUserlogout.php b/includes/specials/SpecialUserlogout.php index d747448f97..ab2bf0ac4b 100644 --- a/includes/specials/SpecialUserlogout.php +++ b/includes/specials/SpecialUserlogout.php @@ -39,7 +39,7 @@ class SpecialUserlogout extends UnlistedSpecialPage { */ if ( isset( $_SERVER['REQUEST_URI'] ) && strpos( $_SERVER['REQUEST_URI'], '&' ) !== 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(); diff --git a/includes/specials/SpecialWantedfiles.php b/includes/specials/SpecialWantedfiles.php index 25b93b15a4..2475189147 100644 --- a/includes/specials/SpecialWantedfiles.php +++ b/includes/specials/SpecialWantedfiles.php @@ -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(); -- 2.20.1