X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2FHtml.php;h=d066effd926ecc92456c1c10aad76e8970e385ba;hb=ee00b6853b263f426da60a179357e39edc37bfd5;hp=dba4c67a72a00e5753c7adf6e6af4b2ea5d1a69d;hpb=88166887e44b98efb4bcebd2960be8474a0b3cac;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/Html.php b/includes/Html.php index dba4c67a72..d066effd92 100644 --- a/includes/Html.php +++ b/includes/Html.php @@ -552,10 +552,13 @@ class Html { } /** - * Output a "" or (for XML) literal "]]>". + * It is unsupported for the contents to contain the sequence `text(); } - // Add all namespaces as options (in the content language) - $options += - MediaWikiServices::getInstance()->getContentLanguage()->getFormattedNamespaces(); + if ( $params['in-user-lang'] ?? false ) { + global $wgLang; + $lang = $wgLang; + } else { + $lang = MediaWikiServices::getInstance()->getContentLanguage(); + } + // Add all namespaces as options + $options += $lang->getFormattedNamespaces(); $optionsOut = []; // Filter out namespaces below 0 and massage labels @@ -851,8 +860,7 @@ class Html { // main we don't use "" but the user message describing it (e.g. "(Main)" or "(Article)") $nsName = wfMessage( 'blanknamespace' )->text(); } elseif ( is_int( $nsId ) ) { - $nsName = MediaWikiServices::getInstance()->getContentLanguage()-> - convertNamespace( $nsId ); + $nsName = $lang->convertNamespace( $nsId ); } $optionsOut[$nsId] = $nsName; }