https://www.mediawiki.org/wiki/Special:Code/MediaWiki/112787
Revision: 112787
Author: nikerabbit
Date: 2012-03-01 10:33:57 +0000 (Thu, 01 Mar 2012)
Log Message:
-----------
Followup r111456. Move the complexity to caller and keep other code "clean".
Modified Paths:
--------------
trunk/extensions/Translate/MessageGroups.php
trunk/extensions/Translate/scripts/export.php
Modified: trunk/extensions/Translate/MessageGroups.php
===================================================================
--- trunk/extensions/Translate/MessageGroups.php 2012-03-01 09:51:23 UTC
(rev 112786)
+++ trunk/extensions/Translate/MessageGroups.php 2012-03-01 10:33:57 UTC
(rev 112787)
@@ -1333,22 +1333,17 @@
/**
* Get message groups for corresponding message group ids.
*
- * @param $ids array Group IDs
- * @param $skipMeta bool Skip aggregate message groups
- * @return array
+ * @param $ids array of message group ids
+ * @return array array of message groups indexed by message group ids
* @since 2012-02-13
*/
- public static function getGroupsById( array $ids, $skipMeta = false ) {
+ public static function getGroupsById( array $ids ) {
$groups = array();
foreach ( $ids as $id ) {
$group = self::getGroup( $id );
if ( $group !== null ) {
- if ( $skipMeta && $group->isMeta() ) {
- continue;
- } else {
- $groups[$id] = $group;
- }
+ $groups[$id] = $group;
} else {
wfDebug( __METHOD__ . ": Invalid message group
id: $id\n" );
}
Modified: trunk/extensions/Translate/scripts/export.php
===================================================================
--- trunk/extensions/Translate/scripts/export.php 2012-03-01 09:51:23 UTC
(rev 112786)
+++ trunk/extensions/Translate/scripts/export.php 2012-03-01 10:33:57 UTC
(rev 112787)
@@ -109,12 +109,16 @@
foreach ( $groups as $groupId => $group ) {
if ( !$group instanceof MessageGroup ) {
- STDERR( "Invalid group: " . $groupId );
+ STDERR( "Unknown message group $groupId" );
exit( 1 );
}
- STDERR( 'Exporting ' . $groupId );
+ if ( $group->isMeta() ) {
+ STDERR( "Skipping meta message group $groupId" );
+ }
+ STDERR( "Exporting $groupId" );
+
$langs = $reqLangs;
if ( $threshold ) {
$stats = MessageGroupStats::forGroup( $groupId );
_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs