38 if ( !self::$instance ) {
42 return self::$instance;
51 public static function factory( $collationName ) {
52 switch ( $collationName ) {
57 MediaWikiServices::getInstance()->getContentLanguage() );
62 case 'uca-default-u-kn':
72 if ( preg_match(
'/^uca-([A-Za-z@=-]+)$/', $collationName, $match ) ) {
76 # Provide a mechanism for extensions to hook in.
77 $collationObject =
null;
78 Hooks::runner()->onCollation__factory( $collationName, $collationObject );
80 if ( $collationObject instanceof
self ) {
81 return $collationObject;
85 throw new MWException( __METHOD__ .
": unknown collation type \"$collationName\"" );
$wgCategoryCollation
Specify how category names should be sorted, when listed on a category page.
Workaround for the lack of support of Sorani Kurdish / Central Kurdish language ('ckb') in ICU.
getSortKey( $string)
Given a string, convert it to a (hopefully short) key that can be used for efficient sorting.
getFirstLetter( $string)
Given a string, return the logical "first letter" to be used for grouping on category pages and so on...
static factory( $collationName)
Collation class that's essentially a no-op.
Collation that orders text with numbers "naturally", so that 'Foo 1' < 'Foo 2' < 'Foo 12'.