MediaWiki REL1_39
LanguageKk.php
Go to the documentation of this file.
1<?php
38 public function ucfirst( $string ) {
39 if ( substr( $string, 0, 1 ) === 'i' ) {
40 $variant = $this->getPreferredVariant();
41 if ( $variant == 'kk-latn' || $variant == 'kk-tr' ) {
42 return 'İ' . substr( $string, 1 );
43 }
44 }
45 return parent::ucfirst( $string );
46 }
47
55 public function lcfirst( $string ) {
56 if ( substr( $string, 0, 1 ) === 'I' ) {
57 $variant = $this->getPreferredVariant();
58 if ( $variant == 'kk-latn' || $variant == 'kk-tr' ) {
59 return 'ı' . substr( $string, 1 );
60 }
61 }
62 return parent::lcfirst( $string );
63 }
64
70 public function convertGrammar( $word, $case ) {
71 // T277689: If there's no word, then there's nothing to convert.
72 if ( $word === '' ) {
73 return '';
74 }
75
76 $variant = $this->getPreferredVariant();
77 switch ( $variant ) {
78 case 'kk-arab':
79 case 'kk-cn':
80 $word = parent::convertGrammarKk_arab( $word, $case );
81 break;
82 case 'kk-latn':
83 case 'kk-tr':
84 $word = parent::convertGrammarKk_latn( $word, $case );
85 break;
86 case 'kk-cyrl':
87 case 'kk-kz':
88 case 'kk':
89 default:
90 $word = parent::convertGrammarKk_cyrl( $word, $case );
91 }
92
93 return $word;
94 }
95}
Kazakh (Қазақша)
Kazakh (Қазақша) specific code.
convertGrammar( $word, $case)
lcfirst( $string)
It fixes issue with lcfirst for transforming 'I' to 'ı'.
ucfirst( $string)
It fixes issue with ucfirst for transforming 'i' to 'İ'.
getPreferredVariant()