From: Robin Pepermans Date: Sun, 26 Jun 2011 22:58:27 +0000 (+0000) Subject: Make parser->getFunctionLang be dependent on title->getPageLanguage() instead of... X-Git-Tag: 1.31.0-rc.0~29257 X-Git-Url: https://git.cyclocoop.org//%22?a=commitdiff_plain;h=d761eab34985f57a3e304198db60a1d9b1fc51bc;p=lhc%2Fweb%2Fwiklou.git 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). --- diff --git a/includes/EditPage.php b/includes/EditPage.php index 44cba7f53e..457b2b586c 100644 --- a/includes/EditPage.php +++ b/includes/EditPage.php @@ -2071,11 +2071,6 @@ HTML 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 ), diff --git a/includes/parser/Parser.php b/includes/parser/Parser.php index 26c54af4fe..76974c935c 100644 --- a/includes/parser/Parser.php +++ b/includes/parser/Parser.php @@ -673,7 +673,7 @@ class Parser { if ( $target !== null ) { return $target; } else { - return $this->mOptions->getInterfaceMessage() ? $wgLang : $wgContLang; + return $this->mOptions->getInterfaceMessage() ? $wgLang : $this->mTitle->getPageLanguage(); } }