Index: trunk/extensions/Translate/MessageCollection.php |
— | — | @@ -24,23 +24,23 @@ |
25 | 25 | /// \type{MessageDefinitions} |
26 | 26 | protected $definitions = null; |
27 | 27 | |
28 | | - /// \arrayof{String,String} Message key => translation. |
| 28 | + /// \arrayof{String,String} %Message key => translation. |
29 | 29 | protected $infile = array(); |
30 | 30 | |
31 | 31 | // Keys and messages. |
32 | 32 | |
33 | | - /// \arrayof{String,String} Message key => database key. |
| 33 | + /// \arrayof{String,String} %Message display key => database key. |
34 | 34 | protected $keys = null; |
35 | 35 | |
36 | | - /// \arrayof{String,TMessage} Message key => messages. |
| 36 | + /// \arrayof{String,TMessage} %Message key => messages. |
37 | 37 | protected $messages = null; |
38 | 38 | |
39 | 39 | // Database resources |
40 | 40 | |
41 | | - // existence, fuzzy |
| 41 | + /// \type{Database Result Resource} Stored message existence and fuzzy state. |
42 | 42 | protected $dbInfo = null; |
43 | 43 | |
44 | | - // all translations |
| 44 | + /// \type{Database Result Resource} Stored translations in database. |
45 | 45 | protected $dbData = null; |
46 | 46 | |
47 | 47 | /** |
— | — | @@ -73,27 +73,60 @@ |
74 | 74 | return $collection; |
75 | 75 | } |
76 | 76 | |
| 77 | + /** |
| 78 | + * Constructs a new empty message collection. Suitable for example for testing. |
| 79 | + * @param $code \string Language Code. |
| 80 | + * @return \type{MessageCollection} |
| 81 | + */ |
| 82 | + public static function newEmpty( $code ) { |
| 83 | + |
| 84 | + } |
| 85 | + |
77 | 86 | // Data setters |
78 | 87 | |
| 88 | + /** |
| 89 | + * Set translation from file, as opposed to translation which only exists |
| 90 | + * in the wiki because they are not exported and committed yet. |
| 91 | + * @param $messages \arrayof{String,String} Array of translations indexed |
| 92 | + * by display key. |
| 93 | + */ |
79 | 94 | public function setInfile( array $messages ) { |
80 | 95 | $this->infile = $messages; |
81 | 96 | } |
82 | 97 | |
| 98 | + /** |
| 99 | + * Set message tags. |
| 100 | + * @param $type \string Tag type, usually ignored or optional. |
| 101 | + * @param $keys \list{String} List of display keys. |
| 102 | + */ |
83 | 103 | public function setTags( $type, array $keys ) { |
84 | 104 | $this->tags[$type] = $keys; |
85 | 105 | } |
86 | 106 | |
87 | 107 | /** |
88 | | - * Data getters |
| 108 | + * Returns list of available message keys. This is affected by filtering. |
| 109 | + * @return \arrayof{String,String} List of database keys indexed by display keys. |
89 | 110 | */ |
90 | 111 | public function keys() { |
91 | 112 | return $this->keys; |
92 | 113 | } |
93 | 114 | |
| 115 | + /** |
| 116 | + * Returns stored message tags. |
| 117 | + * @param $type \string Tag type, usually optional or ignored. |
| 118 | + * @return \types{\list{String},\null} List of keys or null if no tags. |
| 119 | + * @todo Return empty array instead? |
| 120 | + */ |
94 | 121 | public function getTags( $type ) { |
95 | 122 | return isset( $this->tags[$type] ) ? $this->tags[$type] : null; |
96 | 123 | } |
97 | 124 | |
| 125 | + /** |
| 126 | + * Lists all translators that have contributed to the latest revisions of |
| 127 | + * each translation. Causes translations to be loaded from the database. |
| 128 | + * Is not affected by filters. |
| 129 | + * @return \list{String} List of usernames. |
| 130 | + */ |
98 | 131 | public function getAuthors() { |
99 | 132 | global $wgTranslateFuzzyBotName; |
100 | 133 | |
— | — | @@ -102,9 +135,7 @@ |
103 | 136 | $authors = array_flip( $this->authors ); |
104 | 137 | |
105 | 138 | foreach ( $this->messages as $m ) { |
106 | | - /** |
107 | | - * Check if there are authors |
108 | | - */ |
| 139 | + // Check if there are authors |
109 | 140 | $author = $m->author(); |
110 | 141 | |
111 | 142 | if ( $author === null ) { |
— | — | @@ -129,7 +160,13 @@ |
130 | 161 | return isset( $filteredAuthors ) ? $filteredAuthors : array(); |
131 | 162 | } |
132 | 163 | |
133 | | - public function addCollectionAuthors( /*list*/$authors, $mode = 'append' ) { |
| 164 | + /** |
| 165 | + * Add external authors (usually from the file). |
| 166 | + * @param $authors \list{String} List of authors. |
| 167 | + * @param $mode \string Either append or set authors. |
| 168 | + * @throws MWException If invalid $mode given. |
| 169 | + */ |
| 170 | + public function addCollectionAuthors( $authors, $mode = 'append' ) { |
134 | 171 | switch( $mode ) { |
135 | 172 | case 'append': |
136 | 173 | $authors = array_merge( $this->authors, $authors ); |
— | — | @@ -143,10 +180,12 @@ |
144 | 181 | $this->authors = array_unique( $authors ); |
145 | 182 | } |
146 | 183 | |
| 184 | + // Data modifiers |
| 185 | + |
147 | 186 | /** |
148 | | - * Data modifiers |
| 187 | + * Loads all message data. Must be called before accessing the messages |
| 188 | + * with ArrayAccess or iteration. |
149 | 189 | */ |
150 | | - |
151 | 190 | public function loadTranslations() { |
152 | 191 | $this->loadData( $this->keys ); |
153 | 192 | $this->loadInfo( $this->keys ); |
— | — | @@ -154,6 +193,29 @@ |
155 | 194 | } |
156 | 195 | |
157 | 196 | /** |
| 197 | + * Some statistics scripts for example loop the same collection over every |
| 198 | + * language. This is a shortcut which keeps tags and definitions. |
| 199 | + */ |
| 200 | + public function resetForNewLanguage( $code ) { |
| 201 | + $this->code = $code; |
| 202 | + $this->keys = $this->fixKeys( array_keys( $this->definitions->messages ) ); |
| 203 | + $this->dbInfo = null; |
| 204 | + $this->dbData = null; |
| 205 | + $this->messages = null; |
| 206 | + $this->infile = array(); |
| 207 | + $this->authors = array(); |
| 208 | + |
| 209 | + unset( $this->tags['fuzzy'] ); |
| 210 | + } |
| 211 | + |
| 212 | + /** |
| 213 | + * For paging messages. One can count messages before and after slice. |
| 214 | + */ |
| 215 | + public function slice( $offset, $limit ) { |
| 216 | + $this->keys = array_slice( $this->keys, $offset, $limit, true ); |
| 217 | + } |
| 218 | + |
| 219 | + /** |
158 | 220 | * Filters messages based on some condition. Some filters cause data to be |
159 | 221 | * loaded from the database. PAGEINFO: existence and fuzzy tags. |
160 | 222 | * TRANSLATIONS: translations for every message. It is recommended to first |
— | — | @@ -161,14 +223,19 @@ |
162 | 224 | * translations from file with addInfile, and it is needed for changed |
163 | 225 | * filter to work. |
164 | 226 | * |
165 | | - * @param $type |
166 | | - * fuzzy: messages with fuzzy tag (PAGEINFO) |
167 | | - * optional: messages marked for optional. |
168 | | - * ignored: messages which are not for translation. |
169 | | - * hastranslation: messages which have translation (be if fuzzy or not) (PAGEINFO, *INFILE). |
170 | | - * translated: messages which have translation which is not fuzzy (PAGEINFO, *INFILE). |
171 | | - * changed: translation in database differs from infile. (INFILE, TRANSLATIONS) |
172 | | - * @param $condition True or false. |
| 227 | + * @param $type \string |
| 228 | + * - fuzzy: messages with fuzzy tag (PAGEINFO) |
| 229 | + * - optional: messages marked for optional. |
| 230 | + * - ignored: messages which are not for translation. |
| 231 | + * - hastranslation: messages which have translation (be if fuzzy or not) |
| 232 | + * (PAGEINFO, *INFILE). |
| 233 | + * - translated: messages which have translation which is not fuzzy |
| 234 | + * (PAGEINFO, *INFILE). |
| 235 | + * - changed: translation in database differs from infile. |
| 236 | + * (INFILE, TRANSLATIONS) |
| 237 | + * @param $condition \bool Whether to return messages which do not satisfy |
| 238 | + * the given filter condition (true), or only which do (false). |
| 239 | + * @throws \type{MWException} If given invalid filter name. |
173 | 240 | */ |
174 | 241 | public function filter( $type, $condition = true ) { |
175 | 242 | switch( $type ) { |
— | — | @@ -186,31 +253,11 @@ |
187 | 254 | } |
188 | 255 | |
189 | 256 | /** |
190 | | - * Some statistics scripts for example loop the same collection over every |
191 | | - * language. This is a shortcut which keeps tags and definitions. |
| 257 | + * Really apply a filter. Some filters need multiple conditions. |
| 258 | + * @param $filter \string Filter name. |
| 259 | + * @param $condition \bool Whether to return messages which do not satisfy |
| 260 | + * the given filter condition (true), or only which do (false). |
192 | 261 | */ |
193 | | - public function resetForNewLanguage( $code ) { |
194 | | - $this->code = $code; |
195 | | - $this->keys = $this->fixKeys( array_keys( $this->definitions->messages ) ); |
196 | | - $this->dbInfo = null; |
197 | | - $this->dbData = null; |
198 | | - $this->messages = null; |
199 | | - $this->infile = array(); |
200 | | - $this->authors = array(); |
201 | | - |
202 | | - unset( $this->tags['fuzzy'] ); |
203 | | - } |
204 | | - |
205 | | - /** |
206 | | - * For paging messages. One can count messages before and after slice. |
207 | | - */ |
208 | | - public function slice( $offset, $limit ) { |
209 | | - $this->keys = array_slice( $this->keys, $offset, $limit, true ); |
210 | | - } |
211 | | - |
212 | | - /** |
213 | | - * Protected functions |
214 | | - */ |
215 | 262 | protected function applyFilter( $filter, $condition ) { |
216 | 263 | $keys = $this->keys; |
217 | 264 | if ( $filter === 'fuzzy' ) { |
— | — | @@ -220,17 +267,13 @@ |
221 | 268 | } elseif ( $filter === 'translated' ) { |
222 | 269 | $fuzzy = $this->filterFuzzy( $keys, false ); |
223 | 270 | $hastranslation = $this->filterHastranslation( $keys, false ); |
224 | | - /** |
225 | | - * Fuzzy messages are not counted as translated messages |
226 | | - */ |
| 271 | + // Fuzzy messages are not counted as translated messages |
227 | 272 | $translated = $this->filterOnCondition( $hastranslation, $fuzzy ); |
228 | 273 | $keys = $this->filterOnCondition( $keys, $translated, $condition ); |
229 | 274 | } elseif ( $filter === 'changed' ) { |
230 | 275 | $keys = $this->filterChanged( $keys, $condition ); |
231 | 276 | } else { |
232 | | - /** |
233 | | - * Filter based on tags. |
234 | | - */ |
| 277 | + // Filter based on tags. |
235 | 278 | if ( !isset( $this->tags[$filter] ) ) { |
236 | 279 | if ( $filter !== 'optional' && $filter !== 'ignored' ) { |
237 | 280 | throw new MWException( "No tagged messages for custom filter $filter" ); |
— | — | @@ -245,6 +288,21 @@ |
246 | 289 | $this->keys = $keys; |
247 | 290 | } |
248 | 291 | |
| 292 | + /** |
| 293 | + * Filters list of keys with other list of keys according to the condition. |
| 294 | + * In other words, you have a list of keys, and you have determined list of |
| 295 | + * keys that have some feature. Now you can either take messages that are |
| 296 | + * both in the first list and the second list OR are in the first list but |
| 297 | + * are not in the second list (conditition = true and false respectively). |
| 298 | + * What makes this more complex is that second list of keys might not be a |
| 299 | + * subset of the first list of keys. |
| 300 | + * @param $keys \list{String} List of keys to filter. |
| 301 | + * @param $condKeys \list{String} Second list of keys for filtering. |
| 302 | + * @param $condition \bool True (default) to return keys which are on first |
| 303 | + * and second list, false to return keys which are on the first but not on |
| 304 | + * second. |
| 305 | + * @return \list{String} Filtered keys. |
| 306 | + */ |
249 | 307 | protected function filterOnCondition( array $keys, array $condKeys, $condition = true ) { |
250 | 308 | if ( $condition === true ) { |
251 | 309 | /** |
— | — | @@ -267,6 +325,13 @@ |
268 | 326 | return $keys; |
269 | 327 | } |
270 | 328 | |
| 329 | + /** |
| 330 | + * Filters list of keys according to whether the translation is fuzzy. |
| 331 | + * @param $keys \list{String} List of keys to filter. |
| 332 | + * @param $condition \bool True to filter away fuzzy translations, false |
| 333 | + * to filter non-fuzzy translations. |
| 334 | + * @return \list{String} Filtered keys. |
| 335 | + */ |
271 | 336 | protected function filterFuzzy( array $keys, $condition ) { |
272 | 337 | $this->loadInfo( $keys ); |
273 | 338 | |
— | — | @@ -293,6 +358,13 @@ |
294 | 359 | return $keys; |
295 | 360 | } |
296 | 361 | |
| 362 | + /** |
| 363 | + * Filters list of keys according to whether they have a translation. |
| 364 | + * @param $keys \list{String} List of keys to filter. |
| 365 | + * @param $condition \bool True to filter away translated, false |
| 366 | + * to filter untranslated. |
| 367 | + * @return \list{String} Filtered keys. |
| 368 | + */ |
297 | 369 | protected function filterHastranslation( array $keys, $condition ) { |
298 | 370 | $this->loadInfo( $keys ); |
299 | 371 | |
— | — | @@ -303,9 +375,7 @@ |
304 | 376 | $flipKeys = array_flip( $keys ); |
305 | 377 | |
306 | 378 | foreach ( $this->dbInfo as $row ) { |
307 | | - /** |
308 | | - * Remove messages which have a translation from keys |
309 | | - */ |
| 379 | + // Remove messages which have a translation from keys |
310 | 380 | if ( !isset( $flipKeys[$row->page_title] ) ) { |
311 | 381 | continue; |
312 | 382 | } |
— | — | @@ -313,16 +383,12 @@ |
314 | 384 | unset( $keys[$flipKeys[$row->page_title]] ); |
315 | 385 | } |
316 | 386 | |
317 | | - /** |
318 | | - * Check also if there is something in the file that is not yet in the db |
319 | | - */ |
| 387 | + // Check also if there is something in the file that is not yet in the database |
320 | 388 | foreach ( array_keys( $this->infile ) as $inf ) { |
321 | 389 | unset( $keys[$inf] ); |
322 | 390 | } |
323 | 391 | |
324 | | - /** |
325 | | - * Remove the messages which do not have a translation from the list |
326 | | - */ |
| 392 | + // Remove the messages which do not have a translation from the list |
327 | 393 | if ( $condition === false ) { |
328 | 394 | $keys = array_diff( $origKeys, $keys ); |
329 | 395 | } |
— | — | @@ -330,6 +396,14 @@ |
331 | 397 | return $keys; |
332 | 398 | } |
333 | 399 | |
| 400 | + /** |
| 401 | + * Filters list of keys according to whether the current translation |
| 402 | + * differs from the commited translation. |
| 403 | + * @param $keys \list{String} List of keys to filter. |
| 404 | + * @param $condition \bool True to filter changed translations, false |
| 405 | + * to filter unchanged translations. |
| 406 | + * @return \list{String} Filtered keys. |
| 407 | + */ |
334 | 408 | protected function filterChanged( array $keys, $condition ) { |
335 | 409 | $this->loadData( $keys ); |
336 | 410 | |
— | — | @@ -347,23 +421,25 @@ |
348 | 422 | |
349 | 423 | $text = Revision::getRevisionText( $row ); |
350 | 424 | if ( $this->infile[$realKey] === $text ) { |
351 | | - /** |
352 | | - * Remove changed messages from the list |
353 | | - */ |
| 425 | + // Remove unchanged messages from the list |
354 | 426 | unset( $keys[$realKey] ); |
355 | 427 | } |
356 | 428 | } |
357 | 429 | |
358 | | - /** |
359 | | - * Remove the messages which have not changed from the list |
360 | | - */ |
| 430 | + // Remove the messages which have not changed from the list |
361 | 431 | if ( $condition === false ) { |
362 | 432 | $keys = $this->filterOnCondition( $keys, $origKeys, false ); |
363 | 433 | } |
364 | 434 | |
365 | 435 | return $keys; |
366 | 436 | } |
| 437 | + /** @} */ |
367 | 438 | |
| 439 | + /** |
| 440 | + * Takes list of keys and converts them into database format. |
| 441 | + * @param $keys \list{String} List of keys in display format. |
| 442 | + * @return \arrayof{String,String} Array of keys in database format indexed by display format. |
| 443 | + */ |
368 | 444 | protected function fixKeys( array $keys ) { |
369 | 445 | $newkeys = array(); |
370 | 446 | $namespace = $this->definitions->namespace; |
— | — | @@ -380,14 +456,15 @@ |
381 | 457 | return $newkeys; |
382 | 458 | } |
383 | 459 | |
| 460 | + /** |
| 461 | + * Loads existence and fuzzy state for given list of keys. |
| 462 | + * @param $keys \list{String} List of keys in database format. |
| 463 | + */ |
384 | 464 | protected function loadInfo( array $keys ) { |
385 | 465 | if ( $this->dbInfo !== null ) { |
386 | 466 | return; |
387 | 467 | } |
388 | 468 | |
389 | | - /** |
390 | | - * Something iterable |
391 | | - */ |
392 | 469 | $this->dbInfo = array(); |
393 | 470 | |
394 | 471 | if ( !count( $keys ) ) { |
— | — | @@ -417,14 +494,15 @@ |
418 | 495 | $this->dbInfo = $dbr->select( $tables, $fields, $conds, __METHOD__, array(), $joins ); |
419 | 496 | } |
420 | 497 | |
| 498 | + /** |
| 499 | + * Loads translation for given list of keys. |
| 500 | + * @param $keys \list{String} List of keys in database format. |
| 501 | + */ |
421 | 502 | protected function loadData( $keys ) { |
422 | 503 | if ( $this->dbData !== null ) { |
423 | 504 | return; |
424 | 505 | } |
425 | 506 | |
426 | | - /** |
427 | | - * Something iterable |
428 | | - */ |
429 | 507 | $this->dbData = array(); |
430 | 508 | |
431 | 509 | if ( !count( $keys ) ) { |
— | — | @@ -447,6 +525,10 @@ |
448 | 526 | $this->dbData = $res; |
449 | 527 | } |
450 | 528 | |
| 529 | + /** |
| 530 | + * Constructs all TMessages from the data accumulated so far. |
| 531 | + * Usually there is no need to call this method directly. |
| 532 | + */ |
451 | 533 | public function initMessages() { |
452 | 534 | if ( $this->messages !== null ) { |
453 | 535 | return; |
— | — | @@ -460,9 +542,7 @@ |
461 | 543 | |
462 | 544 | $flipKeys = array_flip( $this->keys ); |
463 | 545 | |
464 | | - /** |
465 | | - * Copy rows if any. |
466 | | - */ |
| 546 | + // Copy rows if any. |
467 | 547 | if ( $this->dbData !== null ) { |
468 | 548 | foreach ( $this->dbData as $row ) { |
469 | 549 | if ( !isset( $flipKeys[$row->page_title] ) ) { |
— | — | @@ -489,9 +569,7 @@ |
490 | 570 | $this->setTags( 'fuzzy', $fuzzy ); |
491 | 571 | } |
492 | 572 | |
493 | | - /** |
494 | | - * Copy tags if any. |
495 | | - */ |
| 573 | + // Copy tags if any. |
496 | 574 | foreach ( $this->tags as $type => $keys ) { |
497 | 575 | foreach ( $keys as $key ) { |
498 | 576 | if ( isset( $messages[$key] ) ) { |
— | — | @@ -500,9 +578,7 @@ |
501 | 579 | } |
502 | 580 | } |
503 | 581 | |
504 | | - /** |
505 | | - * Copy infile if any. |
506 | | - */ |
| 582 | + // Copy infile if any. |
507 | 583 | foreach ( $this->infile as $key => $value ) { |
508 | 584 | if ( isset( $messages[$key] ) ) { |
509 | 585 | $messages[$key]->setInfile( $value ); |
— | — | @@ -513,12 +589,8 @@ |
514 | 590 | } |
515 | 591 | |
516 | 592 | /** |
517 | | - * Interfaces etc. |
| 593 | + * ArrayAccess methods. @{ |
518 | 594 | */ |
519 | | - |
520 | | - /** |
521 | | - * ArrayAccess methods |
522 | | - */ |
523 | 595 | public function offsetExists( $offset ) { |
524 | 596 | return isset( $this->keys[$offset] ); |
525 | 597 | } |
— | — | @@ -534,23 +606,22 @@ |
535 | 607 | public function offsetUnset( $offset ) { |
536 | 608 | unset( $this->keys[$offset] ); |
537 | 609 | } |
| 610 | + /** @} */ |
538 | 611 | |
539 | 612 | /** |
540 | | - * Fail fast |
| 613 | + * Fail fast if trying to access unknown properties. @{ |
541 | 614 | */ |
542 | 615 | public function __get( $name ) { |
543 | 616 | throw new MWException( __METHOD__ . ": Trying to access unknown property $name" ); |
544 | 617 | } |
545 | 618 | |
546 | | - /** |
547 | | - * Fail fast |
548 | | - */ |
549 | 619 | public function __set( $name, $value ) { |
550 | 620 | throw new MWException( __METHOD__ . ": Trying to modify unknown property $name" ); |
551 | 621 | } |
| 622 | + /** @} */ |
552 | 623 | |
553 | 624 | /** |
554 | | - * Iterator methods |
| 625 | + * Iterator method. @{ |
555 | 626 | */ |
556 | 627 | public function rewind() { |
557 | 628 | reset( $this->keys ); |
— | — | @@ -579,10 +650,14 @@ |
580 | 651 | public function count() { |
581 | 652 | return count( $this->keys() ); |
582 | 653 | } |
| 654 | + /** @} */ |
| 655 | + |
583 | 656 | } |
584 | 657 | |
585 | 658 | /** |
586 | | - * @todo Documentation needed. |
| 659 | + * Wrapper for message definitions, just to beauty the code. |
| 660 | + * This is one reason why message collections and thus message groups are |
| 661 | + * restricted into single namespace. |
587 | 662 | */ |
588 | 663 | class MessageDefinitions { |
589 | 664 | public $namespace; |
— | — | @@ -592,14 +667,3 @@ |
593 | 668 | $this->messages = $messages; |
594 | 669 | } |
595 | 670 | } |
596 | | - |
597 | | -/** |
598 | | - * @todo Documentation needed. |
599 | | - */ |
600 | | -class TestMessageCollection extends MessageCollection { |
601 | | - public function __construct( $code ) { |
602 | | - $this->code = $code; |
603 | | - $this->definitions = array(); |
604 | | - $this->keys = array(); |
605 | | - } |
606 | | -} |
Index: trunk/extensions/Translate/scripts/magic-export.php |
— | — | @@ -8,6 +8,8 @@ |
9 | 9 | * @file |
10 | 10 | */ |
11 | 11 | |
| 12 | +/// @cond |
| 13 | + |
12 | 14 | $optionsWithArgs = array( 'target', 'type' ); |
13 | 15 | require( dirname( __FILE__ ) . '/cli.inc' ); |
14 | 16 | |
— | — | @@ -104,3 +106,5 @@ |
105 | 107 | wfMkdirParents( dirname( $options['target'] . "/$filename" ) ); |
106 | 108 | file_put_contents( $options['target'] . "/$filename", trim( $output ) . "\n" ); |
107 | 109 | } |
| 110 | + |
| 111 | +/// @endcond |
\ No newline at end of file |
Index: trunk/extensions/Translate/scripts/pagetranslation-test-parser.php |
— | — | @@ -44,7 +44,7 @@ |
45 | 45 | try { |
46 | 46 | $parse = $translatablePage->getParse(); |
47 | 47 | if ( $failureExpected ) { |
48 | | - $target = $parse->getTranslationPageText( new TestMessageCollection( "foo" ) ); |
| 48 | + $target = $parse->getTranslationPageText( MessageCollection::newEmpty( "foo" ) ); |
49 | 49 | $this->output( "Testfile $filename should have failed... see $pattern.pttarget.fail\n" ); |
50 | 50 | file_put_contents( "$pattern.pttarget.fail", $target ); |
51 | 51 | } |
— | — | @@ -65,7 +65,7 @@ |
66 | 66 | } |
67 | 67 | |
68 | 68 | if ( file_exists( "$pattern.pttarget" ) ) { |
69 | | - $target = $parse->getTranslationPageText( new TestMessageCollection( "foo" ) ); |
| 69 | + $target = $parse->getTranslationPageText( MessageCollection::newEmpty( "foo" ) ); |
70 | 70 | if ( $target !== file_get_contents( "$pattern.pttarget" ) ) { |
71 | 71 | $this->output( "Testfile $filename failed with target page output... writing $pattern.pttarget.fail\n" ); |
72 | 72 | file_put_contents( "$pattern.pttarget.fail", $target ); |
Index: trunk/extensions/Translate/_autoload.php |
— | — | @@ -35,7 +35,6 @@ |
36 | 36 | |
37 | 37 | $wgAutoloadClasses['MessageCollection'] = $dir . 'MessageCollection.php'; |
38 | 38 | $wgAutoloadClasses['MessageDefinitions'] = $dir . 'MessageCollection.php'; |
39 | | -$wgAutoloadClasses['TestMessageCollection'] = $dir . 'MessageCollection.php'; |
40 | 39 | $wgAutoloadClasses['TMessage'] = $dir . 'Message.php'; |
41 | 40 | $wgAutoloadClasses['ThinMessage'] = $dir . 'Message.php'; |
42 | 41 | $wgAutoloadClasses['FatMessage'] = $dir . 'Message.php'; |