jenkins-bot has submitted this change and it was merged.

Change subject: Apply conversion on namespace names on Special:Search
......................................................................


Apply conversion on namespace names on Special:Search

Change-Id: I2dc8d1a28dd6b273a63dc6e5a06d3c18c720b3f7
---
M includes/specials/SpecialSearch.php
1 file changed, 8 insertions(+), 1 deletion(-)

Approvals:
  Siebrand: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/includes/specials/SpecialSearch.php 
b/includes/specials/SpecialSearch.php
index 8a2163b..4182846 100644
--- a/includes/specials/SpecialSearch.php
+++ b/includes/specials/SpecialSearch.php
@@ -875,6 +875,8 @@
         * @return String: HTML form
         */
        protected function powerSearchBox( $term, $opts ) {
+               global $wgContLang;
+
                // Groups namespaces into rows according to subject
                $rows = array();
                foreach ( SearchEngine::searchableNamespaces() as $namespace => 
$name ) {
@@ -882,10 +884,12 @@
                        if ( !array_key_exists( $subject, $rows ) ) {
                                $rows[$subject] = "";
                        }
-                       $name = str_replace( '_', ' ', $name );
+
+                       $name = $wgContLang->getConverter()->convertNamespace( 
$namespace );
                        if ( $name == '' ) {
                                $name = $this->msg( 'blanknamespace' )->text();
                        }
+
                        $rows[$subject] .=
                                Xml::openElement(
                                        'td', array( 'style' => 'white-space: 
nowrap' )
@@ -898,6 +902,7 @@
                                ) .
                                Xml::closeElement( 'td' );
                }
+
                $rows = array_values( $rows );
                $numRows = count( $rows );
 
@@ -909,9 +914,11 @@
                                'table',
                                array( 'cellpadding' => 0, 'cellspacing' => 0 )
                        );
+
                        for ( $j = $i; $j < $i + 4 && $j < $numRows; $j++ ) {
                                $namespaceTables .= Xml::tags( 'tr', null, 
$rows[$j] );
                        }
+
                        $namespaceTables .= Xml::closeElement( 'table' );
                }
 

-- 
To view, visit https://gerrit.wikimedia.org/r/53756
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I2dc8d1a28dd6b273a63dc6e5a06d3c18c720b3f7
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Liangent <liang...@gmail.com>
Gerrit-Reviewer: Nikerabbit <niklas.laxst...@gmail.com>
Gerrit-Reviewer: Siebrand <siebr...@wikimedia.org>
Gerrit-Reviewer: jenkins-bot

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to