https://www.mediawiki.org/wiki/Special:Code/MediaWiki/112812
Revision: 112812
Author: siebrand
Date: 2012-03-01 15:20:47 +0000 (Thu, 01 Mar 2012)
Log Message:
-----------
Revert r112787: Broke exports.
Example:
Command:
php export.php --target=$EXPORTPATH --groupprefix=out-osm- --lang='*'
--skip=en,qqq --threshold=35
Output:
$ bxa osm
Exporting OpenStreetMap potlatch and site with 35%+
Skipping meta message group out-osm-0-all
Exporting out-osm-0-all
$
It shouldn't have tried to calculate translation percentages of aggregate
groups, but skipped them immediately.
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 15:04:13 UTC
(rev 112811)
+++ trunk/extensions/Translate/MessageGroups.php 2012-03-01 15:20:47 UTC
(rev 112812)
@@ -1333,17 +1333,22 @@
/**
* Get message groups for corresponding message group ids.
*
- * @param $ids array of message group ids
- * @return array array of message groups indexed by message group ids
+ * @param $ids array Group IDs
+ * @param $skipMeta bool Skip aggregate message groups
+ * @return array
* @since 2012-02-13
*/
- public static function getGroupsById( array $ids ) {
+ public static function getGroupsById( array $ids, $skipMeta = false ) {
$groups = array();
foreach ( $ids as $id ) {
$group = self::getGroup( $id );
if ( $group !== null ) {
- $groups[$id] = $group;
+ if ( $skipMeta && $group->isMeta() ) {
+ continue;
+ } else {
+ $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 15:04:13 UTC
(rev 112811)
+++ trunk/extensions/Translate/scripts/export.php 2012-03-01 15:20:47 UTC
(rev 112812)
@@ -109,16 +109,12 @@
foreach ( $groups as $groupId => $group ) {
if ( !$group instanceof MessageGroup ) {
- STDERR( "Unknown message group $groupId" );
+ STDERR( "Invalid group: " . $groupId );
exit( 1 );
}
- if ( $group->isMeta() ) {
- STDERR( "Skipping meta message group $groupId" );
- }
+ STDERR( 'Exporting ' . $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