http://www.mediawiki.org/wiki/Special:Code/MediaWiki/73372

Revision: 73372
Author:   nikerabbit
Date:     2010-09-20 13:24:31 +0000 (Mon, 20 Sep 2010)

Log Message:
-----------
Fix to language handling

Modified Paths:
--------------
    trunk/phase3/includes/Message.php

Modified: trunk/phase3/includes/Message.php
===================================================================
--- trunk/phase3/includes/Message.php   2010-09-20 13:24:16 UTC (rev 73371)
+++ trunk/phase3/includes/Message.php   2010-09-20 13:24:31 UTC (rev 73372)
@@ -101,8 +101,10 @@
         * @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 @@
         * @return Message: $this
         */
        public function inContentLanguage() {
+               global $wgContLang;
                $this->interface = false;
-               $this->language = null;
+               $this->language = $wgContLang;
                return $this;
        }
 
@@ -264,7 +267,7 @@
 
        /**
         * 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 @@
         * @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' );
                }



_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to