MediaWiki master
UppercaseCollation.php
Go to the documentation of this file.
1<?php
25
27
31 private $lang;
32
33 public function __construct( LanguageFactory $languageFactory ) {
34 $this->lang = $languageFactory->getLanguage( 'en' );
35 }
36
37 public function getSortKey( $string ) {
38 return $this->lang->uc( $string );
39 }
40
41 public function getFirstLetter( $string ) {
42 if ( $string[0] == "\0" ) {
43 $string = substr( $string, 1 );
44 }
45 return $this->lang->ucfirst( $this->lang->firstChar( $string ) );
46 }
47
48}
Base class for language-specific code.
Definition Language.php:81
Internationalisation code See https://www.mediawiki.org/wiki/Special:MyLanguage/Localisation for more...
getLanguage( $code)
Get a cached or new language object for a given language code with normalization of the language code...
__construct(LanguageFactory $languageFactory)
getFirstLetter( $string)
Given a string, return the logical "first letter" to be used for grouping on category pages and so on...
getSortKey( $string)
Given a string, convert it to a (hopefully short) key that can be used for efficient sorting.