From 9eebeaa3d1cc628ffb0b235a677709ebba17b98b Mon Sep 17 00:00:00 2001 From: =?utf8?q?Niklas=20Laxstr=C3=B6m?= Date: Mon, 20 Sep 2010 13:24:31 +0000 Subject: [PATCH] Fix to language handling --- includes/Message.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/includes/Message.php b/includes/Message.php index f2ff88b364..44c72ad24f 100644 --- a/includes/Message.php +++ b/includes/Message.php @@ -101,8 +101,10 @@ class Message { * @return Message: $this */ public function __construct( $key, $params = array() ) { + global $wgLang; $this->key = $key; $this->parameters = array_values( $params ); + $this->language = $wgLang; } /** @@ -172,8 +174,9 @@ class Message { * @return Message: $this */ public function inContentLanguage() { + global $wgContLang; $this->interface = false; - $this->language = null; + $this->language = $wgContLang; return $this; } @@ -264,7 +267,7 @@ class Message { /** * Returns the message text. {{-transformation is done and the result - * is excaped excluding any raw parameters. + * is escaped excluding any raw parameters. * @return String: Escaped message text. */ public function escaped() { @@ -309,8 +312,8 @@ class Message { * @return Wikitext parsed into HTML */ protected function parseText( $string ) { - global $wgOut; - if ( $this->language !== null ) { + global $wgOut, $wgLang, $wgContLang; + if ( $this->language !== $wgLang && $this->language !== $wgContLang ) { # FIXME: remove this limitation throw new MWException( 'Can only parse in interface or content language' ); } -- 2.20.1