* @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() {
foreach ( $colContents as $char => $articles ) {
# Change space to non-breaking space to keep headers aligned
- $h3char = $char === ' ' ? ' ' : htmlspecialchars( $char );
+ $h3char = $char === ' ' ? "\u{00A0}" : htmlspecialchars( $char );
$ret .= '<div class="mw-category-group"><h3>' . $h3char;
$ret .= "</h3>\n";