* @return string
*/
function getSubcategorySortChar( $title, $sortkey ) {
- global $wgContLang;
-
if ( $title->getPrefixedText() == $sortkey ) {
$word = $title->getDBkey();
} else {
$firstChar = $this->collation->getFirstLetter( $word );
- return $wgContLang->convert( $firstChar );
+ return MediaWikiServices::getInstance()->getContentLanguage()->convert( $firstChar );
}
/**
* @param bool $isRedirect
*/
function addImage( Title $title, $sortkey, $pageLength, $isRedirect = false ) {
- global $wgContLang;
if ( $this->showGallery ) {
$flip = $this->flip['file'];
if ( $flip ) {
} else {
$this->imgsNoGallery[] = $this->generateLink( 'image', $title, $isRedirect );
- $this->imgsNoGallery_start_char[] = $wgContLang->convert(
- $this->collation->getFirstLetter( $sortkey ) );
+ $this->imgsNoGallery_start_char[] = MediaWikiServices::getInstance()->
+ getContentLanguage()->convert( $this->collation->getFirstLetter( $sortkey ) );
}
}
* @param bool $isRedirect
*/
function addPage( $title, $sortkey, $pageLength, $isRedirect = false ) {
- global $wgContLang;
-
$this->articles[] = $this->generateLink( 'page', $title, $isRedirect );
- $this->articles_start_char[] = $wgContLang->convert(
- $this->collation->getFirstLetter( $sortkey ) );
+ $this->articles_start_char[] = MediaWikiServices::getInstance()->
+ getContentLanguage()->convert( $this->collation->getFirstLetter( $sortkey ) );
}
function finaliseCategoryState() {
* @return string
*/
function getPagesSection() {
- $ti = wfEscapeWikiText( $this->title->getText() );
+ $name = $this->getOutput()->getUnprefixedDisplayTitle();
# Don't show articles section if there are none.
$r = '';
if ( $rescnt > 0 ) {
$r = "<div id=\"mw-pages\">\n";
- $r .= '<h2>' . $this->msg( 'category_header', $ti )->parse() . "</h2>\n";
+ $r .= '<h2>' . $this->msg( 'category_header' )->rawParams( $name )->parse() . "</h2>\n";
$r .= $countmsg;
$r .= $this->getSectionPagingLinks( 'page' );
$r .= $this->formatList( $this->articles, $this->articles_start_char );
* @return string
*/
function getImageSection() {
+ $name = $this->getOutput()->getUnprefixedDisplayTitle();
$r = '';
$rescnt = $this->showGallery ? $this->gallery->count() : count( $this->imgsNoGallery );
$dbcnt = $this->cat->getFileCount();
if ( $rescnt > 0 ) {
$r .= "<div id=\"mw-category-media\">\n";
$r .= '<h2>' .
- $this->msg(
- 'category-media-header',
- wfEscapeWikiText( $this->title->getText() )
- )->text() .
+ $this->msg( 'category-media-header' )->rawParams( $name )->parse() .
"</h2>\n";
$r .= $countmsg;
$r .= $this->getSectionPagingLinks( 'file' );