Use local context to get messages
authorAlexandre Emsenhuber <ialex@users.mediawiki.org>
Thu, 17 Nov 2011 20:30:28 +0000 (20:30 +0000)
committerAlexandre Emsenhuber <ialex@users.mediawiki.org>
Thu, 17 Nov 2011 20:30:28 +0000 (20:30 +0000)
includes/specials/SpecialBooksources.php

index 2081932..48ca4f0 100644 (file)
@@ -115,11 +115,11 @@ class SpecialBookSources extends SpecialPage {
        private function makeForm() {
                global $wgScript;
 
-               $form  = '<fieldset><legend>' . wfMsgHtml( 'booksources-search-legend' ) . '</legend>';
+               $form  = '<fieldset><legend>' . $this->msg( 'booksources-search-legend' )->escaped() . '</legend>';
                $form .= Xml::openElement( 'form', array( 'method' => 'get', 'action' => $wgScript ) );
                $form .= Html::hidden( 'title', $this->getTitle()->getPrefixedText() );
-               $form .= '<p>' . Xml::inputLabel( wfMsg( 'booksources-isbn' ), 'isbn', 'isbn', 20, $this->isbn );
-               $form .= '&#160;' . Xml::submitButton( wfMsg( 'booksources-go' ) ) . '</p>';
+               $form .= '<p>' . Xml::inputLabel( $this->msg( 'booksources-isbn' )->text(), 'isbn', 'isbn', 20, $this->isbn );
+               $form .= '&#160;' . Xml::submitButton( $this->msg( 'booksources-go' )->text() ) . '</p>';
                $form .= Xml::closeElement( 'form' );
                $form .= '</fieldset>';
                return $form;
@@ -139,7 +139,8 @@ class SpecialBookSources extends SpecialPage {
                wfRunHooks( 'BookInformation', array( $this->isbn, $this->getOutput() ) );
 
                # Check for a local page such as Project:Book_sources and use that if available
-               $title = Title::makeTitleSafe( NS_PROJECT, wfMsgForContent( 'booksources' ) ); # Show list in content language
+               $page = $this->msg( 'booksources' )->inContentLanguage()->text();
+               $title = Title::makeTitleSafe( NS_PROJECT, $page ); # Show list in content language
                if( is_object( $title ) && $title->exists() ) {
                        $rev = Revision::newFromTitle( $title );
                        $this->getOutput()->addWikiText( str_replace( 'MAGICNUMBER', $this->isbn, $rev->getText() ) );