MediaWiki  master
LanguageKk.php
Go to the documentation of this file.
1 <?php
30 class LanguageKk extends LanguageKk_cyrl {
36  public function ucfirst( $str ) {
37  if ( substr( $str, 0, 1 ) === 'i' ) {
38  $variant = $this->getConverterInternal()->getPreferredVariant();
39  if ( $variant == 'kk-latn' || $variant == 'kk-tr' ) {
40  return 'İ' . substr( $str, 1 );
41  }
42  }
43  return parent::ucfirst( $str );
44  }
45 
51  public function lcfirst( $str ) {
52  if ( substr( $str, 0, 1 ) === 'I' ) {
53  $variant = $this->getConverterInternal()->getPreferredVariant();
54  if ( $variant == 'kk-latn' || $variant == 'kk-tr' ) {
55  return 'ı' . substr( $str, 1 );
56  }
57  }
58  return parent::lcfirst( $str );
59  }
60 
61  public function convertGrammar( $word, $case ) {
62  // T277689: If there's no word, then there's nothing to convert.
63  if ( $word === '' ) {
64  return '';
65  }
66 
67  $variant = $this->getConverterInternal()->getPreferredVariant();
68  switch ( $variant ) {
69  case 'kk-arab':
70  case 'kk-cn':
71  $word = parent::convertGrammarKk_arab( $word, $case );
72  break;
73  case 'kk-latn':
74  case 'kk-tr':
75  $word = parent::convertGrammarKk_latn( $word, $case );
76  break;
77  case 'kk-cyrl':
78  case 'kk-kz':
79  case 'kk':
80  default:
81  $word = parent::convertGrammarKk_cyrl( $word, $case );
82  }
83 
84  return $word;
85  }
86 }
Kazakh (Қазақша)
Kazakh (Қазақша) specific code.
Definition: LanguageKk.php:30
ucfirst( $str)
Fixes an issue with ucfirst for transforming 'i' to 'İ'.
Definition: LanguageKk.php:36
convertGrammar( $word, $case)
Grammatical transformations, needed for inflected languages Invoked by putting {{grammar:case|word}} ...
Definition: LanguageKk.php:61
lcfirst( $str)
Fixes issue with lcfirst for transforming 'I' to 'ı'.
Definition: LanguageKk.php:51
getConverterInternal()
Return the LanguageConverter for this language, convenience function for use in the language classes ...
Definition: Language.php:4422