From 44725333ff66e849ddb220fb4ce443a7e4f4cda4 Mon Sep 17 00:00:00 2001 From: Timo Tijhof Date: Tue, 8 Mar 2016 23:44:18 +0000 Subject: [PATCH] OutputPage: Set wgPageContentLanguage to pageViewLang instead of pageLang Follows-up 80a090ea7 (r104483). I'm assuming the difference is that pageLanguage will be the canonical variant for the page (as authored in wikitext, presumably the wiki's default), whereas pageViewLanguage will be the variant of the pageLanguage based on the current user-interface language (if and only if the user interface is related). Viewing zh by default has: * userLanguage: zh * pageLanguage: zh * pageViewLanguage: zh Viewing zh-cn by default has: * userLanguage: zh * pageLanguage: zh * pageViewLanguage: zh-cn Viewing zh-cn with uselang=en has: * userLanguage: en * pageLanguage: zh * pageViewLanguage: zh-cn Viewing zh-cn with uselang=zh-tw has: * userLanguage: zh-tw * pageLanguage: zh * pageViewLanguage: zh-cn The main use case behind wgPageContentLanguage in 80a090ea7 was tablesorter which should match the language and variant of the rendered wikipage content. The parser output and div#mw-content-text element use pageViewLanguage, so let's set wgPageContentLanguage to that as well. Change-Id: Ibf399dfe5ca60fb55e7acd75a5c0238d8b903807 --- includes/OutputPage.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/OutputPage.php b/includes/OutputPage.php index 11c23f090f..e36d83f413 100644 --- a/includes/OutputPage.php +++ b/includes/OutputPage.php @@ -3218,7 +3218,7 @@ class OutputPage extends ContextSource { $articleId = $wikiPage->getId(); } - $lang = $title->getPageLanguage(); + $lang = $title->getPageViewLanguage(); // Pre-process information $separatorTransTable = $lang->separatorTransformTable(); -- 2.20.1