24define(
'KK_C_UC',
'АӘБВГҒДЕЁЖЗИЙКҚЛМНҢОӨПРСТУҰҮФХҺЦЧШЩЪЫІЬЭЮЯ' ); # Kazakh Cyrillic uppercase
25define(
'KK_C_LC',
'аәбвгғдеёжзийкқлмнңоөпрстуұүфхһцчшщъыіьэюя' ); # Kazakh Cyrillic lowercase
26define(
'KK_L_UC',
'AÄBCÇDEÉFGĞHIİÏJKLMNÑOÖPQRSŞTUÜVWXYÝZ' ); # Kazakh Latin uppercase
27define(
'KK_L_LC',
'aäbcçdeéfgğhıiïjklmnñoöpqrsştuüvwxyýz' ); # Kazakh Latin lowercase
29define(
'H_HAMZA',
'ٴ' ); # U+0674 ARABIC LETTER HIGH HAMZA
49 $variantfallbacks = [],
51 parent::__construct( $langobj, $maincode,
52 $variants, $variantfallbacks, $flags );
83 $this->mTables[
'kk-kz']->merge( $this->mTables[
'kk-cyrl'] );
84 $this->mTables[
'kk-tr']->merge( $this->mTables[
'kk-latn'] );
85 $this->mTables[
'kk-cn']->merge( $this->mTables[
'kk-arab'] );
93 '/([АӘЕЁИОӨҰҮЭЮЯЪЬ])Е/u' =>
'$1YE',
94 '/([АӘЕЁИОӨҰҮЭЮЯЪЬ])е/ui' =>
'$1ye',
96 '/^Ё([' .
KK_C_UC .
']|$)/u' =>
'YO$1',
'/^Ё([' .
KK_C_LC .
']|$)/u' =>
'Yo$1',
97 '/^Ю([' .
KK_C_UC .
']|$)/u' =>
'YU$1',
'/^Ю([' .
KK_C_LC .
']|$)/u' =>
'Yu$1',
98 '/^Я([' .
KK_C_UC .
']|$)/u' =>
'YA$1',
'/^Я([' .
KK_C_LC .
']|$)/u' =>
'Ya$1',
99 '/^Щ([' .
KK_C_UC .
']|$)/u' =>
'ŞÇ$1',
'/^Щ([' .
KK_C_LC .
']|$)/u' =>
'Şç$1',
101 '/Ё/u' =>
'YO',
'/ё/u' =>
'yo',
102 '/Ю/u' =>
'YU',
'/ю/u' =>
'yu',
103 '/Я/u' =>
'YA',
'/я/u' =>
'ya',
104 '/Щ/u' =>
'ŞÇ',
'/щ/u' =>
'şç',
105 # # soft and hard signs
106 '/[ъЪ]/u' =>
'ʺ',
'/[ьЬ]/u' =>
'ʹ',
108 '/А/u' =>
'A',
'/а/u' =>
'a',
'/Ә/u' =>
'Ä',
'/ә/u' =>
'ä',
109 '/Б/u' =>
'B',
'/б/u' =>
'b',
'/В/u' =>
'V',
'/в/u' =>
'v',
110 '/Г/u' =>
'G',
'/г/u' =>
'g',
'/Ғ/u' =>
'Ğ',
'/ғ/u' =>
'ğ',
111 '/Д/u' =>
'D',
'/д/u' =>
'd',
'/Е/u' =>
'E',
'/е/u' =>
'e',
112 '/Ж/u' =>
'J',
'/ж/u' =>
'j',
'/З/u' =>
'Z',
'/з/u' =>
'z',
113 '/И/u' =>
'Ï',
'/и/u' =>
'ï',
'/Й/u' =>
'Ý',
'/й/u' =>
'ý',
114 '/К/u' =>
'K',
'/к/u' =>
'k',
'/Қ/u' =>
'Q',
'/қ/u' =>
'q',
115 '/Л/u' =>
'L',
'/л/u' =>
'l',
'/М/u' =>
'M',
'/м/u' =>
'm',
116 '/Н/u' =>
'N',
'/н/u' =>
'n',
'/Ң/u' =>
'Ñ',
'/ң/u' =>
'ñ',
117 '/О/u' =>
'O',
'/о/u' =>
'o',
'/Ө/u' =>
'Ö',
'/ө/u' =>
'ö',
118 '/П/u' =>
'P',
'/п/u' =>
'p',
'/Р/u' =>
'R',
'/р/u' =>
'r',
119 '/С/u' =>
'S',
'/с/u' =>
's',
'/Т/u' =>
'T',
'/т/u' =>
't',
120 '/У/u' =>
'W',
'/у/u' =>
'w',
'/Ұ/u' =>
'U',
'/ұ/u' =>
'u',
121 '/Ү/u' =>
'Ü',
'/ү/u' =>
'ü',
'/Ф/u' =>
'F',
'/ф/u' =>
'f',
122 '/Х/u' =>
'X',
'/х/u' =>
'x',
'/Һ/u' =>
'H',
'/һ/u' =>
'h',
123 '/Ц/u' =>
'C',
'/ц/u' =>
'c',
'/Ч/u' =>
'Ç',
'/ч/u' =>
'ç',
124 '/Ш/u' =>
'Ş',
'/ш/u' =>
'ş',
'/Ы/u' =>
'I',
'/ы/u' =>
'ı',
125 '/І/u' =>
'İ',
'/і/u' =>
'i',
'/Э/u' =>
'É',
'/э/u' =>
'é',
128 $this->mLatn2Cyrl = [
132 '/ŞÇʹ/u' =>
'ЩЬ',
'/Şçʹ/u' =>
'Щь',
133 '/Ş[Çç]/u' =>
'Щ',
'/şç/u' =>
'щ',
134 # # soft and hard signs
136 '/ʺ([' .
KK_L_LC .
'])/u' =>
'ъ$1',
138 '/ʹ([' .
KK_L_LC .
'])/u' =>
'ь$1',
142 '/Y[Ee]/u' =>
'Е',
'/ye/u' =>
'е',
143 '/Y[Oo]/u' =>
'Ё',
'/yo/u' =>
'ё',
144 '/Y[UWuw]/u' =>
'Ю',
'/y[uw]/u' =>
'ю',
145 '/Y[Aa]/u' =>
'Я',
'/ya/u' =>
'я',
147 '/A/u' =>
'А',
'/a/u' =>
'а',
'/Ä/u' =>
'Ә',
'/ä/u' =>
'ә',
148 '/B/u' =>
'Б',
'/b/u' =>
'б',
'/C/u' =>
'Ц',
'/c/u' =>
'ц',
149 '/Ç/u' =>
'Ч',
'/ç/u' =>
'ч',
'/D/u' =>
'Д',
'/d/u' =>
'д',
150 '/E/u' =>
'Е',
'/e/u' =>
'е',
'/É/u' =>
'Э',
'/é/u' =>
'э',
151 '/F/u' =>
'Ф',
'/f/u' =>
'ф',
'/G/u' =>
'Г',
'/g/u' =>
'г',
152 '/Ğ/u' =>
'Ғ',
'/ğ/u' =>
'ғ',
'/H/u' =>
'Һ',
'/h/u' =>
'һ',
153 '/I/u' =>
'Ы',
'/ı/u' =>
'ы',
'/İ/u' =>
'І',
'/i/u' =>
'і',
154 '/Ï/u' =>
'И',
'/ï/u' =>
'и',
'/J/u' =>
'Ж',
'/j/u' =>
'ж',
155 '/K/u' =>
'К',
'/k/u' =>
'к',
'/L/u' =>
'Л',
'/l/u' =>
'л',
156 '/M/u' =>
'М',
'/m/u' =>
'м',
'/N/u' =>
'Н',
'/n/u' =>
'н',
157 '/Ñ/u' =>
'Ң',
'/ñ/u' =>
'ң',
'/O/u' =>
'О',
'/o/u' =>
'о',
158 '/Ö/u' =>
'Ө',
'/ö/u' =>
'ө',
'/P/u' =>
'П',
'/p/u' =>
'п',
159 '/Q/u' =>
'Қ',
'/q/u' =>
'қ',
'/R/u' =>
'Р',
'/r/u' =>
'р',
160 '/S/u' =>
'С',
'/s/u' =>
'с',
'/Ş/u' =>
'Ш',
'/ş/u' =>
'ш',
161 '/T/u' =>
'Т',
'/t/u' =>
'т',
'/U/u' =>
'Ұ',
'/u/u' =>
'ұ',
162 '/Ü/u' =>
'Ү',
'/ü/u' =>
'ү',
'/V/u' =>
'В',
'/v/u' =>
'в',
163 '/W/u' =>
'У',
'/w/u' =>
'у',
'/Ý/u' =>
'Й',
'/ý/u' =>
'й',
164 '/X/u' =>
'Х',
'/x/u' =>
'х',
'/Z/u' =>
'З',
'/z/u' =>
'з',
167 $this->mCyLa2Arab = [
168 # # Punctuation -> Arabic
169 '/#|№|No\./u' =>
'', # U+0600
170 '/\,/' =>
'،', # U+060C
171 '/;/' =>
'؛', # U+061B
172 '/\?/' =>
'؟', # U+061F
173 '/%/' =>
'٪', # U+066A
174 '/\*/' =>
'٭', # U+066D
176 '/0/' =>
'۰', # U+06F0
177 '/1/' =>
'۱', # U+06F1
178 '/2/' =>
'۲', # U+06F2
179 '/3/' =>
'۳', # U+06F3
180 '/4/' =>
'۴', # U+06F4
181 '/5/' =>
'۵', # U+06F5
182 '/6/' =>
'۶', # U+06F6
183 '/7/' =>
'۷', # U+06F7
184 '/8/' =>
'۸', # U+06F8
185 '/9/' =>
'۹', # U+06F9
186 # # Cyrillic -> Arabic
188 '/([АӘЕЁИОӨҰҮЭЮЯЪЬ])е/ui' =>
'$1يە',
189 '/[еэ]/ui' =>
'ە',
'/[ъь]/ui' =>
'',
190 '/[аә]/ui' =>
'ا',
'/[оө]/ui' =>
'و',
'/[ұү]/ui' =>
'ۇ',
'/[ыі]/ui' =>
'ى',
191 '/[и]/ui' =>
'ىي',
'/ё/ui' =>
'يو',
'/ю/ui' =>
'يۋ',
'/я/ui' =>
'يا',
'/[й]/ui' =>
'ي',
192 '/ц/ui' =>
'تس',
'/щ/ui' =>
'شش',
193 '/һ/ui' =>
'ح',
'/ч/ui' =>
'تش',
194 # '/һ/ui' => 'ھ', '/ч/ui' => 'چ',
195 '/б/ui' =>
'ب',
'/в/ui' =>
'ۆ',
'/г/ui' =>
'گ',
'/ғ/ui' =>
'ع',
196 '/д/ui' =>
'د',
'/ж/ui' =>
'ج',
'/з/ui' =>
'ز',
'/к/ui' =>
'ك',
197 '/қ/ui' =>
'ق',
'/л/ui' =>
'ل',
'/м/ui' =>
'م',
'/н/ui' =>
'ن',
198 '/ң/ui' =>
'ڭ',
'/п/ui' =>
'پ',
'/р/ui' =>
'ر',
'/с/ui' =>
'س',
199 '/т/ui' =>
'ت',
'/у/ui' =>
'ۋ',
'/ф/ui' =>
'ف',
'/х/ui' =>
'ح',
230 if ( is_object( $nt ) ) {
231 $ns = $nt->getNamespace();
238 parent::findVariantLink(
$link, $nt, $ignoreOtherCond );
253 $text = parent::translate( $text, $toVariant );
255 switch ( $toVariant ) {
272 $varsfix =
'\$[0-9]';
275 '/' . $varsfix .
'[^' . $letters .
']+/u',
278 PREG_SPLIT_OFFSET_CAPTURE
285 $ret .= substr( $text, $mstart, $m[1] - $mstart );
287 $mstart = $m[1] + strlen( $m[0] );
303 switch ( $toVariant ) {
308 $excludes =
'еэгғкқЕЭГҒКҚ';
310 $matches = preg_split(
'/[\b\s\-\.:]+/', $text, -1, PREG_SPLIT_OFFSET_CAPTURE );
314 $ret .= substr( $text, $mstart, $m[1] - $mstart );
318 if ( preg_match(
'/[' . $front .
']/u', $m[0] )
319 && !preg_match(
'/[' . $excludes .
']/u', $m[0] )
321 $ret .= preg_replace(
'/[' . $letters .
']+/u',
H_HAMZA .
'$0', $m[0] );
325 $mstart = $m[1] + strlen( $m[0] );
328 foreach ( $this->mCyLa2Arab
as $pat => $rep ) {
329 $text = preg_replace( $pat, $rep, $text );
334 foreach ( $this->mCyrl2Latn
as $pat => $rep ) {
335 $text = preg_replace( $pat, $rep, $text );
340 foreach ( $this->mLatn2Cyrl
as $pat => $rep ) {
341 $text = preg_replace( $pat, $rep, $text );
366 parent::__construct();
368 $variants = [
'kk',
'kk-cyrl',
'kk-latn',
'kk-arab',
'kk-kz',
'kk-tr',
'kk-cn' ];
369 $variantfallbacks = [
374 'kk-kz' =>
'kk-cyrl',
375 'kk-tr' =>
'kk-latn',
379 $this->mConverter =
new KkConverter( $this,
'kk', $variants, $variantfallbacks );
390 if ( substr( $string, 0, 1 ) ===
'i' ) {
392 if ( $variant ==
'kk-latn' || $variant ==
'kk-tr' ) {
393 return 'İ' . substr( $string, 1 );
396 return parent::ucfirst( $string );
407 if ( substr( $string, 0, 1 ) ===
'I' ) {
409 if ( $variant ==
'kk-latn' || $variant ==
'kk-tr' ) {
410 return 'ı' . substr( $string, 1 );
413 return parent::lcfirst( $string );
423 switch ( $variant ) {
426 $word = parent::convertGrammarKk_arab( $word, $case );
430 $word = parent::convertGrammarKk_latn( $word, $case );
436 $word = parent::convertGrammarKk_cyrl( $word, $case );
Kazakh (Қазақша) converter routines.
convertCategoryKey( $key)
postLoadTables()
Hook for post processing after conversion tables are loaded.
loadDefaultTables()
Load default conversion tables.
regsConverter( $text, $toVariant)
translate( $text, $toVariant)
It translates text into variant.
__construct(Language $langobj, $maincode, $variants=[], $variantfallbacks=[], $flags=[])
findVariantLink(&$link, &$nt, $ignoreOtherCond=false)
A function wrapper:
Base class for language conversion.
getPreferredVariant()
Get preferred language variant.
autoConvert( $text, $toVariant=false)
Dictionary-based conversion.
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 'İ'.
Internationalisation code.
Wrapper around strtr() that holds replacements.
This document is intended to provide useful advice for parties seeking to redistribute MediaWiki to end users It s targeted particularly at maintainers for Linux since it s been observed that distribution packages of MediaWiki often break We ve consistently had to recommend that users seeking support use official tarballs instead of their distribution s and this often solves whatever problem the user is having It would be nice if this could such as
null means default in associative array with keys and values unescaped Should be merged with default with a value of false meaning to suppress the attribute in associative array with keys and values unescaped noclasses & $ret
usually copyright or history_copyright This message must be in HTML not wikitext & $link
injection txt This is an overview of how MediaWiki makes use of dependency injection The design described here grew from the discussion of RFC T384 The term dependency this means that anything an object needs to operate should be injected from the the object itself should only know narrow no concrete implementation of the logic it relies on The requirement to inject everything typically results in an architecture that based on two main types of and essentially stateless service objects that use other service objects to operate on the value objects As of the beginning MediaWiki is only starting to use the DI approach Much of the code still relies on global state or direct resulting in a highly cyclical dependency which acts as the top level factory for services in MediaWiki which can be used to gain access to default instances of various services MediaWikiServices however also allows new services to be defined and default services to be redefined Services are defined or redefined by providing a callback the instantiator that will return a new instance of the service When it will create an instance of MediaWikiServices and populate it with the services defined in the files listed by thereby bootstrapping the DI framework Per $wgServiceWiringFiles lists includes ServiceWiring php