Follow up on r46020 and r46489. Improve the $wgContLang->convert() calling procedure...
authorPhilip Tzou <philip@users.mediawiki.org>
Sun, 26 Jul 2009 15:54:11 +0000 (15:54 +0000)
committerPhilip Tzou <philip@users.mediawiki.org>
Sun, 26 Jul 2009 15:54:11 +0000 (15:54 +0000)
includes/CategoryPage.php
languages/Language.php

index 0a1d217..362fbde 100644 (file)
@@ -86,7 +86,7 @@ class CategoryViewer {
         * @private
         */
        function getHTML() {
-               global $wgOut, $wgCategoryMagicGallery, $wgCategoryPagingLimit;
+               global $wgOut, $wgCategoryMagicGallery, $wgCategoryPagingLimit, $wgContLang;
                wfProfileIn( __METHOD__ );
 
                $this->showGallery = $wgCategoryMagicGallery && !$wgOut->mNoGallery;
@@ -118,7 +118,7 @@ class CategoryViewer {
                }
 
                wfProfileOut( __METHOD__ );
-               return $r;
+               return $wgContLang->convert($r);
        }
 
        function clearCategoryState() {
@@ -153,11 +153,10 @@ class CategoryViewer {
         * @deprecated kept for compatibility, please use addSubcategoryObject instead
         */
        function addSubcategory( $title, $sortkey, $pageLength ) {
-               global $wgContLang;
                // Subcategory; strip the 'Category' namespace from the link text.
                $this->children[] = $this->getSkin()->link(
                        $title,
-                       $wgContLang->convertHtml( $title->getText() ),
+                       null,
                        array(),
                        array(),
                        array( 'known', 'noclasses' )
@@ -205,17 +204,16 @@ class CategoryViewer {
         */
        function addPage( $title, $sortkey, $pageLength, $isRedirect = false ) {
                global $wgContLang;
-               $titletext = $wgContLang->convertHtml( $title->getPrefixedText() );
                $this->articles[] = $isRedirect
                        ? '<span class="redirect-in-category">' .
                                $this->getSkin()->link(
                                        $title,
-                                       $titletext,
+                                       null,
                                        array(),
                                        array(),
                                        array( 'known', 'noclasses' )
                                ) . '</span>'
-                       : $this->getSkin()->makeSizeLinkObj( $pageLength, $title, $titletext );
+                       : $this->getSkin()->makeSizeLinkObj( $pageLength, $title );
                $this->articles_start_char[] = $wgContLang->convert( $wgContLang->firstChar( $sortkey ) );
        }
 
index 2fa867a..5fa9ed3 100644 (file)
@@ -2301,8 +2301,8 @@ class Language {
 
        /**
         * Perform output conversion on a string, and encode for safe HTML output.
-        * @param $text String
-        * @param $isTitle Bool -- wtf?
+        * @param $text String text to be converted
+        * @param $isTitle Bool whether this conversion is for the article title
         * @return string
         * @todo this should get integrated somewhere sane
         */