OutputPage: Set wgPageContentLanguage to pageViewLang instead of pageLang
authorTimo Tijhof <krinklemail@gmail.com>
Tue, 8 Mar 2016 23:44:18 +0000 (23:44 +0000)
committerGilles Dubuc <gdubuc@wikimedia.org>
Fri, 11 Mar 2016 08:35:41 +0000 (09:35 +0100)
commit44725333ff66e849ddb220fb4ce443a7e4f4cda4
treec0b03ede2e7b6aebee594cceabbe70081855d0cf
parentc89de8fef4124a47646b537122db435863cb3e21
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