MediaWiki REL1_31
CollationEt.php
Go to the documentation of this file.
1<?php
32 public function __construct() {
33 parent::__construct( 'et' );
34 }
35
36 private static function mangle( $string ) {
37 return str_replace(
38 [ 'w', 'W' ],
39 'ᴡ', // U+1D21 'LATIN LETTER SMALL CAPITAL W'
40 $string
41 );
42 }
43
44 private static function unmangle( $string ) {
45 // Casing data is lost…
46 return str_replace(
47 'ᴡ', // U+1D21 'LATIN LETTER SMALL CAPITAL W'
48 'W',
49 $string
50 );
51 }
52
53 public function getSortKey( $string ) {
54 return parent::getSortKey( self::mangle( $string ) );
55 }
56
57 public function getFirstLetter( $string ) {
58 return self::unmangle( parent::getFirstLetter( self::mangle( $string ) ) );
59 }
60}
Workaround for incorrect collation of Estonian language ('et') in ICU (T56168).
static unmangle( $string)
getFirstLetter( $string)
Given a string, return the logical "first letter" to be used for grouping on category pages and so on...
static mangle( $string)
getSortKey( $string)
Given a string, convert it to a (hopefully short) key that can be used for efficient sorting.