Index: trunk/extensions/Translate/CreateMessageIndex.php |
— | — | @@ -7,11 +7,27 @@ |
8 | 8 | $groups = MessageGroups::singleton()->getGroups(); |
9 | 9 | |
10 | 10 | $hugearray = array(); |
| 11 | +$postponed = array(); |
11 | 12 | |
12 | 13 | foreach ( $groups as $g ) { |
13 | 14 | # Skip meta thingies |
14 | | - if ( $g->isMeta() ) continue; |
| 15 | + if ( $g->isMeta() ) { |
| 16 | + $postponed[] = $g; |
| 17 | + continue; |
| 18 | + } |
15 | 19 | |
| 20 | + checkAndAdd( $g ); |
| 21 | +} |
| 22 | + |
| 23 | +foreach ( $postponed as $g ) { |
| 24 | + checkAndAdd( $g, true ); |
| 25 | +} |
| 26 | + |
| 27 | +file_put_contents( TRANSLATE_INDEXFILE, serialize( $hugearray ) ); |
| 28 | + |
| 29 | +function checkAndAdd( $g, $ignore = false ) { |
| 30 | + global $hugearray; |
| 31 | + |
16 | 32 | $messages = $g->getDefinitions(); |
17 | 33 | $id = $g->getId(); |
18 | 34 | |
— | — | @@ -30,12 +46,12 @@ |
31 | 47 | # mediawiki forces it to upper case |
32 | 48 | $key = strtolower( "$namespace:$key" ); |
33 | 49 | if ( isset($hugearray[$key]) ) { |
34 | | - echo "Key $key already belongs to $hugearray[$key], conflict with $id\n"; |
| 50 | + if ( !$ignore ) |
| 51 | + echo "Key $key already belongs to $hugearray[$key], conflict with $id\n"; |
35 | 52 | } else { |
36 | 53 | $hugearray[$key] = &$id; |
37 | 54 | } |
38 | 55 | } |
39 | 56 | unset($id); // Disconnect the previous references to this $id |
40 | | -} |
41 | 57 | |
42 | | -file_put_contents( TRANSLATE_INDEXFILE, serialize( $hugearray ) ); |
| 58 | +} |
\ No newline at end of file |