24 define(
'KK_C_UC',
'АӘБВГҒДЕЁЖЗИЙКҚЛМНҢОӨПРСТУҰҮФХҺЦЧШЩЪЫІЬЭЮЯ' ); # Kazakh Cyrillic uppercase
25 define(
'KK_C_LC',
'аәбвгғдеёжзийкқлмнңоөпрстуұүфхһцчшщъыіьэюя' ); # Kazakh Cyrillic lowercase
26 define(
'KK_L_UC',
'AÄBCÇDEÉFGĞHIİÏJKLMNÑOÖPQRSŞTUÜVWXYÝZ' ); # Kazakh Latin uppercase
27 define(
'KK_L_LC',
'aäbcçdeéfgğhıiïjklmnñoöpqrsştuüvwxyýz' ); # Kazakh Latin lowercase
29 define(
'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'] );
94 '/([АӘЕЁИОӨҰҮЭЮЯЪЬ])Е/u' =>
'$1YE',
95 '/([АӘЕЁИОӨҰҮЭЮЯЪЬ])е/ui' =>
'$1ye',
97 '/^Ё([' .
KK_C_UC .
']|$)/u' =>
'YO$1',
'/^Ё([' .
KK_C_LC .
']|$)/u' =>
'Yo$1',
98 '/^Ю([' .
KK_C_UC .
']|$)/u' =>
'YU$1',
'/^Ю([' .
KK_C_LC .
']|$)/u' =>
'Yu$1',
99 '/^Я([' .
KK_C_UC .
']|$)/u' =>
'YA$1',
'/^Я([' .
KK_C_LC .
']|$)/u' =>
'Ya$1',
100 '/^Щ([' .
KK_C_UC .
']|$)/u' =>
'ŞÇ$1',
'/^Щ([' .
KK_C_LC .
']|$)/u' =>
'Şç$1',
102 '/Ё/u' =>
'YO',
'/ё/u' =>
'yo',
103 '/Ю/u' =>
'YU',
'/ю/u' =>
'yu',
104 '/Я/u' =>
'YA',
'/я/u' =>
'ya',
105 '/Щ/u' =>
'ŞÇ',
'/щ/u' =>
'şç',
106 # # soft and hard signs
107 '/[ъЪ]/u' =>
'ʺ',
'/[ьЬ]/u' =>
'ʹ',
109 '/А/u' =>
'A',
'/а/u' =>
'a',
'/Ә/u' =>
'Ä',
'/ә/u' =>
'ä',
110 '/Б/u' =>
'B',
'/б/u' =>
'b',
'/В/u' =>
'V',
'/в/u' =>
'v',
111 '/Г/u' =>
'G',
'/г/u' =>
'g',
'/Ғ/u' =>
'Ğ',
'/ғ/u' =>
'ğ',
112 '/Д/u' =>
'D',
'/д/u' =>
'd',
'/Е/u' =>
'E',
'/е/u' =>
'e',
113 '/Ж/u' =>
'J',
'/ж/u' =>
'j',
'/З/u' =>
'Z',
'/з/u' =>
'z',
114 '/И/u' =>
'Ï',
'/и/u' =>
'ï',
'/Й/u' =>
'Ý',
'/й/u' =>
'ý',
115 '/К/u' =>
'K',
'/к/u' =>
'k',
'/Қ/u' =>
'Q',
'/қ/u' =>
'q',
116 '/Л/u' =>
'L',
'/л/u' =>
'l',
'/М/u' =>
'M',
'/м/u' =>
'm',
117 '/Н/u' =>
'N',
'/н/u' =>
'n',
'/Ң/u' =>
'Ñ',
'/ң/u' =>
'ñ',
118 '/О/u' =>
'O',
'/о/u' =>
'o',
'/Ө/u' =>
'Ö',
'/ө/u' =>
'ö',
119 '/П/u' =>
'P',
'/п/u' =>
'p',
'/Р/u' =>
'R',
'/р/u' =>
'r',
120 '/С/u' =>
'S',
'/с/u' =>
's',
'/Т/u' =>
'T',
'/т/u' =>
't',
121 '/У/u' =>
'W',
'/у/u' =>
'w',
'/Ұ/u' =>
'U',
'/ұ/u' =>
'u',
122 '/Ү/u' =>
'Ü',
'/ү/u' =>
'ü',
'/Ф/u' =>
'F',
'/ф/u' =>
'f',
123 '/Х/u' =>
'X',
'/х/u' =>
'x',
'/Һ/u' =>
'H',
'/һ/u' =>
'h',
124 '/Ц/u' =>
'C',
'/ц/u' =>
'c',
'/Ч/u' =>
'Ç',
'/ч/u' =>
'ç',
125 '/Ш/u' =>
'Ş',
'/ш/u' =>
'ş',
'/Ы/u' =>
'I',
'/ы/u' =>
'ı',
126 '/І/u' =>
'İ',
'/і/u' =>
'i',
'/Э/u' =>
'É',
'/э/u' =>
'é',
129 $this->mLatn2Cyrl = [
133 '/ŞÇʹ/u' =>
'ЩЬ',
'/Şçʹ/u' =>
'Щь',
134 '/Ş[Çç]/u' =>
'Щ',
'/şç/u' =>
'щ',
135 # # soft and hard signs
137 '/ʺ([' .
KK_L_LC .
'])/u' =>
'ъ$1',
139 '/ʹ([' .
KK_L_LC .
'])/u' =>
'ь$1',
143 '/Y[Ee]/u' =>
'Е',
'/ye/u' =>
'е',
144 '/Y[Oo]/u' =>
'Ё',
'/yo/u' =>
'ё',
145 '/Y[UWuw]/u' =>
'Ю',
'/y[uw]/u' =>
'ю',
146 '/Y[Aa]/u' =>
'Я',
'/ya/u' =>
'я',
148 '/A/u' =>
'А',
'/a/u' =>
'а',
'/Ä/u' =>
'Ә',
'/ä/u' =>
'ә',
149 '/B/u' =>
'Б',
'/b/u' =>
'б',
'/C/u' =>
'Ц',
'/c/u' =>
'ц',
150 '/Ç/u' =>
'Ч',
'/ç/u' =>
'ч',
'/D/u' =>
'Д',
'/d/u' =>
'д',
151 '/E/u' =>
'Е',
'/e/u' =>
'е',
'/É/u' =>
'Э',
'/é/u' =>
'э',
152 '/F/u' =>
'Ф',
'/f/u' =>
'ф',
'/G/u' =>
'Г',
'/g/u' =>
'г',
153 '/Ğ/u' =>
'Ғ',
'/ğ/u' =>
'ғ',
'/H/u' =>
'Һ',
'/h/u' =>
'һ',
154 '/I/u' =>
'Ы',
'/ı/u' =>
'ы',
'/İ/u' =>
'І',
'/i/u' =>
'і',
155 '/Ï/u' =>
'И',
'/ï/u' =>
'и',
'/J/u' =>
'Ж',
'/j/u' =>
'ж',
156 '/K/u' =>
'К',
'/k/u' =>
'к',
'/L/u' =>
'Л',
'/l/u' =>
'л',
157 '/M/u' =>
'М',
'/m/u' =>
'м',
'/N/u' =>
'Н',
'/n/u' =>
'н',
158 '/Ñ/u' =>
'Ң',
'/ñ/u' =>
'ң',
'/O/u' =>
'О',
'/o/u' =>
'о',
159 '/Ö/u' =>
'Ө',
'/ö/u' =>
'ө',
'/P/u' =>
'П',
'/p/u' =>
'п',
160 '/Q/u' =>
'Қ',
'/q/u' =>
'қ',
'/R/u' =>
'Р',
'/r/u' =>
'р',
161 '/S/u' =>
'С',
'/s/u' =>
'с',
'/Ş/u' =>
'Ш',
'/ş/u' =>
'ш',
162 '/T/u' =>
'Т',
'/t/u' =>
'т',
'/U/u' =>
'Ұ',
'/u/u' =>
'ұ',
163 '/Ü/u' =>
'Ү',
'/ü/u' =>
'ү',
'/V/u' =>
'В',
'/v/u' =>
'в',
164 '/W/u' =>
'У',
'/w/u' =>
'у',
'/Ý/u' =>
'Й',
'/ý/u' =>
'й',
165 '/X/u' =>
'Х',
'/x/u' =>
'х',
'/Z/u' =>
'З',
'/z/u' =>
'з',
168 $this->mCyLa2Arab = [
169 # # Punctuation -> Arabic
170 '/#|№|No\./u' =>
'', # ؀
171 '/\,/' =>
'،', # ،
172 '/;/' =>
'؛', # ؛
173 '/\?/' =>
'؟', # ؟
174 '/%/' =>
'٪', # ٪
175 '/\*/' =>
'٭', # ٭
177 '/0/' =>
'۰', # ۰
178 '/1/' =>
'۱', # ۱
179 '/2/' =>
'۲', # ۲
180 '/3/' =>
'۳', # ۳
181 '/4/' =>
'۴', # ۴
182 '/5/' =>
'۵', # ۵
183 '/6/' =>
'۶', # ۶
184 '/7/' =>
'۷', # ۷
185 '/8/' =>
'۸', # ۸
186 '/9/' =>
'۹', # ۹
187 # # Cyrillic -> Arabic
189 '/([АӘЕЁИОӨҰҮЭЮЯЪЬ])е/ui' =>
'$1يە',
190 '/[еэ]/ui' =>
'ە',
'/[ъь]/ui' =>
'',
191 '/[аә]/ui' =>
'ا',
'/[оө]/ui' =>
'و',
'/[ұү]/ui' =>
'ۇ',
'/[ыі]/ui' =>
'ى',
192 '/[и]/ui' =>
'ىي',
'/ё/ui' =>
'يو',
'/ю/ui' =>
'يۋ',
'/я/ui' =>
'يا',
'/[й]/ui' =>
'ي',
193 '/ц/ui' =>
'تس',
'/щ/ui' =>
'شش',
194 '/һ/ui' =>
'ح',
'/ч/ui' =>
'تش',
195 # '/һ/ui' => 'ھ', '/ч/ui' => 'چ',
196 '/б/ui' =>
'ب',
'/в/ui' =>
'ۆ',
'/г/ui' =>
'گ',
'/ғ/ui' =>
'ع',
197 '/д/ui' =>
'د',
'/ж/ui' =>
'ج',
'/з/ui' =>
'ز',
'/к/ui' =>
'ك',
198 '/қ/ui' =>
'ق',
'/л/ui' =>
'ل',
'/м/ui' =>
'م',
'/н/ui' =>
'ن',
199 '/ң/ui' =>
'ڭ',
'/п/ui' =>
'پ',
'/р/ui' =>
'ر',
'/с/ui' =>
'س',
200 '/т/ui' =>
'ت',
'/у/ui' =>
'ۋ',
'/ф/ui' =>
'ف',
'/х/ui' =>
'ح',
202 # # Latin -> Arabic // commented for now...
231 if ( in_array(
'T',
$flags ) ) {
232 return parent::parseManualRule( $rule,
$flags );
237 foreach ( $this->mVariants
as $v ) {
256 if ( is_object( $nt ) ) {
257 $ns = $nt->getNamespace();
264 parent::findVariantLink(
$link, $nt, $ignoreOtherCond );
281 switch ( $toVariant ) {
298 $varsfix =
'\$[0-9]';
301 '/' . $varsfix .
'[^' . $letters .
']+/u',
304 PREG_SPLIT_OFFSET_CAPTURE
311 $ret .= substr( $text, $mstart, $m[1] -$mstart );
313 $mstart = $m[1] + strlen( $m[0] );
329 switch ( $toVariant ) {
334 $excludes =
'еэгғкқЕЭГҒКҚ';
336 $matches = preg_split(
'/[\b\s\-\.:]+/', $text, -1, PREG_SPLIT_OFFSET_CAPTURE );
340 $ret .= substr( $text, $mstart, $m[1] - $mstart );
344 if ( preg_match(
'/[' . $front .
']/u', $m[0] )
345 && !preg_match(
'/[' . $excludes .
']/u', $m[0] )
347 $ret .= preg_replace(
'/[' . $letters .
']+/u',
H_HAMZA .
'$0', $m[0] );
351 $mstart = $m[1] + strlen( $m[0] );
354 foreach ( $this->mCyLa2Arab
as $pat => $rep ) {
355 $text = preg_replace( $pat, $rep, $text );
361 foreach ( $this->mCyrl2Latn
as $pat => $rep ) {
362 $text = preg_replace( $pat, $rep, $text );
368 foreach ( $this->mLatn2Cyrl
as $pat => $rep ) {
369 $text = preg_replace( $pat, $rep, $text );
395 parent::__construct();
397 $variants = [
'kk',
'kk-cyrl',
'kk-latn',
'kk-arab',
'kk-kz',
'kk-tr',
'kk-cn' ];
398 $variantfallbacks = [
403 'kk-kz' =>
'kk-cyrl',
404 'kk-tr' =>
'kk-latn',
408 $this->mConverter =
new KkConverter( $this,
'kk', $variants, $variantfallbacks );
419 if ( $string[0] ==
'i' ) {
421 if ( $variant ==
'kk-latn' || $variant ==
'kk-tr' ) {
422 return 'İ' . substr( $string, 1 );
425 return parent::ucfirst( $string );
436 if ( $string[0] ==
'I' ) {
438 if ( $variant ==
'kk-latn' || $variant ==
'kk-tr' ) {
439 return 'ı' . substr( $string, 1 );
442 return parent::lcfirst( $string );
453 switch ( $variant ) {
456 $word = parent::convertGrammarKk_arab( $word, $case );
460 $word = parent::convertGrammarKk_latn( $word, $case );
466 $word = parent::convertGrammarKk_cyrl( $word, $case );
Wrapper around strtr() that holds replacements.
parseManualRule($rule, $flags=[])
rules should be defined as -{ekavian | iyekavian-} -or- -{code:text | code:text | ...
translate($text, $toVariant)
It translates text into variant.
class that handles Cyrillic, Latin and Arabic scripts for Kazakh right now it only distinguish kk_cyr...
it s the revision text itself In either if gzip is the revision text is gzipped $flags
Base class for language conversion.
lcfirst($string)
It fixes issue with lcfirst for transforming 'I' to 'ı'.
the value to return A Title object or null for latest to be modified or replaced by the hook handler or if authentication is not possible after cache objects are set for highlighting & $link
findVariantLink(&$link, &$nt, $ignoreOtherCond=false)
A function wrapper:
Kazakh (Қазақша) converter routines.
ucfirst($string)
It fixes issue with ucfirst for transforming 'i' to 'İ'.
regsConverter($text, $toVariant)
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
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
__construct($langobj, $maincode, $variants=[], $variantfallbacks=[], $flags=[])
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
autoConvert($text, $toVariant=false)
Dictionary-based conversion.
getPreferredVariant()
Get preferred language variant.
convertGrammar($word, $case)