Index: trunk/phase3/languages/classes/LanguageTr.php |
— | — | @@ -17,7 +17,7 @@ |
18 | 18 | * @return string |
19 | 19 | */ |
20 | 20 | function ucfirst ( $string ) { |
21 | | - if ( !empty( $string ) && $string[0] == 'i' ) { |
| 21 | + if ( strlen( $string ) && $string[0] == 'i' ) { |
22 | 22 | return 'İ' . substr( $string, 1 ); |
23 | 23 | } else { |
24 | 24 | return parent::ucfirst( $string ); |
— | — | @@ -29,7 +29,7 @@ |
30 | 30 | * @return mixed|string |
31 | 31 | */ |
32 | 32 | function lcfirst ( $string ) { |
33 | | - if ( !empty( $string ) && $string[0] == 'I' ) { |
| 33 | + if ( strlen( $string ) && $string[0] == 'I' ) { |
34 | 34 | return 'ı' . substr( $string, 1 ); |
35 | 35 | } else { |
36 | 36 | return parent::lcfirst( $string ); |
— | — | @@ -45,7 +45,15 @@ |
46 | 46 | * @return string |
47 | 47 | */ |
48 | 48 | function uc( $string, $first = false ) { |
49 | | - $string = preg_replace( '/i/', 'İ', $string ); |
| 49 | + if ( strlen( $string ) ) { |
| 50 | + if ( $first ) { |
| 51 | + if ( $string[0] === 'i' ) { |
| 52 | + $string = 'İ' . substr( $string, 1 ); |
| 53 | + } |
| 54 | + } else { |
| 55 | + $string = str_replace( 'i', 'İ', $string ); |
| 56 | + } |
| 57 | + } |
50 | 58 | return parent::uc( $string, $first ); |
51 | 59 | } |
52 | 60 | |
— | — | @@ -58,7 +66,15 @@ |
59 | 67 | * @return string |
60 | 68 | */ |
61 | 69 | function lc( $string, $first = false ) { |
62 | | - $string = preg_replace( '/I/', 'ı', $string ); |
| 70 | + if ( strlen( $string ) ) { |
| 71 | + if ( $first ) { |
| 72 | + if ( $string[0] == 'I' ) { |
| 73 | + $string = 'ı' . substr( $string, 1 ); |
| 74 | + } |
| 75 | + } else { |
| 76 | + $string = str_replace( 'I', 'ı', $string ); |
| 77 | + } |
| 78 | + } |
63 | 79 | return parent::lc( $string, $first ); |
64 | 80 | } |
65 | 81 | |