Index: trunk/extensions/Translate/MessageGroups.php |
— | — | @@ -1152,6 +1152,7 @@ |
1153 | 1153 | } |
1154 | 1154 | |
1155 | 1155 | // Sort top-level groups according to labels, not ids |
| 1156 | + $labels = array(); |
1156 | 1157 | foreach ( $structure as $id => $data ) { |
1157 | 1158 | // Either it is a group itself, or the first group of the array |
1158 | 1159 | $nid = is_array( $data ) ? key( $data ) : $id; |
Index: trunk/extensions/Translate/Translate.i18n.php |
— | — | @@ -19,6 +19,7 @@ |
20 | 20 | |
21 | 21 | 'translate-grouplisting' => 'This is the list of all translatable groups. |
22 | 22 | Click the message group name to view a list of untranslated messages.', |
| 23 | + 'translate-grouplisting-empty' => 'No message groups have been configured for translation.', |
23 | 24 | |
24 | 25 | 'translate-task-view' => 'View all messages from', |
25 | 26 | 'translate-task-untranslated' => 'View all untranslated messages from', |
Index: trunk/extensions/Translate/specials/SpecialTranslate.php |
— | — | @@ -60,7 +60,7 @@ |
61 | 61 | $errors = array(); |
62 | 62 | |
63 | 63 | if ( $this->options['group'] === '' ) { |
64 | | - $wgOut->addHTML( $this->groupInformation() ); |
| 64 | + $this->groupInformation(); |
65 | 65 | return; |
66 | 66 | } |
67 | 67 | |
— | — | @@ -404,15 +404,21 @@ |
405 | 405 | } |
406 | 406 | |
407 | 407 | public function groupInformation() { |
408 | | - $out = ''; |
| 408 | + global $wgOut; |
409 | 409 | $structure = MessageGroups::getGroupStructure(); |
| 410 | + if ( !$structure ) { |
| 411 | + $wgOut->addWikiMsg( 'translate-grouplisting-empty' ); |
| 412 | + return; |
| 413 | + } |
410 | 414 | |
| 415 | + $wgOut->addWikiMsg( 'translate-grouplisting' ); |
| 416 | + |
| 417 | + $out = ''; |
411 | 418 | foreach ( $structure as $blocks ) { |
412 | 419 | $out .= $this->formatGroupInformation( $blocks ); |
413 | 420 | } |
414 | 421 | |
415 | | - $header = wfMsgExt( 'translate-grouplisting', 'parse' ); |
416 | | - return $header . "\n" . Html::rawElement( 'table', array( 'class' => 'mw-sp-translate-grouplist wikitable' ), $out ); |
| 422 | + $wgOut->addHtml( Html::rawElement( 'table', array( 'class' => 'mw-sp-translate-grouplist wikitable' ), $out ) ); |
417 | 423 | } |
418 | 424 | |
419 | 425 | public function formatGroupInformation( $blocks, $level = 2 ) { |