diff --git a/src/Cite.php b/src/Cite.php index c1ce1d83a..6a7de1b23 100644 --- a/src/Cite.php +++ b/src/Cite.php @@ -99,6 +99,11 @@ class Cite { */ private $referenceStack; + /** + * @var ReferenceMessageLocalizer $messageLocalizer + */ + private $messageLocalizer; + /** * @param Parser $parser */ @@ -112,12 +117,12 @@ class Cite { $parser ); $this->referenceStack = new ReferenceStack( $this->errorReporter ); - $messageLocalizer = new ReferenceMessageLocalizer( $parser->getContentLanguage() ); + $this->messageLocalizer = new ReferenceMessageLocalizer( $parser->getContentLanguage() ); $citeKeyFormatter = new CiteKeyFormatter(); $this->footnoteMarkFormatter = new FootnoteMarkFormatter( $this->mParser, $this->errorReporter, $citeKeyFormatter ); $this->footnoteBodyFormatter = new FootnoteBodyFormatter( - $this->mParser, $this->errorReporter, $citeKeyFormatter, $messageLocalizer ); + $this->mParser, $this->errorReporter, $citeKeyFormatter, $this->messageLocalizer ); } } @@ -543,7 +548,7 @@ class Cite { } } if ( $isSectionPreview && $s !== '' ) { - $headerMsg = wfMessage( 'cite_section_preview_references' ); + $headerMsg = $this->messageLocalizer->msg( 'cite_section_preview_references' ); if ( !$headerMsg->isDisabled() ) { $s = '