mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-24 06:24:08 +00:00
Rebaser: Use site language on special page
Change-Id: I3a07083bb64e9b398cd403a1a0458b40f054672b
This commit is contained in:
parent
c68300afd3
commit
185c94087f
|
@ -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()
|
||||
);
|
||||
|
|
Loading…
Reference in a new issue