Would like to introduce the creation of a magic word {{PAGEVIEWLANGUAGE}} returning the page view language (variant) of the current page.
It would be particularly useful for the LanguageConverter and the Translate extension in order to better localize the translations. For instance the page title template will broken if using the -{ }- syntax:
{{PAGENAME:-{zh:zh; zh-hans:zh-Hans; zh-hant:zh-Hant; zh-hk:zh-Hant-HK;}-}}<!-- return empty string -->
However, it will be fixed by using a syntax like:
{{PAGENAME:{{#switch:{{PAGEVIEWLANGUAGE}}|zh=zh|zh-hans|zh-cn|zh-sg|zh-mo=zh-Hans|zh-hant|zh-tw=zh-Hant|zh-hk|zh-mo=zh-Hant-HK }}}}