From: Philip Tzou Date: Sun, 26 Jul 2009 15:54:11 +0000 (+0000) Subject: Follow up on r46020 and r46489. Improve the $wgContLang->convert() calling procedure... X-Git-Tag: 1.31.0-rc.0~40709 X-Git-Url: https://git.cyclocoop.org/%28%28?a=commitdiff_plain;h=be0cb93759c3b32a2d56854639a8e1f33952760a;p=lhc%2Fweb%2Fwiklou.git Follow up on r46020 and r46489. Improve the $wgContLang->convert() calling procedure on CategoryPage. --- diff --git a/includes/CategoryPage.php b/includes/CategoryPage.php index 0a1d2170ef..362fbde97d 100644 --- a/includes/CategoryPage.php +++ b/includes/CategoryPage.php @@ -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 ? '' . $this->getSkin()->link( $title, - $titletext, + null, array(), array(), array( 'known', 'noclasses' ) ) . '' - : $this->getSkin()->makeSizeLinkObj( $pageLength, $title, $titletext ); + : $this->getSkin()->makeSizeLinkObj( $pageLength, $title ); $this->articles_start_char[] = $wgContLang->convert( $wgContLang->firstChar( $sortkey ) ); } diff --git a/languages/Language.php b/languages/Language.php index 2fa867a404..5fa9ed3dcb 100644 --- a/languages/Language.php +++ b/languages/Language.php @@ -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 */