OutputPage: Use PageViewLanguage instead of PageLanguage for mw.config
authorTpt <thomaspt@hotmail.fr>
Tue, 8 Oct 2013 14:57:42 +0000 (16:57 +0200)
committerKrinkle <krinklemail@gmail.com>
Wed, 30 Apr 2014 22:23:01 +0000 (22:23 +0000)
This way wgPageContentLanguage will be the language of the displayed
page content and not the language of the page as stored in the database.

Affects other mw.config values as well:
* wgPageContentLanguage
* wgDefaultDateFormat
* wgMonthNames
* wgMonthNamesShort
* wgSeparatorTransformTable
* wgDigitTransformTable

It does not change anything for most of kind of pages, expect for pages
with special Content types like Wikibase entities that outputs the
content of the page in the user language but store the page in a
multilingual way. It fix the case that such entities have ever
wgPageContentLanguage=en even if the page is fully displayed, as example,
in French.

Change-Id: Ib2073071b5d46eaf9cbd1d09ac92a842a0ef4233

includes/OutputPage.php

index f5dbfc6..ab272ba 100644 (file)
@@ -3015,7 +3015,7 @@ $templates
                        $articleId = $wikiPage->getId();
                }
 
-               $lang = $title->getPageLanguage();
+               $lang = $title->getPageViewLanguage();
 
                // Pre-process information
                $separatorTransTable = $lang->separatorTransformTable();