r112787 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r112786‎ | r112787 | r112788 >
Date:10:33, 1 March 2012
Author:nikerabbit
Status:reverted
Tags:
Comment:
Followup r111456. Move the complexity to caller and keep other code "clean".
Modified paths:
  • /trunk/extensions/Translate/MessageGroups.php (modified) (history)
  • /trunk/extensions/Translate/scripts/export.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Translate/scripts/export.php
@@ -109,12 +109,16 @@
110110
111111 foreach ( $groups as $groupId => $group ) {
112112 if ( !$group instanceof MessageGroup ) {
113 - STDERR( "Invalid group: " . $groupId );
 113+ STDERR( "Unknown message group $groupId" );
114114 exit( 1 );
115115 }
116116
117 - STDERR( 'Exporting ' . $groupId );
 117+ if ( $group->isMeta() ) {
 118+ STDERR( "Skipping meta message group $groupId" );
 119+ }
118120
 121+ STDERR( "Exporting $groupId" );
 122+
119123 $langs = $reqLangs;
120124 if ( $threshold ) {
121125 $stats = MessageGroupStats::forGroup( $groupId );
Index: trunk/extensions/Translate/MessageGroups.php
@@ -1333,22 +1333,17 @@
13341334 /**
13351335 * Get message groups for corresponding message group ids.
13361336 *
1337 - * @param $ids array Group IDs
1338 - * @param $skipMeta bool Skip aggregate message groups
1339 - * @return array
 1337+ * @param $ids array of message group ids
 1338+ * @return array array of message groups indexed by message group ids
13401339 * @since 2012-02-13
13411340 */
1342 - public static function getGroupsById( array $ids, $skipMeta = false ) {
 1341+ public static function getGroupsById( array $ids ) {
13431342 $groups = array();
13441343 foreach ( $ids as $id ) {
13451344 $group = self::getGroup( $id );
13461345
13471346 if ( $group !== null ) {
1348 - if ( $skipMeta && $group->isMeta() ) {
1349 - continue;
1350 - } else {
1351 - $groups[$id] = $group;
1352 - }
 1347+ $groups[$id] = $group;
13531348 } else {
13541349 wfDebug( __METHOD__ . ": Invalid message group id: $id\n" );
13551350 }

Follow-up revisions

RevisionCommit summaryAuthorDate
r112812Revert r112787: Broke exports....siebrand15:20, 1 March 2012
r112814Reverted the reversion of r112787 in rr112812 and add the missing continuenikerabbit15:28, 1 March 2012

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r111456* update documentation....siebrand12:45, 14 February 2012

Status & tagging log