Index: trunk/extensions/Translate/groups/MediaWikiExtensions.php |
— | — | @@ -212,7 +212,7 @@ |
213 | 213 | |
214 | 214 | function getBools() { |
215 | 215 | $this->init(); |
216 | | - $bools = array(); |
| 216 | + $bools = parent::getBools(); |
217 | 217 | foreach ( $this->classes as $class ) { |
218 | 218 | $newbools = ( $class->getBools() ); |
219 | 219 | if ( count($newbools['optional']) || count($newbools['ignored']) ) { |
Index: trunk/extensions/Translate/scripts/createCheckIndex.php |
— | — | @@ -51,15 +51,19 @@ |
52 | 52 | continue; |
53 | 53 | } |
54 | 54 | |
| 55 | + // Initialise messages, using unique definitions if appropriate |
| 56 | + $collection_skel = $g->initCollection( 'en', $g->isMeta() ); |
| 57 | + if ( !count($collection_skel) ) continue; |
| 58 | + |
55 | 59 | STDOUT( "Working with $id: ", $id ); |
56 | 60 | |
57 | 61 | foreach ( $codes as $code ) { |
58 | 62 | STDOUT( "$code ", $id ); |
59 | 63 | |
60 | | - // Initialise messages, using unique definitions if appropriate |
61 | | - $collection = $g->initCollection( $code, $g->isMeta() ); |
| 64 | + $collection = clone $collection_skel; |
| 65 | + $collection->code = $code; |
| 66 | + |
62 | 67 | $g->fillCollection( $collection ); |
63 | | - $namespace = $g->namespaces[0]; |
64 | 68 | |
65 | 69 | foreach ( $collection->keys() as $key ) { |
66 | 70 | $prob = $checker->doFastChecks( $collection[$key], $type, $code ); |
— | — | @@ -67,7 +71,7 @@ |
68 | 72 | |
69 | 73 | if ( $verbose ) { |
70 | 74 | // Print it |
71 | | - $nsText = $wgContLang->getNsText( $namespace ); |
| 75 | + $nsText = $wgContLang->getNsText( $g->namespaces[0] ); |
72 | 76 | STDOUT( "# [[$nsText:$key/$code]]" ); |
73 | 77 | } |
74 | 78 | |
Index: trunk/extensions/Translate/Message.php |
— | — | @@ -17,6 +17,10 @@ |
18 | 18 | * translation target language. |
19 | 19 | */ |
20 | 20 | class MessageCollection implements Iterator, ArrayAccess, Countable { |
| 21 | + /** |
| 22 | + * Information of what type of MessageCollection this is. |
| 23 | + */ |
| 24 | + public $code = null; |
21 | 25 | |
22 | 26 | /** |
23 | 27 | * Messages are stored in an array. |
— | — | @@ -24,11 +28,6 @@ |
25 | 29 | private $messages = array(); |
26 | 30 | |
27 | 31 | /** |
28 | | - * Information of what type of MessageCollection this is. |
29 | | - */ |
30 | | - public $code = null; |
31 | | - |
32 | | - /** |
33 | 32 | * Creates new empty messages collection. |
34 | 33 | * |
35 | 34 | * @param $code Language code |
— | — | @@ -37,6 +36,12 @@ |
38 | 37 | $this->code = $code; |
39 | 38 | } |
40 | 39 | |
| 40 | + public function __clone() { |
| 41 | + foreach ( $this->messages as $key => $obj ) { |
| 42 | + $this->messages[$key] = clone $obj; |
| 43 | + } |
| 44 | + } |
| 45 | + |
41 | 46 | /* Iterator methods */ |
42 | 47 | public function rewind() { |
43 | 48 | reset($this->messages); |