r28589 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r28588‎ | r28589 | r28590 >
Date:15:31, 17 December 2007
Author:raymond
Status:old
Tags:
Comment:
* (bug 12145) Update Kazakh translations
Patch by AlefZet
Modified paths:
  • /trunk/phase3/languages/LanguageConverter.php (modified) (history)
  • /trunk/phase3/languages/classes/LanguageKk.php (modified) (history)
  • /trunk/phase3/languages/messages/MessagesKk.php (modified) (history)
  • /trunk/phase3/languages/messages/MessagesKk_arab.php (modified) (history)
  • /trunk/phase3/languages/messages/MessagesKk_cyrl.php (modified) (history)
  • /trunk/phase3/languages/messages/MessagesKk_latn.php (modified) (history)

Diff [purge]

Index: trunk/phase3/languages/LanguageConverter.php
@@ -21,7 +21,7 @@
2222 var $mFlags;
2323 var $mUcfirst = false;
2424
25 - const CACHE_VERSION_KEY = 'VERSION 4';
 25+ const CACHE_VERSION_KEY = 'VERSION 5';
2626
2727 /**
2828 * Constructor
@@ -811,5 +811,3 @@
812812
813813
814814 }
815 -
816 -
Index: trunk/phase3/languages/messages/MessagesKk.php
@@ -15,80 +15,11 @@
1616 'linkprefix' => '/^(.*?)([a-zäçéğıïñöşüýа-яёәіңғүұқөһA-ZÄÇÉĞİÏÑÖŞÜÝА-ЯЁӘІҢҒҮҰҚӨҺاٵبۆگعدەجزيكقلمنڭوٶپرستۋۇٷفحھچشىٸʺʹ«„]+)$/sDu',
1717
1818 # Stylesheets
19 -'common.css' => ' /* Мындағы CSS барлық безендіру мәнеріндерде қолданылады */',
20 -'monobook.css' => ' /* Мындағы CSS «Дара кітап» (monobook) безендіру мәнерін пайдаланушыларға ықпал етеді */',
 19+'common.css' => '/* Мындағы CSS барлық безендіру мәнеріндерде қолданылады */',
 20+'monobook.css' => '/* Мындағы CSS «Дара кітап» (monobook) безендіру мәнерін пайдаланушыларға ықпал етеді */',
2121
2222 # Scripts
23 -'common.js' => ' /* Мындағы JavaScript әрқайсы бет қаралғанда барлық пайдаланушыларға жүктеледі. */
24 -
25 -/* Workaround for language variants */
26 -var languagevariant;
27 -var direction;
28 -switch(wgUserLanguage){
29 - case "kk":
30 - languagevariant = "kk";
31 - direction = "ltr";
32 - break;
33 - case "kk-kz":
34 - case "kk-cyrl":
35 - languagevariant = "kk-Cyrl";
36 - direction = "ltr";
37 - break;
38 - case "kk-tr":
39 - case "kk-latn":
40 - languagevariant = "kk-Latn";
41 - direction = "ltr";
42 - break;
43 - case "kk-cn":
44 - case "kk-arab":
45 - // workaround for RTL ([[bugzilla:6756]]) and for [[bugzilla:02020]] & [[bugzilla:04295]]
46 - languagevariant = "kk-Arab";
47 - direction = "rtl";
48 - document.getElementsByTagName("body").className = "rtl";
49 - switch(skin){
50 - case "monobook":
51 - document.write(\'<link rel="stylesheet" type="text/css" href="\'+stylepath+\'/monobook/rtl.css">\');
52 - document.write(\'<style type="text/css">body{font-size: 75%; letter-spacing: 0.001em;} h3{font-size:110%;} h4 {font-size:100%;} h5{font-size:90%;} html > body div#content ol{clear: left;} ol{margin-left:2.4em; margin-right:2.4em;} ul{margin-left:1.5em; margin-right:1.5em;} .editsection{margin-right:5px; margin-left:0;} #column-one{padding-top:0; margin-top:0;} #p-navigation{padding-top:0; margin-top:160px;} #catlinks{width:100%;} #userloginForm{float: right !important;} .pBody{-moz-border-radius-topleft: 0.5em; -moz-border-radius-topright: 0em !important;} .portlet h5{clear:right;}</style>\');
53 - break;
54 - case "chick":
55 - document.write(\'<link rel="stylesheet" type="text/css" href="\'+stylepath+\'/monobook/rtl.css">\');
56 - document.write(\'<style type="text/css">body{font-size: 75%; letter-spacing: 0.001em;} h3{font-size:110%;} h4 {font-size:100%;} h5{font-size:90%;} html > body div#content ol{clear: left;} ol{margin-left:2.4em; margin-right:2.4em;} ul{margin-left:1.5em; margin-right:1.5em;} .editsection{margin-right:5px; margin-left:0;} #column-one{clear:left !important; text-align:right; padding-top:0; margin-top:0;} #p-personal {float:right !important; text-align:right;} #userloginForm{float: right !important;} .pBody{-moz-border-radius-topleft: 0.5em; -moz-border-radius-topright: 0em !important;} .portlet h5{clear:right;}</style>\');
57 - break;
58 - case "simple":
59 - document.write(\'<link rel="stylesheet" type="text/css" href="\'+stylepath+\'/monobook/rtl.css">\');
60 - document.write(\'<style type="text/css">body{font-size: 75%; letter-spacing: 0.001em;} h3{font-size:110%;} h4 {font-size:100%;} h5{font-size:90%;} html > body div#content ol{clear: left;} ol{margin-left:2.4em; margin-right:2.4em;} ul{margin-left:1.5em; margin-right:1.5em;} .editsection{margin-right:5px; margin-left:0;} #column-one{float:right !important; margin-right: 0 !important; text-align:right; padding-top:0; margin-top:0;} #p-cactions, #p-personal {float:right !important; text-align:right;} #userloginForm{float: right !important;} .pBody{-moz-border-radius-topleft: 0.5em; -moz-border-radius-topright: 0em !important;} .portlet h5{clear:right;}</style>\');
61 - break;
62 - case "myskin":
63 - document.write(\'<link rel="stylesheet" type="text/css" href="\'+stylepath+\'/monobook/rtl.css">\');
64 - document.write(\'<style type="text/css">body{font-size: 75%; letter-spacing: 0.001em;} h3{font-size:110%;} h4 {font-size:100%;} h5{font-size:90%;} html > body div#content ol{clear: left;} ol{margin-left:2.4em; margin-right:2.4em;} ul{margin-left:1.5em; margin-right:1.5em;} .editsection{margin-right:5px; margin-left:0;} #column-one{clear:left !important; text-align:right; padding-top:0; margin-top:0;} #userloginForm{float: right !important;} .pBody{-moz-border-radius-topleft: 0.5em; -moz-border-radius-topright: 0em !important;} .portlet h5{clear:right;}</style>\');
65 - break;
66 - case "cologneblue":
67 - document.write(\'<link rel="stylesheet" type="text/css" href="\'+stylepath+\'/common/common_rtl.css">\');
68 - document.write(\'<link rel="stylesheet" type="text/css" href="\'+stylepath+\'/common/quickbar-right.css">\');
69 - document.write(\'<style type="text/css">#article {float: left !important; margin-left: 0 !important; margin-right:140px !important;} #quickbar {clear:left;}<style>\');
70 - break;
71 - case "nostalgia":
72 - document.write(\'<link rel="stylesheet" type="text/css" href="\'+stylepath+\'/common/common_rtl.css">\');
73 - document.write(\'<style type="text/css">#topbar a img {float: left !important;}<style>\');
74 - break;
75 - case "standard":
76 - document.write(\'<link rel="stylesheet" type="text/css" href="\'+stylepath+\'/common/common_rtl.css">\');
77 - document.write(\'<link rel="stylesheet" type="text/css" href="\'+stylepath+\'/common/quickbar-right.css">\');
78 - document.write(\'<style type="text/css">#article {float: left !important; margin-left: 0 !important; margin-right:140px !important;} #quickbar {clear:left;} .bottom {text-align:right;}<style>\');
79 - break;
80 - default:
81 - }
82 - document.write(\'<style type="text/css">div#shared-image-desc {direction: ltr;} input#wpUploadFile, input#wpDestFile, input#wpLicense {float: right;} .editsection {float: left !important;} .infobox {float: left !important; clear:left; } div.floatleft, table.floatleft {float:right !important; margin-left:0.5em !important; margin-right:0 !important; } div.floatright, table.floatright {clear:left; float:left !important; margin-left:0 !important; margin-right:0.5em !important;}</style>\');
83 - break;
84 - default:
85 - languagevariant = "kk";
86 - direction = "ltr";
87 -}
88 -
89 -var htmlE=document.documentElement;
90 -htmlE.setAttribute("lang",languagevariant);
91 -htmlE.setAttribute("xml:lang",languagevariant);
92 -htmlE.setAttribute("dir",direction);',
 23+'common.js' => '/* Мындағы JavaScript әрқайсы бет қаралғанда барлық пайдаланушыларға жүктеледі. */',
9324 'monobook.js' => ' /* Тыйылған; орнына [[{{ns:mediawiki}}:common.js]] қолданыңыз */',
9425
9526 /*
@@ -97,12 +28,12 @@
9829 * 'variantname-kk-cn' => 'disable',
9930 */
10031 # Variants for Kazakh language
101 -'variantname-kk-kz' => 'disable', # Қазақстан
102 -'variantname-kk-tr' => 'disable', # Türkïya
103 -'variantname-kk-cn' => 'disable', # جۇنگو
 32+'variantname-kk-kz' => 'disable', # Қазақстан
 33+'variantname-kk-tr' => 'disable', # Türkïya
 34+'variantname-kk-cn' => 'disable', # جۇنگو
10435 'variantname-kk-cyrl' => 'Кирил',
10536 'variantname-kk-latn' => 'Latın',
10637 'variantname-kk-arab' => 'توتە',
107 -'variantname-kk' => 'disable',
 38+'variantname-kk' => 'disable',
10839
10940 );
Index: trunk/phase3/languages/messages/MessagesKk_cyrl.php
@@ -901,8 +901,8 @@
902902 'accmailtitle' => 'Құпия сөз жіберілді.',
903903 'accmailtext' => '$2 жайына «$1» құпия сөзі жіберілді.',
904904 'newarticle' => '(Жаңа)',
905 -'newarticletext' => 'Сілтемеге еріп әлі басталмаған бетке
906 -келіпсіз. Бетті бастау үшін, төмендегі аумақта мәтініңізді теріңіз
 905+'newarticletext' => 'Сілтемеге еріп әлі басталмаған бетке келіпсіз.
 906+Бетті бастау үшін, төмендегі аумақта мәтініңізді теріңіз
907907 (көбірек ақпарат үшін [[{{{{ns:mediawiki}}:helppage}}|анықтама бетін]] қараңыз).
908908 Егер жаңылғаннан осында келген болсаңыз, шолғышыңыз «Артқа» деген батырмасын нұқыңыз.',
909909 'anontalkpagetext' => "----''Бұл тіркелгісіз (немесе тіркелгісін қолданбаған) қатысушы талқылау беті. Осы қатысушыны біз тек сандық IP жайымен теңдестіреміз. Осындай IP жайлар бірнеше қатысушыға ортақ болуы мүмкін. Егер сіз тіркелгісіз қатысушы болсаңыз және сізге қатыссыз мәндемелер жіберілгенін сезсеңіз, басқа тіркелгісіз қатысушылармен араластырмауы үшін [[{{ns:special}}:Userlogin|тіркеліңіз не кіріңіз]].''",
@@ -1295,6 +1295,8 @@
12961296 'illegalfilename' => '«$1» файл атауында бет атауларында рұқсат етілмеген нышандар бар. Файлды қайта атаңыз да бұны жуктеді қайта байқап көріңіз.',
12971297 'badfilename' => 'Файлдың аты «$1» боп өзгертілді.',
12981298 'filetype-badmime' => '«$1» деген MIME түрі бар файлдарды қотаруға рұқсат етілмейді.',
 1299+'filetype-badtype' => "'''«.$1»''' деген күтілмеген файл түрі
 1300+: Рүқсат етілген файл түр тізімі: $2",
12991301 'filetype-missing' => 'Бұл файлдың («.jpg» сияқты) кеңейтімі жоқ.',
13001302 'large-file' => 'Файлды $1 мөлшерден аспауына тырысыңыз; бұл файл мөлшері — $2.',
13011303 'largefileserver' => 'Осы файлдың мөлшері сервердің қалауынан асып кеткен.',
Index: trunk/phase3/languages/messages/MessagesKk_latn.php
@@ -1296,6 +1296,8 @@
12971297 'illegalfilename' => '«$1» faýl atawında bet atawlarında ruqsat etilmegen nışandar bar. Faýldı qaýta atañız da bunı jwktedi qaýta baýqap köriñiz.',
12981298 'badfilename' => 'Faýldıñ atı «$1» bop özgertildi.',
12991299 'filetype-badmime' => '«$1» degen MIME türi bar faýldardı qotarwğa ruqsat etilmeýdi.',
 1300+'filetype-badtype' => "'''«.$1»''' degen kütilmegen faýl türi
 1301+: Rüqsat etilgen faýl tür tizimi: $2",
13001302 'filetype-missing' => 'Bul faýldıñ («.jpg» sïyaqtı) keñeýtimi joq.',
13011303 'large-file' => 'Faýldı $1 mölşerden aspawına tırısıñız; bul faýl mölşeri — $2.',
13021304 'largefileserver' => 'Osı faýldıñ mölşeri serverdiñ qalawınan asıp ketken.',
Index: trunk/phase3/languages/messages/MessagesKk_arab.php
@@ -15,9 +15,22 @@
1616 $fallback = 'kk-cyrl';
1717 $rtl = true;
1818
 19+$digitTransformTable = array(
 20+ '0' => '۰', # &#x06f0;
 21+ '1' => '۱', # &#x06f1;
 22+ '2' => '۲', # &#x06f2;
 23+ '3' => '۳', # &#x06f3;
 24+ '4' => '۴', # &#x06f4;
 25+ '5' => '۵', # &#x06f5;
 26+ '6' => '۶', # &#x06f6;
 27+ '7' => '۷', # &#x06f7;
 28+ '8' => '۸', # &#x06f8;
 29+ '9' => '۹', # &#x06f9;
 30+);
 31+
1932 $separatorTransformTable = array(
20 - ',' => "\xc2\xa0",
21 - '.' => ',',
 33+ ',' => '٬', # &#x066c;
 34+ '.' => '٫', # &#x066b;
2235 );
2336
2437 $defaultUserOptionOverrides = array(
@@ -129,30 +142,31 @@
130143 );
131144
132145 $dateFormats = array(
133 - 'mdy time' => 'H:i',
134 - 'mdy date' => 'xg j, Y "ج."',
135 - 'mdy both' => 'H:i, xg j, Y "ج."',
 146+ ## Please be cautious not to delete the invisible RLM from the beginning of the strings.
 147+ 'mdy time' => '‏H:i',
 148+ 'mdy date' => '‏xg j، Y "ج."',
 149+ 'mdy both' => '‏H:i، xg j، Y "ج."',
136150
137 - 'dmy time' => 'H:i',
138 - 'dmy date' => 'j F, Y "ج."',
139 - 'dmy both' => 'H:i, j F, Y "ج."',
 151+ 'dmy time' => '‏H:i',
 152+ 'dmy date' => '‏j F, Y "ج."',
 153+ 'dmy both' => '‏H:i، j F، Y "ج."',
140154
141 - 'ymd time' => 'H:i',
142 - 'ymd date' => 'Y "ج." xg j',
143 - 'ymd both' => 'H:i, Y "ج." xg j',
 155+ 'ymd time' => '‏H:i',
 156+ 'ymd date' => '‏Y "ج." xg j',
 157+ 'ymd both' => '‏H:i، Y "ج." xg j',
144158
145159 'yyyy-mm-dd time' => 'xnH:xni:xns',
146160 'yyyy-mm-dd date' => 'xnY-xnm-xnd',
147161 'yyyy-mm-dd both' => 'xnH:xni:xns, xnY-xnm-xnd',
148162
149 - 'persian time' => 'H:i',
150 - 'persian date' => 'xij xiF xiY',
151 - 'persian both' => 'xij xiF xiY, H:i',
152 -
153 - 'hebrew time' => 'H:i',
154 - 'hebrew date' => 'xij xjF xjY',
155 - 'hebrew both' => 'H:i, xij xjF xjY',
 163+ 'persian time' => '‏H:i',
 164+ 'persian date' => '‏xij xiF xiY',
 165+ 'persian both' => '‏xij xiF xiY, H:i',
156166
 167+ 'hebrew time' => '‏H:i',
 168+ 'hebrew date' => '‏xij xjF xjY',
 169+ 'hebrew both' => '‏H:i, xij xjF xjY',
 170+
157171 'ISO 8601 time' => 'xnH:xni:xns',
158172 'ISO 8601 date' => 'xnY-xnm-xnd',
159173 'ISO 8601 both' => 'xnY-xnm-xnd"T"xnH:xni:xns',
@@ -1304,6 +1318,8 @@
13051319 'illegalfilename' => '«$1» فايل اتاۋىندا بەت اتاۋلارىندا رۇقسات ەتٸلمەگەن نىشاندار بار. فايلدى قايتا اتاڭىز دا بۇنى جۋكتەدٸ قايتا بايقاپ كٶرٸڭٸز.',
13061320 'badfilename' => 'فايلدىڭ اتى «$1» بوپ ٶزگەرتٸلدٸ.',
13071321 'filetype-badmime' => '«$1» دەگەن MIME تٷرٸ بار فايلداردى قوتارۋعا رۇقسات ەتٸلمەيدٸ.',
 1322+'filetype-badtype' => "'''«.$1»''' دەگەن كٷتٸلمەگەن فايل تٷرٸ
 1323+: رٷقسات ەتٸلگەن فايل تٷر تٸزٸمٸ: $2",
13081324 'filetype-missing' => 'بۇل فايلدىڭ («.jpg» سيياقتى) كەڭەيتٸمٸ جوق.',
13091325 'large-file' => 'فايلدى $1 مٶلشەردەن اسپاۋىنا تىرىسىڭىز; بۇل فايل مٶلشەرٸ — $2.',
13101326 'largefileserver' => 'وسى فايلدىڭ مٶلشەرٸ سەرۆەردٸڭ قالاۋىنان اسىپ كەتكەن.',
Index: trunk/phase3/languages/classes/LanguageKk.php
@@ -8,137 +8,173 @@
99 require_once( dirname(__FILE__).'/../LanguageConverter.php' );
1010 require_once( dirname(__FILE__).'/LanguageKk_cyrl.php' );
1111
 12+define( 'KK_C_UC', 'АӘБВГҒДЕЁЖЗИЙКҚЛМНҢОӨПРСТУҰҮФХҺЦЧШЩЪЫІЬЭЮЯ' ); # Kazakh Cyrillic uppercase
 13+define( 'KK_C_LC', 'аәбвгғдеёжзийкқлмнңоөпрстуұүфхһцчшщъыіьэюя' ); # Kazakh Cyrillic lowercase
 14+define( 'KK_L_UC', 'AÄBCÇDEÉFGĞHIİÏJKLMNÑOÖPQRSŞTUÜVWXYÝZ' ); # Kazakh Latin uppercase
 15+define( 'KK_L_LC', 'aäbcçdeéfgğhıiïjklmnñoöpqrsştuüvwxyýz' ); # Kazakh Latin lowercase
 16+define( 'KK_A', 'اٵبۆگعدەجزيكقلمنڭوٶپرستۋۇٷفحھچشىٸ' ); # Kazakh Arabic
 17+
1218 class KkConverter extends LanguageConverter {
13 - var $mLatinToCyrillic = array(
14 - 'YA' => 'Я', 'Ya' => 'Я', 'ya' => 'я', 'YE' => 'Е', 'Ye' => 'У', 'ye' => 'е',
15 - 'YO' => 'Ё', 'Yo' => 'Ё', 'yo' => 'ё', 'YU' => 'Ю', 'Yu' => 'Ю', 'yu' => 'ю',
16 - 'YW' => 'Ю', 'Yw' => 'Ю', 'yw' => 'ю',
1719
18 - 'bʺ' => 'бъ', 'dʺ' => 'дъ', 'fʺ' => 'фъ', 'gʺ' => 'гъ', 'kʺ' => 'къ', 'lʺ' => 'лъ',
19 - 'mʺ' => 'мъ', 'nʺ' => 'нъ', 'pʺ' => 'пъ', 'rʺ' => 'ръ', 'sʺ' => 'съ', 'tʺ' => 'тъ',
20 - 'vʺ' => 'въ', 'zʺ' => 'зъ',
21 - /* 'jʺ' => 'жъ', 'cʺ' => 'цъ', 'çʺ' => 'чъ', 'şʺ' => 'шъ', */
 20+ function loadDefaultTables() {
 21+ // require( dirname(__FILE__)."/../../includes/KkConversion.php" );
 22+ // Placeholder for future implementing. Remove variables declarations
 23+ // after generating KkConversion.php
 24+ $kk2Cyrl = array();
 25+ $kk2Latn = array();
 26+ $kk2Arab = array();
 27+ $kk2KZ = array();
 28+ $kk2TR = array();
 29+ $kk2CN = array();
2230
23 - 'ŞÇʹ'=> 'ЩЬ', 'Şçʹ'=> 'Щь', 'Bʺ' => 'БЪ', 'Dʺ' => 'ДЪ', 'Fʺ' => 'ФЪ', 'Gʺ' => 'ГЪ', 'Kʺ' => 'КЪ', 'Lʺ' => 'ЛЪ',
24 - 'Mʺ' => 'МЪ', 'Nʺ' => 'НЪ', 'Pʺ' => 'ПЪ', 'Rʺ' => 'РЪ', 'Sʺ' => 'СЪ', 'Tʺ' => 'ТЪ',
25 - 'Vʺ' => 'ВЪ', 'Zʺ' => 'ЗЪ',
26 - /* 'Jʺ' => 'ЖЪ', 'Cʺ' => 'ЦЪ', 'Çʺ' => 'ЧЪ', 'Şʺ' => 'ШЪ', */
 31+ $this->mTables = array(
 32+ 'kk-cyrl' => new ReplacementArray( $kk2Cyrl ),
 33+ 'kk-latn' => new ReplacementArray( $kk2Latn ),
 34+ 'kk-arab' => new ReplacementArray( $kk2Arab ),
 35+ 'kk-kz' => new ReplacementArray( array_merge($kk2Cyrl, $kk2KZ) ),
 36+ 'kk-tr' => new ReplacementArray( array_merge($kk2Latn, $kk2TR) ),
 37+ 'kk-cn' => new ReplacementArray( array_merge($kk2Arab, $kk2CN) ),
 38+ 'kk' => new ReplacementArray()
 39+ );
2740
28 - 'şçʹ'=> 'щь', 'bʹ' => 'бь', 'dʹ' => 'дь', 'fʹ' => 'фь', 'gʹ' => 'гь', 'kʹ' => 'кь', 'lʹ' => 'ль',
29 - 'mʹ' => 'мь', 'nʹ' => 'нь', 'pʹ' => 'пь', 'rʹ' => 'рь', 'sʹ' => 'сь', 'tʹ' => 'ть',
30 - 'vʹ' => 'вь', 'zʹ' => 'зь', 'jʹ' => 'жь', 'cʹ' => 'ць', 'çʹ' => 'чь', 'şʹ' => 'шь',
 41+ self::loadRegs();
 42+ }
3143
32 - 'Bʹ' => 'БЬ', 'Dʹ' => 'ДЬ', 'Fʹ' => 'ФЬ', 'Gʹ' => 'ГЬ', 'Kʹ' => 'КЬ', 'Lʹ' => 'ЛЬ',
33 - 'Mʹ' => 'МЬ', 'Nʹ' => 'НЬ', 'Pʹ' => 'ПЬ', 'Rʹ' => 'РЬ', 'Sʹ' => 'СЬ', 'Tʹ' => 'ТЬ',
34 - 'Vʹ' => 'ВЬ', 'Zʹ' => 'ЗЬ', 'Jʹ' => 'ЖЬ', 'Cʹ' => 'ЦЬ', 'Çʹ' => 'ЧЬ', 'Şʹ' => 'ШЬ',
 44+ function postLoadTables() {
 45+ $this->mTables['kk-kz']->merge( $this->mTables['kk-cyrl'] );
 46+ $this->mTables['kk-tr']->merge( $this->mTables['kk-latn'] );
 47+ $this->mTables['kk-cn']->merge( $this->mTables['kk-arab'] );
 48+ }
3549
36 - 'ŞÇ' => 'Щ', 'Şç' => 'Щ', 'şç' => 'щ',
 50+ function loadRegs() {
3751
38 - 'a' => 'а', 'ä' => 'ә', 'b' => 'б', 'c' => 'ц', 'ç' => 'ч', 'd' => 'д', 'e' => 'е',
39 - 'é' => 'э', 'f' => 'ф', 'g' => 'г', 'ğ' => 'ғ', 'h' => 'һ', 'i' => 'і', 'ı' => 'ы',
40 - 'ï' => 'и', 'j' => 'ж', 'k' => 'к', 'l' => 'л', 'm' => 'м', 'n' => 'н', 'ñ' => 'ң',
41 - 'o' => 'о', 'ö' => 'ө', 'p' => 'п', 'q' => 'қ', 'r' => 'р', 's' => 'с', 'ş' => 'ш',
42 - 't' => 'т', 'u' => 'ұ', 'ü' => 'ү', 'v' => 'в', 'w' => 'у', 'x' => 'х', 'ý' => 'й',
43 - 'z' => 'з',
 52+ $this->mCyrl2Latn = array(
 53+ '/№/u' => 'No.',
 54+ ## Е after vowels
 55+ '/([АӘЕЁИОӨҰҮЭЮЯЪЬ])Е/u' => '$1YE',
 56+ '/([АӘЕЁИОӨҰҮЭЮЯЪЬ])е/ui' => '$1ye',
 57+ ## leading ЁЮЯЩ
 58+ '/^Ё(['.KK_C_UC.']|$)/u' => 'YO$1', '/^Ё(['.KK_C_LC.']|$)/u' => 'Yo$1',
 59+ '/^Ю(['.KK_C_UC.']|$)/u' => 'YU$1', '/^Ю(['.KK_C_LC.']|$)/u' => 'Yu$1',
 60+ '/^Я(['.KK_C_UC.']|$)/u' => 'YA$1', '/^Я(['.KK_C_LC.']|$)/u' => 'Ya$1',
 61+ '/^Щ(['.KK_C_UC.']|$)/u' => 'ŞÇ$1', '/^Щ(['.KK_C_LC.']|$)/u' => 'Şç$1',
 62+ ## other ЁЮЯ
 63+ '/Ё/u' => 'YO', '/ё/u' => 'yo',
 64+ '/Ю/u' => 'YU', '/ю/u' => 'yu',
 65+ '/Я/u' => 'YA', '/я/u' => 'ya',
 66+ '/Щ/u' => 'ŞÇ', '/щ/u' => 'şç',
 67+ ## soft and hard signs
 68+ '/[ъЪ]/u' => 'ʺ', '/[ьЬ]/u' => 'ʹ',
 69+ ## other characters
 70+ '/А/u' => 'A', '/а/u' => 'a', '/Ә/u' => 'Ä', '/ә/u' => 'ä',
 71+ '/Б/u' => 'B', '/б/u' => 'b', '/В/u' => 'V', '/в/u' => 'v',
 72+ '/Г/u' => 'G', '/г/u' => 'g', '/Ғ/u' => 'Ğ', '/ғ/u' => 'ğ',
 73+ '/Д/u' => 'D', '/д/u' => 'd', '/Е/u' => 'E', '/е/u' => 'e',
 74+ '/Ж/u' => 'J', '/ж/u' => 'j', '/З/u' => 'Z', '/з/u' => 'z',
 75+ '/И/u' => 'Ï', '/и/u' => 'ï', '/Й/u' => 'Ý', '/й/u' => 'ý',
 76+ '/К/u' => 'K', '/к/u' => 'k', '/Қ/u' => 'Q', '/қ/u' => 'q',
 77+ '/Л/u' => 'L', '/л/u' => 'l', '/М/u' => 'M', '/м/u' => 'm',
 78+ '/Н/u' => 'N', '/н/u' => 'n', '/Ң/u' => 'Ñ', '/ң/u' => 'ñ',
 79+ '/О/u' => 'O', '/о/u' => 'o', '/Ө/u' => 'Ö', '/ө/u' => 'ö',
 80+ '/П/u' => 'P', '/п/u' => 'p', '/Р/u' => 'R', '/р/u' => 'r',
 81+ '/С/u' => 'S', '/с/u' => 's', '/Т/u' => 'T', '/т/u' => 't',
 82+ '/У/u' => 'W', '/у/u' => 'w', '/Ұ/u' => 'U', '/ұ/u' => 'u',
 83+ '/Ү/u' => 'Ü', '/ү/u' => 'ü', '/Ф/u' => 'F', '/ф/u' => 'f',
 84+ '/Х/u' => 'X', '/х/u' => 'x', '/Һ/u' => 'H', '/һ/u' => 'h',
 85+ '/Ц/u' => 'C', '/ц/u' => 'c', '/Ч/u' => 'Ç', '/ч/u' => 'ç',
 86+ '/Ш/u' => 'Ş', '/ш/u' => 'ş', '/Ы/u' => 'I', '/ы/u' => 'ı',
 87+ '/І/u' => 'İ', '/і/u' => 'i', '/Э/u' => 'É', '/э/u' => 'é',
 88+ );
4489
45 - 'A' => 'А', 'Ä' => 'Ә', 'B' => 'Б', 'C' => 'Ц', 'Ç' => 'Ч', 'D' => 'Д', 'E' => 'Е',
46 - 'É' => 'Э', 'F' => 'Ф', 'G' => 'Г', 'Ğ' => 'Ғ', 'H' => 'Һ', 'İ' => 'І', 'I' => 'Ы',
47 - 'Ï' => 'И', 'J' => 'Ж', 'K' => 'К', 'L' => 'Л', 'M' => 'М', 'N' => 'Н', 'Ñ' => 'Ң',
48 - 'O' => 'О', 'Ö' => 'Ө', 'P' => 'П', 'Q' => 'Қ', 'R' => 'Р', 'S' => 'С', 'Ş' => 'Ш',
49 - 'T' => 'Т', 'U' => 'Ұ', 'Ü' => 'Ү', 'V' => 'В', 'W' => 'У', 'Ý' => 'Й', 'X' => 'Х',
50 - 'Z' => 'З'
51 - );
 90+ $this->mLatn2Cyrl = array(
 91+ '/No\./u' => '№',
 92+ ## Şç
 93+ '/ŞÇʹ/u'=> 'ЩЬ', '/Şçʹ/u'=> 'Щь', '/Şçʹ/u'=> 'Щь',
 94+ '/Ş[Çç]/u' => 'Щ', '/şç/u' => 'щ',
 95+ ## soft and hard signs
 96+ '/(['.KK_L_UC.'])ʺ(['.KK_L_UC.'])/u' => '$1Ъ$2',
 97+ '/ʺ(['.KK_L_LC.'])/u' => 'ъ$1',
 98+ '/(['.KK_L_UC.'])ʹ(['.KK_L_UC.'])/u' => '$1Ь$2',
 99+ '/ʹ(['.KK_L_LC.'])/u' => 'ь$1',
 100+ '/ʺ/u' => 'ъ',
 101+ '/ʹ/u' => 'ь',
 102+ ## Ye Yo Yu Ya.
 103+ '/Y[Ee]/u' => 'Е', '/ye/u' => 'е',
 104+ '/Y[Oo]/u' => 'Ё', '/yo/u' => 'ё',
 105+ '/Y[UWuw]/u' => 'Ю', '/y[uw]/u' => 'ю',
 106+ '/Y[Aa]/u' => 'Я', '/ya/u' => 'я',
 107+ ## other characters
 108+ '/A/u' => 'А', '/a/u' => 'а', '/Ä/u' => 'Ә', '/ä/u' => 'ә',
 109+ '/B/u' => 'Б', '/b/u' => 'б', '/C/u' => 'Ц', '/c/u' => 'ц',
 110+ '/Ç/u' => 'Ч', '/ç/u' => 'ч', '/D/u' => 'Д', '/d/u' => 'д',
 111+ '/E/u' => 'Е', '/e/u' => 'е', '/É/u' => 'Э', '/é/u' => 'э',
 112+ '/F/u' => 'Ф', '/f/u' => 'ф', '/G/u' => 'Г', '/g/u' => 'г',
 113+ '/Ğ/u' => 'Ғ', '/ğ/u' => 'ғ', '/H/u' => 'Һ', '/h/u' => 'һ',
 114+ '/I/u' => 'Ы', '/ı/u' => 'ы', '/İ/u' => 'І', '/i/u' => 'і',
 115+ '/Ï/u' => 'И', '/ï/u' => 'и', '/J/u' => 'Ж', '/j/u' => 'ж',
 116+ '/K/u' => 'К', '/k/u' => 'к', '/L/u' => 'Л', '/l/u' => 'л',
 117+ '/M/u' => 'М', '/m/u' => 'м', '/N/u' => 'Н', '/n/u' => 'н',
 118+ '/Ñ/u' => 'Ң', '/ñ/u' => 'ң', '/O/u' => 'О', '/o/u' => 'о',
 119+ '/Ö/u' => 'Ө', '/ö/u' => 'ө', '/P/u' => 'П', '/p/u' => 'п',
 120+ '/Q/u' => 'Қ', '/q/u' => 'қ', '/R/u' => 'Р', '/r/u' => 'р',
 121+ '/S/u' => 'С', '/s/u' => 'с', '/Ş/u' => 'Ш', '/ş/u' => 'ш',
 122+ '/T/u' => 'Т', '/t/u' => 'т', '/U/u' => 'Ұ', '/u/u' => 'ұ',
 123+ '/Ü/u' => 'Ү', '/ü/u' => 'ү', '/V/u' => 'В', '/v/u' => 'в',
 124+ '/W/u' => 'У', '/w/u' => 'у', '/Ý/u' => 'Й', '/ý/u' => 'й',
 125+ '/X/u' => 'Х', '/x/u' => 'х', '/Z/u' => 'З', '/z/u' => 'з',
 126+ );
52127
53 - var $mCyrillicToLatin = array(
54 - 'а' => 'a', 'ә' => 'ä', 'б' => 'b', 'в' => 'v', 'г' => 'g', 'ғ' => 'ğ',
55 - 'д' => 'd', 'е' => 'e', 'ё' => 'yo', 'ж' => 'j', 'з' => 'z', 'и' => 'ï',
56 - 'й' => 'ý', 'к' => 'k', 'қ' => 'q', 'л' => 'l', 'м' => 'm', 'н' => 'n',
57 - 'ң' => 'ñ', 'о' => 'o', 'ө' => 'ö', 'п' => 'p', 'р' => 'r', 'с' => 's',
58 - 'т' => 't', 'у' => 'w', 'ұ' => 'u', 'ү' => 'ü', 'ф' => 'f', 'х' => 'x',
59 - 'һ' => 'h', 'ц' => 'c', 'ч' => 'ç', 'ш' => 'ş', 'щ' => 'şç', 'ъ' => 'ʺ',
60 - 'ы' => 'ı', 'ь' => 'ʹ', 'і' => 'i', 'э' => 'é', 'ю' => 'yw', 'я' => 'ya',
 128+ $this->mCyLa2Arab = array(
 129+ ## Cyrillic -> Arabic
 130+ '/\№/u' => 'نٶ.',
 131+ '/([АӘЕЁИОӨҰҮЭЮЯЪЬ])е/ui' => '$1يە',
 132+ '/а/ui' => 'ا', '/ә/ui' => 'ٵ', '/б/ui' => 'ب', '/в/ui' => 'ۆ',
 133+ '/г/ui' => 'گ', '/ғ/ui' => 'ع', '/д/ui' => 'د', '/[еэ]/ui' => 'ە',
 134+ '/ё/ui' => 'يو', '/ж/ui' => 'ج', '/з/ui' => 'ز', '/и/ui' => 'ي',
 135+ '/й/ui' => 'ي', '/к/ui' => 'ك', '/қ/ui' => 'ق', '/л/ui' => 'ل',
 136+ '/м/ui' => 'م', '/н/ui' => 'ن', '/ң/ui' => 'ڭ', '/о/ui' => 'و',
 137+ '/ө/ui' => 'ٶ', '/п/ui' => 'پ', '/р/ui' => 'ر', '/с/ui' => 'س',
 138+ '/т/ui' => 'ت', '/у/ui' => 'ۋ', '/ұ/ui' => 'ۇ', '/ү/ui' => 'ٷ',
 139+ '/ф/ui' => 'ف', '/х/ui' => 'ح', '/һ/ui' => 'ھ', '/ц/ui' => 'تس',
 140+ '/ч/ui' => 'چ', '/ш/ui' => 'ش', '/щ/ui' => 'شش', '/[ъь]/ui' => '',
 141+ '/ы/ui' => 'ى', '/і/ui' => 'ٸ', '/ю/ui' => 'يۋ', '/я/ui' => 'يا',
61142
62 - 'А' => 'A', 'Ә' => 'Ä', 'Б' => 'B', 'В' => 'V', 'Г' => 'G', 'Ғ' => 'Ğ',
63 - 'Д' => 'D', 'Е' => 'E', 'Ё' => 'Yo', 'Ж' => 'J', 'З' => 'Z', 'И' => 'Ï',
64 - 'Й' => 'Ý', 'К' => 'K', 'Қ' => 'Q', 'Л' => 'L', 'М' => 'M', 'Н' => 'N',
65 - 'Ң' => 'Ñ', 'О' => 'O', 'Ө' => 'Ö', 'П' => 'P', 'Р' => 'R', 'С' => 'S',
66 - 'Т' => 'T', 'У' => 'W', 'Ұ' => 'U', 'Ү' => 'Ü', 'Ф' => 'F', 'Х' => 'X',
67 - 'Һ' => 'H', 'Ц' => 'C', 'Ч' => 'Ç', 'Ш' => 'Ş', 'Щ' => 'Şç', 'Ъ' => 'ʺ',
68 - 'Ы' => 'I', 'Ь' => 'ʹ', 'І' => 'İ', 'Э' => 'É', 'Ю' => 'Yw', 'Я' => 'Ya'
69 - );
 143+ ## Latin -> Arabic // commented for now...
 144+ /*'/No\./u' => 'نٶ.',
 145+ '/a/ui' => 'ا', '/ä/ui' => 'ٵ', '/b/ui' => 'ب', '/c/ui' => 'تس',
 146+ '/ç/ui' => 'چ', '/d/ui' => 'د', '/[eé]/ui' => 'ە', '/f/ui' => 'ف',
 147+ '/g/ui' => 'گ', '/ğ/ui' => 'ع', '/h/ui' => 'ھ', '/[ıI]/u' => 'ى',
 148+ '/[iİ]/u' => 'ٸ', '/ï/ui' => 'ي', '/j/ui' => 'ج', '/k/ui' => 'ك',
 149+ '/l/ui' => 'ل', '/m/ui' => 'م', '/n/ui' => 'ن', '/ñ/ui' => 'ڭ',
 150+ '/o/ui' => 'و', '/ö/ui' => 'ٶ', '/p/ui' => 'پ', '/q/ui' => 'ق',
 151+ '/r/ui' => 'ر', '/s/ui' => 'س', '/ş/ui' => 'ش', '/t/ui' => 'ت',
 152+ '/u/ui' => 'ۇ', '/ü/ui' => 'ٷ', '/v/ui' => 'ۆ', '/w/ui' => 'ۋ',
 153+ '/x/ui' => 'ح', '/[yý]/ui' => 'ي', '/z/ui' => 'ز', '/[ʺʹ]/ui' => '',*/
70154
71 - var $mCyrillicToArabic = array(
72 - 'ла' => 'لا', 'лА' => 'لا', 'ЛА' => 'لا', 'Ла' => 'لا',
73 -
74 - 'а' => 'ا', 'ә' => 'ٵ', 'б' => 'ب', 'в' => 'ۆ', 'г' => 'گ', 'ғ' => 'ع',
75 - 'д' => 'د', 'е' => 'ە', 'ё' => 'يو', 'ж' => 'ج', 'з' => 'ز', 'и' => 'ي',
76 - 'й' => 'ي', 'к' => 'ك', 'қ' => 'ق', 'л' => 'ل', 'м' => 'م', 'н' => 'ن',
77 - 'ң' => 'ڭ', 'о' => 'و', 'ө' => 'ٶ', 'п' => 'پ', 'р' => 'ر', 'с' => 'س',
78 - 'т' => 'ت', 'у' => 'ۋ', 'ұ' => 'ۇ', 'ү' => 'ٷ', 'ф' => 'ف', 'х' => 'ح',
79 - 'һ' => 'ھ', 'ц' => 'تس', 'ч' => 'چ', 'ш' => 'ش', 'щ' => 'شش', 'ъ' => 'ي',
80 - 'ы' => 'ى', 'ь' => 'ي', 'і' => 'ٸ', 'э' => 'ە', 'ю' => 'يۋ', 'я' => 'يا',
81 -
82 - 'А' => 'ا', 'Ә' => 'ٵ', 'Б' => 'ب', 'В' => 'ۆ', 'Г' => 'گ', 'Ғ' => 'ع',
83 - 'Д' => 'د', 'Е' => 'ە', 'Ё' => 'يو', 'Ж' => 'ج', 'З' => 'ز', 'И' => 'ي',
84 - 'Й' => 'ي', 'К' => 'ك', 'Қ' => 'ق', 'Л' => 'ل', 'М' => 'م', 'Н' => 'ن',
85 - 'Ң' => 'ڭ', 'О' => 'و', 'Ө' => 'ٶ', 'П' => 'پ', 'Р' => 'ر', 'С' => 'س',
86 - 'Т' => 'ت', 'У' => 'ۋ', 'Ұ' => 'ۇ', 'Ү' => 'ٷ', 'Ф' => 'ف', 'Х' => 'ح',
87 - 'Һ' => 'ھ', 'Ц' => 'تس', 'Ч' => 'چ', 'Ш' => 'ش', 'Щ' => 'شش', 'Ъ' => 'ي',
88 - 'Ы' => 'ى', 'Ь' => 'ي', 'І' => 'ٸ', 'Э' => 'ە', 'Ю' => 'يۋ', 'Я' => 'يا',
89 -
90 - '?' => '؟',
91 - '%' => '٪',
92 - ',' => '،',
93 - ';' => '؛'
94 - );
95 -
96 - var $mLatinToArabic = array(
97 - 'la' => 'لا', 'lA' => 'لا', 'LA' => 'لا', 'La' => 'لا',
98 -
99 - 'a' => 'ا', 'ä' => 'ٵ', 'b' => 'ب', 'v' => 'ۆ', 'g' => 'گ', 'ğ' => 'ع',
100 - 'd' => 'د', 'e' => 'ە', 'yo' => 'يو', 'j' => 'ج', 'z' => 'ز', 'ï' => 'ي',
101 - 'ý' => 'ي', 'k' => 'ك', 'q' => 'ق', 'l' => 'ل', 'm' => 'م', 'n' => 'ن',
102 - 'ñ' => 'ڭ', 'o' => 'و', 'ö' => 'ٶ', 'p' => 'پ', 'r' => 'ر', 's' => 'س',
103 - 't' => 'ت', 'w' => 'ۋ', 'u' => 'ۇ', 'ü' => 'ٷ', 'f' => 'ف', 'x' => 'ح',
104 - 'h' => 'ھ', 'c' => 'تس', 'ç' => 'چ', 'ş' => 'ش', 'şş' => 'شش', '″' => 'ي',
105 - 'ı' => 'ى', '′' => 'ي', 'i' => 'ٸ', 'é' => 'ە',
106 -
107 - 'A' => 'ا', 'Ä' => 'ٵ', 'B' => 'ب', 'V' => 'ۆ', 'G' => 'گ', 'Ğ' => 'ع',
108 - 'D' => 'د', 'E' => 'ە', 'YO' => 'يو', 'J' => 'ج', 'Z' => 'ز', 'Ï' => 'ي',
109 - 'Ý' => 'ي', 'K' => 'ك', 'Q' => 'ق', 'L' => 'ل', 'M' => 'م', 'N' => 'ن',
110 - 'Ñ' => 'ڭ', 'O' => 'و', 'Ö' => 'ٶ', 'P' => 'پ', 'R' => 'ر', 'S' => 'س',
111 - 'T' => 'ت', 'W' => 'ۋ', 'U' => 'ۇ', 'Ü' => 'ٷ', 'F' => 'ف', 'X' => 'ح',
112 - 'H' => 'ھ', 'C' => 'تس', 'Ç' => 'چ', 'Ş' => 'ش', 'ŞŞ' => 'شش', '″' => 'ي',
113 - 'I' => 'ى', '′' => 'ي', 'İ' => 'ٸ', 'É' => 'ە',
114 -
115 - '?' => '؟',
116 - '%' => '٪',
117 - ',' => '،',
118 - ';' => '؛'
119 - );
120 -
121 - function loadDefaultTables() {
122 - $this->mTables = array(
123 - 'kk-cyrl' => new ReplacementArray( $this->mLatinToCyrillic ),
124 - 'kk-latn' => new ReplacementArray( $this->mCyrillicToLatin ),
125 - 'kk-arab' => new ReplacementArray( array_merge($this->mCyrillicToArabic, $this->mLatinToArabic) ),
126 - 'kk-kz' => new ReplacementArray( $this->mLatinToCyrillic ),
127 - 'kk-tr' => new ReplacementArray( $this->mCyrillicToLatin ),
128 - 'kk-cn' => new ReplacementArray( array_merge($this->mCyrillicToArabic, $this->mLatinToArabic) ),
129 - 'kk' => new ReplacementArray()
 155+ ## Punctuation -> Arabic
 156+ '/\?/' => '؟', # &#x061F;
 157+ '/\,/' => '،', # &#x060C;
 158+ '/\;/' => '؛' , # &#x061B;
 159+ '/\%/' => '٪', # &#x066a;
 160+ ## Digits -> Arabic
 161+ '/0/' => '۰', # &#x06f0;
 162+ '/1/' => '۱', # &#x06f1;
 163+ '/2/' => '۲', # &#x06f2;
 164+ '/3/' => '۳', # &#x06f3;
 165+ '/4/' => '۴', # &#x06f4;
 166+ '/5/' => '۵', # &#x06f5;
 167+ '/6/' => '۶', # &#x06f6;
 168+ '/7/' => '۷', # &#x06f7;
 169+ '/8/' => '۸', # &#x06f8;
 170+ '/9/' => '۹', # &#x06f9;
130171 );
131 - }
132172
133 - function postLoadTables() {
134 - $this->mTables['kk-kz']->merge( $this->mTables['kk-cyrl'] );
135 - $this->mTables['kk-tr']->merge( $this->mTables['kk-latn'] );
136 - $this->mTables['kk-cn']->merge( $this->mTables['kk-arab'] );
137173 }
138174
139175 /* rules should be defined as -{ekavian | iyekavian-} -or-
140176 -{code:text | code:text | ...}-
141177 update: delete all rule parsing because it's not used
142 - currently, and just produces a couple of bugs
 178+ currently, and just produces a couple of bugs
143179 */
144180 function parseManualRule($rule, $flags=array()) {
145181 if(in_array('T',$flags)){
@@ -165,9 +201,9 @@
166202
167203 /*
168204 * A function wrapper:
169 - * - if there is no selected variant, leave the link
170 - * names as they were
171 - * - do not try to find variants for usernames
 205+ * - if there is no selected variant, leave the link
 206+ * names as they were
 207+ * - do not try to find variants for usernames
172208 */
173209 function findVariantLink( &$link, &$nt ) {
174210 // check for user namespace
@@ -184,16 +220,6 @@
185221 }
186222
187223 /*
188 - * We want our external link captions to be converted in variants,
189 - * so we return the original text instead -{$text}-, except for URLs
190 - */
191 - function markNoConversion($text, $noParse=false) {
192 - if($noParse || preg_match("/^https?:\/\/|ftp:\/\/|irc:\/\//",$text))
193 - return parent::markNoConversion($text);
194 - return $text;
195 - }
196 -
197 - /*
198224 * An ugly function wrapper for parsing Image titles
199225 * (to prevent image name conversion)
200226 */
@@ -207,38 +233,97 @@
208234 }
209235
210236 /**
211 - * It translates text into variant, specials:
212 - * - ommiting roman numbers
 237+ * It translates text into variant
213238 */
214 - function translate($text, $toVariant){
215 - $breaks = '[^\w\x80-\xff]';
 239+ function translate( $text, $toVariant ){
 240+ global $wgContLanguageCode;
 241+ $text = parent::translate( $text, $toVariant );
216242
217 - // regexp for roman numbers
218 - $roman = 'M{0,4}(CM|CD|D?C{0,3})(XC|XL|L?X{0,3})(IX|IV|V?I{0,3})';
 243+ $letters = '';
 244+ switch( $toVariant ) {
 245+ case 'kk-cyrl':
 246+ case 'kk-kz':
 247+ $letters = KK_L_UC . KK_L_LC . 'ʺʹ0123456789';
 248+ $wgContLanguageCode = 'kk';
 249+ break;
 250+ case 'kk-latn':
 251+ case 'kk-tr':
 252+ $letters = KK_C_UC . KK_C_LC . '№0123456789';
 253+ $wgContLanguageCode = 'kk-Latn';
 254+ break;
 255+ case 'kk-arab':
 256+ case 'kk-cn':
 257+ // $letters = KK_C_UC.KK_C_LC.KK_L_UC.KK_L_LC.'ʺʹ%№0123456789?,;';
 258+ $letters = KK_C_UC . KK_C_LC . '%№0123456789?,;';
 259+ $wgContLanguageCode = 'kk-Arab';
 260+ break;
 261+ default:
 262+ $wgContLanguageCode = 'kk';
 263+ return $text;
 264+ }
 265+ // disable conversion variables like $1, $2...
 266+ $varsfix = '\$[0-9]';
219267
220 - $reg = '/^'.$roman.'$|^'.$roman.$breaks.'|'.$breaks.$roman.'$|'.$breaks.$roman.$breaks.'/';
 268+ $matches = preg_split( '/' . $varsfix . '[^' . $letters . ']+/u', $text, -1, PREG_SPLIT_OFFSET_CAPTURE);
 269+ $mstart = 0;
 270+ foreach( $matches as $m ) {
 271+ $ret .= substr( $text, $mstart, $m[1]-$mstart );
 272+ $ret .= $this->regsConverter( $m[0], $toVariant );
 273+ $mstart = $m[1] + strlen($m[0]);
 274+ }
 275+ return $ret;
 276+ }
221277
222 - $matches = preg_split($reg, $text, -1, PREG_SPLIT_OFFSET_CAPTURE);
 278+ function regsConverter( $text, $toVariant ) {
 279+ if ($text == '') return $text;
223280
224 - $m = array_shift($matches);
225 - if( !isset( $this->mTables[$toVariant] ) ) {
226 - throw new MWException( "Broken variant table: " . implode( ',', array_keys( $this->mTables ) ) );
 281+ $pat = array();
 282+ $rep = array();
 283+ switch( $toVariant ) {
 284+ case 'kk-arab':
 285+ case 'kk-cn':
 286+ foreach( $this->mCyLa2Arab as $pat => $rep ) {
 287+ $text = preg_replace( $pat, $rep, $text );
 288+ }
 289+ return $text;
 290+ break;
 291+ case 'kk-latn':
 292+ case 'kk-tr':
 293+ foreach( $this->mCyrl2Latn as $pat => $rep ) {
 294+ $text = preg_replace( $pat, $rep, $text );
 295+ }
 296+ return $text;
 297+ break;
 298+ case 'kk-cyrl':
 299+ case 'kk-cn':
 300+ foreach( $this->mLatn2Cyrl as $pat => $rep ) {
 301+ $text = preg_replace( $pat, $rep, $text );
 302+ }
 303+ return $text;
 304+ break;
 305+ default:
 306+ return $text;
227307 }
228 - $ret = $this->mTables[$toVariant]->replace( $m[0] );
229 - $mstart = $m[1]+strlen($m[0]);
230 - foreach($matches as $m) {
231 - $ret .= substr($text, $mstart, $m[1]-$mstart);
232 - $ret .= parent::translate($m[0], $toVariant);
233 - $mstart = $m[1] + strlen($m[0]);
234 - }
 308+ }
235309
236 - return $ret;
 310+ /*
 311+ * We want our external link captions to be converted in variants,
 312+ * so we return the original text instead -{$text}-, except for URLs
 313+ */
 314+ function markNoConversion( $text, $noParse=false ) {
 315+ if( $noParse || preg_match( "/^https?:\/\/|ftp:\/\/|irc:\/\//", $text ) )
 316+ return parent::markNoConversion( $text );
 317+ return $text;
237318 }
238319
 320+ function convertCategoryKey( $key ) {
 321+ return $this->autoConvert( $key, 'kk' );
 322+ }
 323+
239324 }
240325
241326 /* class that handles Cyrillic, Latin and Arabic scripts for Kazakh
242 - right now it only distinguish kk_cyrl, kk_latn, kk_arab, kk_kz, kk_tr and kk_cn.
 327+ right now it only distinguish kk_cyrl, kk_latn, kk_arab and kk_kz, kk_tr, kk_cn.
243328 */
244329 class LanguageKk extends LanguageKk_cyrl {
245330
@@ -262,38 +347,27 @@
263348 $wgHooks['ArticleSaveComplete'][] = $this->mConverter;
264349 }
265350
266 - function convertGrammar( $word, $case ) {
267 - $fname="LanguageKk::convertGrammar";
268 - wfProfileIn( $fname );
269 -
270 - switch ( $this->getPreferredVariant() ) {
271 - case 'kk-cn':
272 - case 'kk-arab':
273 - $word = parent::convertGrammar( $word, $case, $variant='kk-arab' );
274 - break;
275 - case 'kk-tr':
276 - case 'kk-latn':
277 - $word = parent::convertGrammar( $word, $case, $variant='kk-latn' );
278 - break;
279 - case 'kk-kz':
280 - case 'kk-cyrl':
281 - case 'kk':
282 - $word = parent::convertGrammar( $word, $case, $variant='kk-cyrl' );
283 - break;
284 - default:
285 - $word = parent::convertGrammar( $word, $case, $variant='kk-cyrl' );
 351+ /**
 352+ * Work around for right-to-left direction support in kk-arab and kk-cn
 353+ *
 354+ * @return bool
 355+ */
 356+ function isRTL() {
 357+ $variant = $this->getPreferredVariant();
 358+ if ( $variant == 'kk-arab' || $variant == 'kk-cn' ) {
 359+ return true;
 360+ } else {
 361+ return parent::isRTL();
286362 }
287 -
288 - wfProfileOut( $fname );
289 - return $word;
290363 }
291364
292365 /*
293 - * It fixes issue ucfirst with transforming 'i' to 'İ'
 366+ * It fixes issue with ucfirst for transforming 'i' to 'İ'
294367 *
295368 */
296369 function ucfirst ( $string ) {
297 - if ( ($this->getPreferredVariant() == 'kk-tr' || $this->getPreferredVariant() == 'kk-latn') && $string[0] == 'i' ) {
 370+ $variant = $this->getPreferredVariant();
 371+ if ( ($variant == 'kk-latn' || $variant == 'kk-tr') && $string[0] == 'i' ) {
298372 $string = 'İ' . substr( $string, 1 );
299373 } else {
300374 $string = parent::ucfirst( $string );
@@ -302,11 +376,12 @@
303377 }
304378
305379 /*
306 - * It fixes issue for lcfirst with transforming 'I' to 'ı'
 380+ * It fixes issue with lcfirst for transforming 'I' to 'ı'
307381 *
308382 */
309383 function lcfirst ( $string ) {
310 - if ( ($this->getPreferredVariant() == 'kk-tr' || $this->getPreferredVariant() == 'kk-latn') && $string[0] == 'I' ) {
 384+ $variant = $this->getPreferredVariant();
 385+ if ( ($variant == 'kk-latn' || $variant == 'kk-tr') && $string[0] == 'I' ) {
311386 $string = 'ı' . substr( $string, 1 );
312387 } else {
313388 $string = parent::lcfirst( $string );
@@ -314,6 +389,29 @@
315390 return $string;
316391 }
317392
318 -}
 393+ function convertGrammar( $word, $case ) {
 394+ $fname="LanguageKk::convertGrammar";
 395+ wfProfileIn( $fname );
319396
 397+ $variant = $this->getPreferredVariant();
 398+ switch ( $variant ) {
 399+ case 'kk-arab':
 400+ case 'kk-cn':
 401+ $word = parent::convertGrammar( $word, $case, $variant = 'kk-arab' );
 402+ break;
 403+ case 'kk-latn':
 404+ case 'kk-tr':
 405+ $word = parent::convertGrammar( $word, $case, $variant = 'kk-latn' );
 406+ break;
 407+ case 'kk-cyrl':
 408+ case 'kk-kz':
 409+ case 'kk':
 410+ default:
 411+ $word = parent::convertGrammar( $word, $case, $variant = 'kk-cyrl' );
 412+ }
320413
 414+ wfProfileOut( $fname );
 415+ return $word;
 416+ }
 417+
 418+}

Follow-up revisions

RevisionCommit summaryAuthorDate
r28717* (bug 12145) Update Kazakh translations...raymond18:26, 20 December 2007
r28719* (bug 12145) Mark 'tog-nolangconversion', 'yourvariant' as optional. Message...raymond18:32, 20 December 2007
r28770* (bug 12145) Update Kazakh translations...shinjiman08:20, 22 December 2007
r29171* (bug 12145) Update Kazakh translations...raymond15:15, 2 January 2008
r29594* (bug 12145) Update Kazakh translations...shinjiman14:16, 11 January 2008
r29746Localisation updates Kazakh translations...raymond14:22, 14 January 2008
r29965* (bug 12145) Update Kazakh translations...shinjiman05:56, 20 January 2008
r30271Localisation updates Kazakh translations...raymond20:57, 29 January 2008
r32889* (bug 12145) Update Kazakh translations...shinjiman04:41, 7 April 2008
r33288Localisation updates Kazakh...raymond16:02, 14 April 2008
r33543Localisation updates Kazakh...raymond10:15, 18 April 2008
r33868(bug 12145) Kazakh message updatesialex19:29, 24 April 2008
r33991Localisation updates Kazakh...raymond05:39, 29 April 2008
r34206(bug 12145) Kazakh localisation updates, patch 4875 by AlefZetleon14:57, 4 May 2008
r34589(bug 12145) Kazakh localisation updates, patch 4893 by AlefZetleon16:41, 10 May 2008
r34666(bug 12145) Kazakh localisation updates. Patch 4894 by AlefZetleon15:44, 12 May 2008
r34685(bug 12145) Kazakh message updatesialex20:30, 12 May 2008
r34693Partial revert of r12145. Bug 12145 Kazakh message updates did not mention/mo...siebrand21:13, 12 May 2008
r34820(bug 12145) Kazakh message updatesialex18:06, 14 May 2008
r34984(bug 12145) Kazakh localisation updates, patch 4905 by AlefZetleon17:07, 17 May 2008
r35131Localisation updates Kazahk (bug 12145)raymond04:57, 21 May 2008
r35207Bug 12145 Kazakh message updates...mfarag22:22, 22 May 2008
r35238(bug 12145) Kazakh message updatesialex18:14, 23 May 2008
r35260* Updating RELEASE-NOTES for last commit, which accidently had no commit mess...leon22:07, 23 May 2008
r35275(bug 12145) Kazakh localisation updates, modified patch 4921 by AlefZetleon08:32, 24 May 2008
r35327(bug 12145) Kazakh message updatesialex19:01, 25 May 2008
r35513Localisation updates Kazahk (bug 12145)raymond19:27, 28 May 2008
r35648* (bug 12145) Localisation updates Kazakh...shinjiman10:58, 31 May 2008
r35801(bug 12145) Kazakh message updatesialex16:35, 3 June 2008
r36096(bug 12145) Kazakh message updatesialex19:12, 9 June 2008
r36152(bug 12145) Kazakh localisation updates, patch 4971 by AlefZetleon15:06, 10 June 2008
r36443Localisation updates Kazakh...raymond06:50, 19 June 2008

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r28000* (bug 12145) Update Kazakh translations...shinjiman01:02, 1 December 2007
r28048* (bug 12145) Update Kazakh translations...shinjiman10:48, 2 December 2007
r28220* (bug 12145) Update Kazakh translations...raymond19:53, 6 December 2007
r28263* (bug 12145) Update Kazakh translations...shinjiman02:52, 8 December 2007
r28319* (bug 12145) Update Kazakh translations, adding kk-variants...shinjiman16:24, 9 December 2007
r28330* (bug 12145) Update Kazakh translations...shinjiman23:40, 9 December 2007

Status & tagging log