MediaWiki fundraising/REL1_35
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 $variant = $this->getPreferredVariant();
72 switch ( $variant ) {
73 case 'kk-arab':
74 case 'kk-cn':
75 $word = parent::convertGrammarKk_arab( $word, $case );
76 break;
77 case 'kk-latn':
78 case 'kk-tr':
79 $word = parent::convertGrammarKk_latn( $word, $case );
80 break;
81 case 'kk-cyrl':
82 case 'kk-kz':
83 case 'kk':
84 default:
85 $word = parent::convertGrammarKk_cyrl( $word, $case );
86 }
87
88 return $word;
89 }
90}
Kazakh (Қазақша)
class that handles Cyrillic, Latin and Arabic scripts for Kazakh right now it only distinguish kk_cyr...
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()