r110379 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r110378‎ | r110379 | r110380 >
Date:10:43, 31 January 2012
Author:siebrand
Status:resolved (Comments)
Tags:i18nreview 
Comment:
Add missing switch documentation and add a check for valid message groups.
Modified paths:
  • /trunk/extensions/Translate/scripts/export.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Translate/scripts/export.php
@@ -25,6 +25,7 @@
2626 --group Comma separated list of group IDs (cannot use groupprefix)
2727 --groupprefix Prefix of group IDs to be exported message groups (cannot use
2828 group)
 29+ --help This help message
2930 --threshold Do not export under this percentage translated
3031 --ppgettext Group root path for checkout of product. "msgmerge" will post
3132 process on the export result based on the current definitionFile
@@ -95,7 +96,11 @@
9697
9798 // Get groups and add groups to array
9899 foreach ( $groupIds as $groupId ) {
99 - $groups[$groupId] = MessageGroups::getGroup( $groupId );
 100+ $group = MessageGroups::getGroup( $groupId );
 101+
 102+ if( $group !== null ) {
 103+ $groups[$groupId] = $group;
 104+ }
100105 }
101106 } else {
102107 // Apparently using option groupprefix. Find groups that match.

Follow-up revisions

RevisionCommit summaryAuthorDate
r110385Address CR comments:...siebrand13:42, 31 January 2012

Comments

#Comment by Nikerabbit (talk | contribs)   10:45, 31 January 2012

Should it at print a warning if invalid group was specified? Can also write if ( $group ) { ... } else { STDERR( "Invalid group $groupId" ); }

Status & tagging log