Use local context to get messages
authorAlexandre Emsenhuber <ialex@users.mediawiki.org>
Fri, 2 Mar 2012 19:39:07 +0000 (19:39 +0000)
committerAlexandre Emsenhuber <ialex@users.mediawiki.org>
Fri, 2 Mar 2012 19:39:07 +0000 (19:39 +0000)
includes/specials/SpecialListfiles.php

index b575499..fd48cb0 100644 (file)
@@ -107,15 +107,15 @@ class ImageListPager extends TablePager {
                if ( !$this->mFieldNames ) {
                        global $wgMiserMode;
                        $this->mFieldNames = array(
-                               'img_timestamp' => wfMsg( 'listfiles_date' ),
-                               'img_name' => wfMsg( 'listfiles_name' ),
-                               'thumb' => wfMsg( 'listfiles_thumb' ),
-                               'img_size' => wfMsg( 'listfiles_size' ),
-                               'img_user_text' => wfMsg( 'listfiles_user' ),
-                               'img_description' => wfMsg( 'listfiles_description' ),
+                               'img_timestamp' => $this->msg( 'listfiles_date' )->text(),
+                               'img_name' => $this->msg( 'listfiles_name' )->text(),
+                               'thumb' => $this->msg( 'listfiles_thumb' )->text(),
+                               'img_size' => $this->msg( 'listfiles_size' )->text(),
+                               'img_user_text' => $this->msg( 'listfiles_user' )->text(),
+                               'img_description' => $this->msg( 'listfiles_description' )->text(),
                        );
                        if( !$wgMiserMode ) {
-                               $this->mFieldNames['count'] = wfMsg( 'listfiles_count' );
+                               $this->mFieldNames['count'] = $this->msg( 'listfiles_count' )->text();
                        }
                }
                return $this->mFieldNames;
@@ -201,7 +201,7 @@ class ImageListPager extends TablePager {
                                return htmlspecialchars( $this->getLanguage()->timeanddate( $value, true ) );
                        case 'img_name':
                                static $imgfile = null;
-                               if ( $imgfile === null ) $imgfile = wfMsg( 'imgfile' );
+                               if ( $imgfile === null ) $imgfile = $this->msg( 'imgfile' )->text();
 
                                // Weird files can maybe exist? Bug 22227
                                $filePage = Title::makeTitleSafe( NS_FILE, $value );
@@ -253,7 +253,7 @@ class ImageListPager extends TablePager {
                ) );
                return Html::openElement( 'form',
                                array( 'method' => 'get', 'action' => $wgScript, 'id' => 'mw-listfiles-form' ) ) .
-                       Xml::fieldset( wfMsg( 'listfiles' ) ) .
+                       Xml::fieldset( $this->msg( 'listfiles' )->text() ) .
                        Xml::buildForm( $inputForm, 'table_pager_limit_submit' ) .
                        $this->getHiddenFields( array( 'limit', 'ilsearch', 'user' ) ) .
                        Html::closeElement( 'fieldset' ) .