Rebaser: Use site language on special page

Change-Id: I3a07083bb64e9b398cd403a1a0458b40f054672b
This commit is contained in:
Ed Sanders 2018-04-22 22:17:49 +01:00
parent c68300afd3
commit 185c94087f

View file

@ -869,7 +869,17 @@ class VisualEditorHooks {
* @return bool Always true
*/
public static function onMakeGlobalVariablesScript( array &$vars, OutputPage $out ) {
global $wgContLang;
$title = $out->getTitle();
if ( $title->isSpecial( 'CollabPad' ) ) {
// Use the site language for CollabPad, as getPageLanguage just
// returns the interface language for special pages.
// TODO: Let the user change the document language on multi-lingual sites.
$pageLanguage = $wgContLang;
} else {
$pageLanguage = $out->getTitle()->getPageLanguage();
}
$fallbacks = $pageLanguage->getConverter()->getVariantFallbacks(
$pageLanguage->getPreferredVariant()
);