From d761eab34985f57a3e304198db60a1d9b1fc51bc Mon Sep 17 00:00:00 2001 From: Robin Pepermans Date: Sun, 26 Jun 2011 22:58:27 +0000 Subject: [PATCH] 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). --- includes/EditPage.php | 5 ----- includes/parser/Parser.php | 2 +- 2 files changed, 1 insertion(+), 6 deletions(-) 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(); } } -- 2.20.1