X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2FHtml.php;h=d066effd926ecc92456c1c10aad76e8970e385ba;hb=ee00b6853b263f426da60a179357e39edc37bfd5;hp=aac492c921cc2a4525d5cab7ddf124eac0ca78d3;hpb=f7b7d9400d993abb545db503d30e20206689a1e1;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/Html.php b/includes/Html.php index aac492c921..d066effd92 100644 --- a/includes/Html.php +++ b/includes/Html.php @@ -840,9 +840,14 @@ class Html { // Value is provided by user, the name shown is localized for the user. $options[$params['all']] = wfMessage( 'namespacesall' )->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 @@ -855,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; }