Index: trunk/extensions/Translate/Translate.i18n.php |
— | — | @@ -22,4 +22,185 @@ |
23 | 23 | |
24 | 24 | 'translate-optional' => '(optional)', |
25 | 25 | 'translate-ignored' => '(ignored)', |
26 | | -); |
\ No newline at end of file |
| 26 | + |
| 27 | + 'translate-edit-message-format' => 'The format of this message is <b>$1</b>.', |
| 28 | + 'translate-edit-message-in' => 'Current string in <b>$1</b> ($2):', |
| 29 | + 'translate-edit-message-in-fb' => 'Current string in fallback language <b>$1</b> ($2):', |
| 30 | +); |
| 31 | + |
| 32 | + |
| 33 | + |
| 34 | +$wgTranslateMessages['ar'] = array( |
| 35 | + 'translate' => 'ترجمة', |
| 36 | +); |
| 37 | + |
| 38 | +$wgTranslateMessages['br'] = array( |
| 39 | + 'translate' => 'Treiñ', |
| 40 | + 'translate-edit-message-format' => 'Furmad ar gemennadenn-mañ zo <b>$1</b>.', |
| 41 | + 'translate-edit-message-in' => 'Neudennad red e <b>$1</b> ($2):', |
| 42 | + 'translate-edit-message-in-fb' => 'Neudennad red er yezh kein <b>$1</b> ($2):', |
| 43 | +); |
| 44 | + |
| 45 | +$wgTranslateMessages['ca'] = array( |
| 46 | + 'translate'=> 'Tradueix', |
| 47 | + 'translate-edit-message-in'=> 'Cadena actual en <strong>$1</strong> ($2):', |
| 48 | + 'translate-edit-message-in-fb'=> 'Cadena actual en la llengua per defecte <strong>$1</strong> (2):', |
| 49 | +); |
| 50 | + |
| 51 | +$wgTranslateMessages['cs'] = array( |
| 52 | + 'translate' => 'Přeložit', |
| 53 | + 'translate-edit-message-in' => 'Současný řetězec v <b>$1</b> ($2):', |
| 54 | + 'translate-edit-message-in-fb' => 'Současný řetězec v záložním jazyce <b>$1</b> ($2):', |
| 55 | +); |
| 56 | + |
| 57 | +/* German by Raymond */ |
| 58 | +$wgTranslateMessages['de'] = array( |
| 59 | + 'translate' => 'Übersetze', |
| 60 | + 'translate-edit-message-format' => 'Das Format dieser Nachricht ist <b>$1</b>.', |
| 61 | + 'translate-edit-message-in' => 'Aktueller Text in <b>$1</b> ($2):', |
| 62 | + 'translate-edit-message-in-fb' => 'Aktueller Text in der Ausweich-Sprache <b>$1</b> ($2):', |
| 63 | +); |
| 64 | + |
| 65 | +$wgTranslateMessages['fr'] = array( |
| 66 | + 'translate' => 'Traduire', |
| 67 | + 'translate-edit-message-format' => 'Le format de ce message est <b>$1</b>.', |
| 68 | + 'translate-edit-message-in' => 'Chaîne actuellement dans <b>$1</b> ($2) :', |
| 69 | + 'translate-edit-message-in-fb' => 'Chaîne actuellement dans la langue par défaut <b>$1</b> ($2) :', |
| 70 | +); |
| 71 | + |
| 72 | +$wgTranslateMessages['he'] = array( |
| 73 | + 'translate' => 'תרגום', |
| 74 | + 'translate-edit-message-format' => 'המבנה של הודעה זו הוא <b>$1</b>.', |
| 75 | + 'translate-edit-message-in' => 'המחרוזת הנוכחית ל־<b>$1</b> ($2):', |
| 76 | + 'translate-edit-message-in-fb' => 'המחרוזת הנוכחית ל־<b>$1</b> בשפת הגיבוי ($2):', |
| 77 | +); |
| 78 | + |
| 79 | +$wgTranslateMessages['id'] = array( |
| 80 | + 'translate' => 'Terjemahan', |
| 81 | + 'translate-edit-message-format' => 'Format pesan ini adalah <b>$1</b>.', |
| 82 | + 'translate-edit-message-in' => 'Kalimat dalam <b>$1</b> ($2):', |
| 83 | + 'translate-edit-message-in-fb' => 'Kalimat dalam bahasa <b>$1</b> ($2):', |
| 84 | +); |
| 85 | + |
| 86 | +$wgTranslateMessages['it'] = array( |
| 87 | + 'translate' => 'Traduzione', |
| 88 | + 'translate-edit-message-format' => 'Formato del messaggio: <b>$1</b>.', |
| 89 | + 'translate-edit-message-in' => 'Contenuto attuale in <b>$1</b> ($2):', |
| 90 | + 'translate-edit-message-in-fb' => 'Contenuto attuale nella lingua di riserva <b>$1</b> ($2):', |
| 91 | +); |
| 92 | + |
| 93 | +$wgTranslateMessages['ja'] = array( |
| 94 | + 'translate' => 'インターフェースの翻訳', |
| 95 | + 'translate-edit-message-format' => 'このメッセージの書式は <b>$1</b> です。', |
| 96 | + 'translate-edit-message-in' => '<b>$1</b> ($2) での現在の文字列:', |
| 97 | +); |
| 98 | + |
| 99 | +$wgTranslateMessages['kk-kz'] = array( |
| 100 | + 'translate' => 'Аудару', |
| 101 | + 'translate-edit-message-format' => 'Бұл хабардың пішімі - <b>$1</b>.', |
| 102 | + 'translate-edit-message-in' => '<b>$1</b> ($2) дегендегі ағымдағы жол:', |
| 103 | + 'translate-edit-message-in-fb' => '<b>$1</b> ($2) деген сүйену тілінде ағымдағы жол:', |
| 104 | +); |
| 105 | +$wgTranslateMessages['kk-tr'] = array( |
| 106 | + 'translate' => 'Awdarw', |
| 107 | + 'translate-edit-message-format' => 'Bul xabardıñ pişimi - <b>$1</b>.', |
| 108 | + 'translate-edit-message-in' => '<b>$1</b> ($2) degendegi ağımdağı jol:', |
| 109 | + 'translate-edit-message-in-fb' => '<b>$1</b> ($2) degen süýenw tilinde ağımdağı jol:', |
| 110 | +); |
| 111 | +$wgTranslateMessages['kk-cn'] = array( |
| 112 | + 'translate' => 'اۋدارۋ', |
| 113 | + 'translate-edit-message-format' => 'بۇل حاباردىڭ پٸشٸمٸ - <b>$1</b>.', |
| 114 | + 'translate-edit-message-in' => '<b>$1</b> ($2) دەگەندەگٸ اعىمداعى جول:', |
| 115 | + 'translate-edit-message-in-fb' => '<b>$1</b> ($2) دەگەن سٷيەنۋ تٸلٸندە اعىمداعى جول:', |
| 116 | +); |
| 117 | +$wgTranslateMessages['kk'] = $wgTranslateMessages['kk-kz']; |
| 118 | + |
| 119 | +$wgTranslateMessages['nl'] = array( |
| 120 | + 'translate' => 'Vertalen', |
| 121 | + 'translate-edit-message-in' => 'Huidige tekst in <b>$1</b> ($2):', |
| 122 | + 'translate-edit-message-in-fb' => 'Huidige tekst in alternatieve taal <b>$1</b> ($2):', |
| 123 | +); |
| 124 | + |
| 125 | +$wgTranslateMessages['no'] = array( |
| 126 | + 'translate' => 'Oversett', |
| 127 | + 'translate-edit-message-format' => 'Formatet på denne meldingen er <b>$1</b>.', |
| 128 | + 'translate-edit-message-in' => 'Nåværende streng i <b>$1</b> ($2):', |
| 129 | + 'translate-edit-message-in-fb' => 'Nåværende streng i reservespråk <b>$1</b> ($2):', |
| 130 | +); |
| 131 | + |
| 132 | +$wgTranslateMessages['oc'] = array( |
| 133 | + 'translate' => 'Revirar', |
| 134 | + 'translate-edit-message-format' => 'Lo format d\'aqueste messatge es <b>$1</b>.', |
| 135 | + 'translate-edit-message-in' => 'Cadena actualament dins <b>$1</b> ($2) :', |
| 136 | + 'translate-edit-message-in-fb' => 'Cadena actualament dins la lenga per defaut <b>$1</b> ($2) :', |
| 137 | +); |
| 138 | + |
| 139 | +/* Piedmontese (Bèrto 'd Sèra) */ |
| 140 | +$wgTranslateMessages['pms'] = array( |
| 141 | + 'translate' => 'Viragi', |
| 142 | + 'translate-edit-message-format' => 'La forma d\'ës messagi-sì a l\'é <b>$1</b>.', |
| 143 | + 'translate-edit-message-in' => 'Espression corenta an <b>$1</b> ($2):', |
| 144 | + 'translate-edit-message-in-fb' => 'Espression corenta ant la lenga ëd riserva <b>$1</b> ($2):', |
| 145 | +); |
| 146 | + |
| 147 | +$wgTranslateMessages['ru'] = array( |
| 148 | + 'translate' => 'Перевод', |
| 149 | + 'translate-edit-message-format' => 'Формат текущего сообщения - <b>$1</b>.', |
| 150 | + 'translate-edit-message-in' => 'Текущее выражение на языке <b>$1</b> ($2):', |
| 151 | + 'translate-edit-message-in-fb' => 'Текущее выражение на базовом языке <b>$1</b> ($2):', |
| 152 | +); |
| 153 | + |
| 154 | +$wgTranslateMessages['sk'] = array( |
| 155 | + 'translate' => 'Preložiť', |
| 156 | + 'translate-edit-message-format' => 'Formát tejto správy je <b>$1</b>.', |
| 157 | + 'translate-edit-message-in' => 'Aktuálny reťazec v jazyku <b>$1</b> ($2):', |
| 158 | + 'translate-edit-message-in-fb' => 'Aktuálny reťazec v jazyku <b>$1</b>, ktorý sa použije ak správa nie je preložená ($2):', |
| 159 | +); |
| 160 | + |
| 161 | +$wgTranslateMessages['sr-ec'] = array( |
| 162 | + 'translate' => 'Превод', |
| 163 | + 'translate-edit-message-in' => 'Тренутни стринг у <b>$1</b> ($2):', |
| 164 | + 'translate-edit-message-in-fb' => 'Тренутни стринг у језику <b>$1</b> ($2):', |
| 165 | +); |
| 166 | + |
| 167 | +$wgTranslateMessages['sr-el'] = array( |
| 168 | + 'translate' => 'Prevod', |
| 169 | + 'translate-edit-message-in' => 'Trenutni string u <b>$1</b> ($2):', |
| 170 | + 'translate-edit-message-in-fb' => 'Trenutni string u jeziku <b>$1</b> ($2):', |
| 171 | +); |
| 172 | + |
| 173 | +$wgTranslateMessages['sr'] = $wgTranslateMessages['sr-ec']; |
| 174 | + |
| 175 | +$wgTranslateMessages['su'] = array( |
| 176 | + 'translate' => 'Alih basakeun', |
| 177 | + 'translate-edit-message-format' => 'Ieu talatah boga format <b>$1</b>.', |
| 178 | + 'translate-edit-message-in' => 'String kiwari dina <b>$1</b> ($2):', |
| 179 | + 'translate-edit-message-in-fb' => 'String kiwari dina basa fallback <b>$1</b> ($2):', |
| 180 | +); |
| 181 | + |
| 182 | +$wgTranslateMessages['yue'] = array( |
| 183 | + 'translate' => '翻譯', |
| 184 | + 'translate-edit-message-format' => '呢句信息嘅格式係 <b>$1</b>。', |
| 185 | + 'translate-edit-message-in' => '響 <b>$1</b> 嘅現行字串 ($2):', |
| 186 | + 'translate-edit-message-in-fb' => '響 <b>$1</b> 於倚靠語言中嘅現行字串 ($2):', |
| 187 | +); |
| 188 | + |
| 189 | +$wgTranslateMessages['zh-hans'] = array( |
| 190 | + 'translate' => '翻译', |
| 191 | + 'translate-edit-message-format' => '这句信息的格式是 <b>$1</b>。', |
| 192 | + 'translate-edit-message-in' => '在 <b>$1</b> 的当前字串 ($2):', |
| 193 | + 'translate-edit-message-in-fb' => '在 <b>$1</b> 于倚靠语言中的当前字串 ($2):', |
| 194 | +); |
| 195 | + |
| 196 | +$wgTranslateMessages['zh-hant'] = array( |
| 197 | + 'translate' => '翻譯', |
| 198 | + 'translate-edit-message-format' => '這句信息的格式是 <b>$1</b>。', |
| 199 | + 'translate-edit-message-in' => '在 <b>$1</b> 的現行字串 ($2):', |
| 200 | + 'translate-edit-message-in-fb' => '在 <b>$1</b> 於倚靠語言中的現行字串 ($2):', |
| 201 | +); |
| 202 | + |
| 203 | +$wgTranslateMessages['zh-cn'] = $wgTranslateMessages['zh-hans']; |
| 204 | +$wgTranslateMessages['zh-hk'] = $wgTranslateMessages['zh-hant']; |
| 205 | +$wgTranslateMessages['zh-sg'] = $wgTranslateMessages['zh-hans']; |
| 206 | +$wgTranslateMessages['zh-tw'] = $wgTranslateMessages['zh-hant']; |
| 207 | +$wgTranslateMessages['zh-yue'] = $wgTranslateMessages['yue']; |
Index: trunk/extensions/Translate/TranslateEditAddons.php |
— | — | @@ -33,6 +33,8 @@ |
34 | 34 | $rows = count(explode("\n", $msg)) -1; |
35 | 35 | $rows = max(3, min(15, $rows)); |
36 | 36 | |
| 37 | + wfLoadExtensionMessages( 'Translate' ); |
| 38 | + |
37 | 39 | return |
38 | 40 | wfMsg( $i18nmsg, $names[$code], $prettyCode ) . " " . |
39 | 41 | Xml::Element( 'textarea', array( 'rows' => $rows ), $msg ); |
Index: trunk/extensions/Translate/Translate.php |
— | — | @@ -12,7 +12,7 @@ |
13 | 13 | |
14 | 14 | $wgExtensionCredits['specialpage'][] = array( |
15 | 15 | 'name' => 'Translate', |
16 | | - 'version' => '4.0-rc2', |
| 16 | + 'version' => '4.0-rc3', |
17 | 17 | 'author' => 'Niklas Laxström', |
18 | 18 | 'description' => 'Special page for translating Mediawiki and beyond' |
19 | 19 | ); |
— | — | @@ -55,6 +55,7 @@ |
56 | 56 | 'ext-citespecial' => 'CiteSpecialMessageGroup', |
57 | 57 | 'ext-confiraccount' => 'ConfirmAccountMessageGroup', |
58 | 58 | 'ext-confirmedit' => 'ConfirmEditMessageGroup', |
| 59 | +'ext-contactpage' => 'ContactPageExtensionGroup', |
59 | 60 | 'ext-contributors' => 'ContributorsMessageGroup', |
60 | 61 | 'ext-countedits' => 'CountEditsMessageGroup', |
61 | 62 | 'ext-crossnamespacelinks' => 'CrossNamespaceLinksMessageGroup', |
— | — | @@ -74,6 +75,7 @@ |
75 | 76 | 'ext-makevalidate' => 'MakeValidateMessageGroup', |
76 | 77 | 'ext-minidonation' => 'MiniDonationMessageGroup', |
77 | 78 | 'ext-minimumnamelength' => 'MinimumNameLengthMessageGroup', |
| 79 | +'ext-newestpages' => 'NewestPagesMessageGroup', |
78 | 80 | 'ext-newuserlog' => 'NewuserLogMessageGroup', |
79 | 81 | 'ext-ogghandler' => 'OggHandlerMessageGroup', |
80 | 82 | 'ext-patroller' => 'PatrollerMessageGroup', |
Index: trunk/extensions/Translate/TranslateTasks.php |
— | — | @@ -32,6 +32,7 @@ |
33 | 33 | |
34 | 34 | } |
35 | 35 | |
| 36 | + |
36 | 37 | abstract class TranslateTask { |
37 | 38 | abstract function getId(); |
38 | 39 | public function getLabel() { |
— | — | @@ -155,7 +156,7 @@ |
156 | 157 | |
157 | 158 | protected function filterTranslated() { |
158 | 159 | foreach ( $this->messages as $key => $o ) { |
159 | | - if ( ($o['database'] !== null || $o['infile'] !== null ) && !strstr($o['infile'], '!!FUZZY!!') ) { |
| 160 | + if ( ($o['database'] !== null || $o['infile'] !== null ) && !strstr($o['infile'], '!!FUZZY!!') ) { |
160 | 161 | unset( $this->messages[$key] ); |
161 | 162 | } |
162 | 163 | } |
Index: trunk/extensions/Translate/MessageGroups.php |
— | — | @@ -139,8 +139,12 @@ |
140 | 140 | } |
141 | 141 | |
142 | 142 | foreach ( $array as $key => $value ) { |
143 | | - $array[$key]['infile'] = isset( $infile[$key] ) ? $infile[$key] : null; |
144 | | - $array[$key]['fallback'] = isset( $infbfile[$key] ) ? $infbfile[$key] : null; |
| 143 | + if ( isset($infile[$key]) ) { |
| 144 | + $array[$key]['infile'] = $infile[$key]; |
| 145 | + } |
| 146 | + if ( isset($infbfile[$key]) ) { |
| 147 | + $array[$key]['fallback'] = $infbfile[$key]; |
| 148 | + } |
145 | 149 | } |
146 | 150 | } |
147 | 151 | } |
— | — | @@ -253,10 +257,12 @@ |
254 | 258 | } |
255 | 259 | |
256 | 260 | foreach ( $array as $key => $value ) { |
257 | | - $array[$key]['infile'] = isset( $this->msgArray[$code][$key] ) ? |
258 | | - $this->msgArray[$code][$key] : null; |
259 | | - $array[$key]['infbfile'] = isset( $this->msgArray[$fbcode][$key] ) ? |
260 | | - $this->msgArray[$fbcode][$key] : null; |
| 261 | + if ( isset($this->msgArray[$code][$key]) ) { |
| 262 | + $array[$key]['infile'] = $this->msgArray[$code][$key]; |
| 263 | + } |
| 264 | + if ( isset($this->msgArray[$fbcode][$key]) ) { |
| 265 | + $array[$key]['infbfile'] = $this->msgArray[$fbcode][$key]; |
| 266 | + } |
261 | 267 | } |
262 | 268 | } |
263 | 269 | |
— | — | @@ -305,12 +311,9 @@ |
306 | 312 | |
307 | 313 | private $classes = null; |
308 | 314 | |
309 | | - function __construct() {} |
310 | | - |
311 | 315 | private function init() { |
312 | 316 | if ( $this->classes === null ) { |
313 | | - $MG = MessageGroups::singleton(); |
314 | | - $this->classes = $MG->getGroups(); |
| 317 | + $this->classes = MessageGroups::singleton()->getGroups(); |
315 | 318 | foreach ( $this->classes as $index => $class ) { |
316 | 319 | if ( (strpos( $class->getId(), 'ext-' ) !== 0) || (strpos( $class->getId(), 'ext-0' ) === 0) ) { |
317 | 320 | unset( $this->classes[$index] ); |
— | — | @@ -319,6 +322,27 @@ |
320 | 323 | } |
321 | 324 | } |
322 | 325 | |
| 326 | + protected function load( $code = '' ) { |
| 327 | + if ( $code === '' ) return; |
| 328 | + |
| 329 | + $this->init(); |
| 330 | + |
| 331 | + foreach ( $this->classes as $class ) { |
| 332 | + $class->load( $code ); |
| 333 | + } |
| 334 | + |
| 335 | + } |
| 336 | + |
| 337 | + public function getMessage( $key, $code ) { |
| 338 | + $this->load( $code ); |
| 339 | + $msg = null; |
| 340 | + foreach ( $this->classes as $class ) { |
| 341 | + $msg = $class->getMessage( $key, $code ); |
| 342 | + if ( $msg !== null ) return $msg; |
| 343 | + } |
| 344 | + return null; |
| 345 | + } |
| 346 | + |
323 | 347 | function getDefinitions() { |
324 | 348 | $this->init(); |
325 | 349 | $array = array(); |
— | — | @@ -329,14 +353,18 @@ |
330 | 354 | } |
331 | 355 | |
332 | 356 | function export( &$array, $code ) { |
333 | | - $this->msgArray['en'] = $this->getDefinitions(); |
334 | | - parent::export( &$array, $code ); |
| 357 | + $this->init(); |
| 358 | + $ret = ''; |
| 359 | + foreach ( $this->classes as $class ) { |
| 360 | + $ret .= $class->export( &$array, $code ) . "\n\n\n"; |
| 361 | + } |
| 362 | + return $ret; |
335 | 363 | } |
336 | 364 | |
337 | | - function fill( &$array, $language ) { |
| 365 | + function fill( &$array, $code ) { |
338 | 366 | $this->init(); |
339 | 367 | foreach ( $this->classes as $class ) { |
340 | | - $class->fill( &$array, $language ); |
| 368 | + $class->fill( &$array, $code ); |
341 | 369 | } |
342 | 370 | } |
343 | 371 | |
— | — | @@ -516,6 +544,21 @@ |
517 | 545 | protected $exportPad = 30; |
518 | 546 | } |
519 | 547 | |
| 548 | +class ContactPageExtensionGroup extends MultipleFileMessageGroup { |
| 549 | + protected $label = 'Extension: Contact Page'; |
| 550 | + protected $id = 'ext-contactpage'; |
| 551 | + |
| 552 | + protected $arrName = 'messages'; |
| 553 | + protected $messageFile = 'ContactPage/ContactPage.i18n.php'; |
| 554 | + protected $filePattern = 'ContactPage/ContactPage.i18n.$CODE.php'; |
| 555 | + |
| 556 | + protected $exportStart = '$messages[\'$CODE\'] = array('; |
| 557 | + protected $exportLineP = ''; |
| 558 | + protected $exportEnd = '),'; |
| 559 | + |
| 560 | +} |
| 561 | + |
| 562 | + |
520 | 563 | class ContributorsMessageGroup extends ExtensionMessageGroup { |
521 | 564 | protected $label = 'Extension: Contributors'; |
522 | 565 | protected $id = 'ext-contributors'; |
— | — | @@ -748,6 +791,18 @@ |
749 | 792 | protected $exportEnd = '),'; |
750 | 793 | } |
751 | 794 | |
| 795 | +class NewestPagesMessageGroup extends ExtensionMessageGroup { |
| 796 | + protected $label = 'Extension: Newest Pages'; |
| 797 | + protected $id = 'ext-newestpages'; |
| 798 | + |
| 799 | + protected $functionName = 'efNewestPagesMessages'; |
| 800 | + protected $messageFile = 'NewestPages/NewestPages.i18n.php'; |
| 801 | + |
| 802 | + protected $exportStart = '\'$CODE\' => array('; |
| 803 | + protected $exportLineP = ''; |
| 804 | + protected $exportEnd = '),'; |
| 805 | +} |
| 806 | + |
752 | 807 | class NewuserLogMessageGroup extends ExtensionMessageGroup { |
753 | 808 | protected $label = 'Extension: Newuser Log'; |
754 | 809 | protected $id = 'ext-newuserlog'; |
— | — | @@ -961,9 +1016,10 @@ |
962 | 1017 | $this->load( $code ); |
963 | 1018 | |
964 | 1019 | foreach ( $array as $key => $value ) { |
965 | | - $infile = isset($this->msgArray[$code][$key]) ? $this->msgArray[$code][$key] : null ; |
966 | 1020 | $array[$key]['definition'] = $this->msgArray['en'][$key]; |
967 | | - $array[$key]['infile'] = $infile; |
| 1021 | + if ( isset($this->msgArray[$code][$key]) ) { |
| 1022 | + $array[$key]['infile'] = $this->msgArray[$code][$key]; |
| 1023 | + } |
968 | 1024 | } |
969 | 1025 | } |
970 | 1026 | |