From: Niklas Laxström Date: Mon, 20 Sep 2010 13:24:31 +0000 (+0000) Subject: Fix to language handling X-Git-Tag: 1.31.0-rc.0~34865 X-Git-Url: http://git.cyclocoop.org/%7B%7B%20url_for%28%27admin_vote_del%27%2C%20idvote=vote.voteid%29%20%7D%7D?a=commitdiff_plain;h=9eebeaa3d1cc628ffb0b235a677709ebba17b98b;p=lhc%2Fweb%2Fwiklou.git Fix to language handling --- 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' ); }