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

Revision: 90858
Author:   robin
Date:     2011-06-26 22:58:27 +0000 (Sun, 26 Jun 2011)
Log Message:
-----------
Make parser->getFunctionLang be dependent on title->getPageLanguage() instead 
of $wgContLang, i.e. the page content language instead of the wiki content 
language. This sets the right language on page view + edit for all pages, 
instead of only edit preview on MediaWiki namespace pages (as in EditPage.php).

Modified Paths:
--------------
    trunk/phase3/includes/EditPage.php
    trunk/phase3/includes/parser/Parser.php

Modified: trunk/phase3/includes/EditPage.php
===================================================================
--- trunk/phase3/includes/EditPage.php  2011-06-26 22:05:27 UTC (rev 90857)
+++ trunk/phase3/includes/EditPage.php  2011-06-26 22:58:27 UTC (rev 90858)
@@ -2071,11 +2071,6 @@
 
                                wfRunHooks( 'EditPageGetPreviewText', array( 
$this, &$toparse ) );
 
-                               // In which language to parse the page
-                               // (Should this still be only for MediaWiki 
pages, or for all pages?)
-                               if ( $this->mTitle->getNamespace() == 
NS_MEDIAWIKI ) {
-                                       $parserOptions->setTargetLanguage( 
$this->mTitle->getPageLanguage() );
-                               }
                                $parserOptions->setTidy( true );
                                $parserOptions->enableLimitReport();
                                $parserOutput = $wgParser->parse( 
$this->mArticle->preSaveTransform( $toparse ),

Modified: trunk/phase3/includes/parser/Parser.php
===================================================================
--- trunk/phase3/includes/parser/Parser.php     2011-06-26 22:05:27 UTC (rev 
90857)
+++ trunk/phase3/includes/parser/Parser.php     2011-06-26 22:58:27 UTC (rev 
90858)
@@ -673,7 +673,7 @@
                if ( $target !== null ) {
                        return $target;
                } else {
-                       return $this->mOptions->getInterfaceMessage() ? $wgLang 
: $wgContLang;
+                       return $this->mOptions->getInterfaceMessage() ? $wgLang 
: $this->mTitle->getPageLanguage();
                }
        }
 


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

Reply via email to