MediaWiki master
LanguageTr.php
Go to the documentation of this file.
1<?php
7namespace MediaWiki\Languages;
8
10
28class LanguageTr extends Language {
29
30 private const UC = [ 'I', 'İ' ];
31 private const LC = [ 'ı', 'i' ];
32
34 public function ucfirst( $str ) {
35 $first = mb_substr( $str, 0, 1 );
36 if ( in_array( $first, self::LC ) ) {
37 $first = str_replace( self::LC, self::UC, $first );
38 return $first . mb_substr( $str, 1 );
39 }
40 return parent::ucfirst( $str );
41 }
42
44 public function lcfirst( $str ) {
45 $first = mb_substr( $str, 0, 1 );
46 if ( in_array( $first, self::UC ) ) {
47 $first = str_replace( self::UC, self::LC, $first );
48 return $first . mb_substr( $str, 1 );
49 }
50 return parent::lcfirst( $str );
51 }
52
53}
54
56class_alias( LanguageTr::class, 'LanguageTr' );
Base class for language-specific code.
Definition Language.php:68
lcfirst( $str)
string The string with lowercase conversion applied to the first character
ucfirst( $str)
string The string with uppercase conversion applied to the first character