Index: trunk/extensions/Translate/SpecialTranslate.php |
— | — | @@ -394,8 +394,8 @@ |
395 | 395 | global $wgTranslateGroupStructure; |
396 | 396 | |
397 | 397 | $groups = MessageGroups::getAllGroups(); |
| 398 | + |
398 | 399 | $structure = array(); |
399 | | - |
400 | 400 | foreach ( $groups as $id => $o ) { |
401 | 401 | if ( !MessageGroups::getGroup( $id )->exists() ) { |
402 | 402 | continue; |
— | — | @@ -403,24 +403,30 @@ |
404 | 404 | |
405 | 405 | foreach ( $wgTranslateGroupStructure as $pattern => $hypergroup ) { |
406 | 406 | if ( preg_match( $pattern, $id ) ) { |
407 | | - /** |
408 | | - * Emulate deepArraySet, because AFAIK php does not have one |
409 | | - */ |
| 407 | + // Emulate deepArraySet, because AFAIK php does not have one |
410 | 408 | self::deepArraySet( $structure, $hypergroup, $id, $o ); |
411 | | - /** |
412 | | - * We need to continue the outer loop, because we have finished this item. |
413 | | - */ |
| 409 | + // We need to continue the outer loop, because we have finished this item. |
414 | 410 | continue 2; |
415 | 411 | } |
416 | 412 | } |
417 | 413 | |
418 | | - /** |
419 | | - * Does not belong to any subgroup, just shove it into main level. |
420 | | - */ |
| 414 | + // Does not belong to any subgroup, just shove it into main level. |
421 | 415 | $structure[$id] = $o; |
422 | 416 | } |
423 | 417 | |
424 | | - return $structure; |
| 418 | + // Sort top-level groups according to labels, not ids |
| 419 | + foreach ( $structure as $id => $data ) { |
| 420 | + // Either it is a group itself, or the first group of the array |
| 421 | + $nid = is_array( $data ) ? key( $data ) : $id; |
| 422 | + $labels[$id] = $groups[$nid]->getLabel(); |
| 423 | + } |
| 424 | + natcasesort( $labels ); |
| 425 | + |
| 426 | + foreach ( array_keys( $labels ) as $id ) { |
| 427 | + $sorted[$id] = $structure[$id]; |
| 428 | + } |
| 429 | + |
| 430 | + return $sorted; |
425 | 431 | } |
426 | 432 | |
427 | 433 | /** |
Index: trunk/extensions/Translate/groups/Shapado/Shapado.yaml |
— | — | @@ -34,7 +34,7 @@ |
35 | 35 | --- |
36 | 36 | BASIC: |
37 | 37 | id: out-shapado-0-all |
38 | | - label: All Shapado messages |
| 38 | + label: Shapado |
39 | 39 | display: out/shapado |
40 | 40 | meta: yes |
41 | 41 | class: AggregateMessageGroup |
Index: trunk/extensions/Translate/groups/MantisBT/MantisBT.yaml |
— | — | @@ -89,7 +89,7 @@ |
90 | 90 | --- |
91 | 91 | BASIC: |
92 | 92 | id: out-mantis-0-all |
93 | | - label: All MantisBT messages |
| 93 | + label: MantisBT |
94 | 94 | display: out/mantis |
95 | 95 | description: "{{int:bw-desc-mantisbt}}" |
96 | 96 | meta: yes |
— | — | @@ -104,7 +104,7 @@ |
105 | 105 | --- |
106 | 106 | BASIC: |
107 | 107 | id: out-mantis-core |
108 | | - label: MantisBT |
| 108 | + label: MantisBT core messages |
109 | 109 | description: "{{int:bw-desc-mantisbt}}" |
110 | 110 | display: out/mantis/core |
111 | 111 | |
Index: trunk/extensions/Translate/groups/OpenStreetMap/OpenStreetMap.yaml |
— | — | @@ -16,7 +16,7 @@ |
17 | 17 | --- |
18 | 18 | BASIC: |
19 | 19 | id: out-osm-0-all |
20 | | - label: All OpenStreetMap messages |
| 20 | + label: OpenStreetMap |
21 | 21 | description: "{{int:bw-desc-openstreetmap}}" |
22 | 22 | display: out/osm |
23 | 23 | meta: yes |
Index: trunk/extensions/Translate/groups/StatusNet/StatusNet.yaml |
— | — | @@ -28,7 +28,7 @@ |
29 | 29 | --- |
30 | 30 | BASIC: |
31 | 31 | id: out-statusnet-0-all |
32 | | - label: All StatusNet messages |
| 32 | + label: StatusNet |
33 | 33 | display: out/statusnet |
34 | 34 | meta: yes |
35 | 35 | class: AggregateMessageGroup |
Index: trunk/extensions/Translate/groups/Okawix/Okawix.yaml |
— | — | @@ -14,7 +14,7 @@ |
15 | 15 | --- |
16 | 16 | BASIC: |
17 | 17 | id: out-okawix-0-all |
18 | | - label: All Okawix messages |
| 18 | + label: Okawix |
19 | 19 | display: out/okawix |
20 | 20 | meta: yes |
21 | 21 | class: AggregateMessageGroup |
Index: trunk/extensions/Translate/groups/Mifos/Mifos.yaml |
— | — | @@ -23,7 +23,7 @@ |
24 | 24 | --- |
25 | 25 | BASIC: |
26 | 26 | id: out-mifos-0-all |
27 | | - label: All Mifos messages |
| 27 | + label: Mifos |
28 | 28 | meta: yes |
29 | 29 | class: AggregateMessageGroup |
30 | 30 | |
— | — | @@ -33,7 +33,7 @@ |
34 | 34 | --- |
35 | 35 | BASIC: |
36 | 36 | id: out-mifos-core |
37 | | - label: Mifos |
| 37 | + label: Mifos core messages |
38 | 38 | class: FileBasedMessageGroup |
39 | 39 | |
40 | 40 | FILES: |