r110373 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r110372‎ | r110373 | r110374 >
Date:10:09, 31 January 2012
Author:siebrand
Status:ok (Comments)
Tags:
Comment:
Change "grouptrail" switch to "groupprefix" and update documentation.
Modified paths:
  • /trunk/extensions/Translate/scripts/export.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Translate/scripts/export.php
@@ -9,7 +9,7 @@
1010 * @file
1111 */
1212
13 -$optionsWithArgs = array( 'lang', 'skip', 'target', 'group', 'groups', 'grouptrail', 'threshold', 'ppgettext' );
 13+$optionsWithArgs = array( 'lang', 'skip', 'target', 'group', 'groups', 'groupprefix', 'threshold', 'ppgettext' );
1414 require( dirname( __FILE__ ) . '/cli.inc' );
1515
1616 function showUsage() {
@@ -24,8 +24,8 @@
2525 --skip Languages to skip, comma separated list
2626 --group Group ID (cannot use groups grouptrial)
2727 --groups Group IDs, comma separated list (cannot use group or grouptrial)
28 - --grouptrail Trial for IDs of to be exported message groups (cannot use
29 - group or grouptrial)
 28+ --groupprefix Prefix of group IDs to be exported message groups (cannot use
 29+ group or groups)
3030 --threshold Do not export under this percentage translated
3131 --ppgettext Group root path for checkout of product. "msgmerge" will post
3232 process on the export result based on the current definitionFile
@@ -58,8 +58,8 @@
5959 $skip = array();
6060 }
6161
62 -if ( !isset( $options['group'] ) && !isset( $options['groups'] ) && !isset( $options['grouptrail'] ) ) {
63 - STDERR( "You need to specify one or more groups using any of the options 'group', 'groups' or 'grouptrail'" );
 62+if ( !isset( $options['group'] ) && !isset( $options['groups'] ) && !isset( $options['groupprefix'] ) ) {
 63+ STDERR( "You need to specify one or more groups using any of the options 'group', 'groups' or 'groupprefix'" );
6464 exit( 1 );
6565 }
6666
@@ -101,12 +101,12 @@
102102 $groups[$groupId] = MessageGroups::getGroup( $groupId );
103103 }
104104 } else {
105 - // Apparently using option grouptrail. Find groups that match.
 105+ // Apparently using option groupprefix. Find groups that match.
106106 $allGroups = MessageGroups::singleton()->getGroups();
107107
108108 // Add matching groups to groups array.
109109 foreach ( $allGroups as $groupId => $messageGroup ) {
110 - if ( strpos( $groupId, $options['grouptrail'] ) === 0 && !$messageGroup->isMeta() ) {
 110+ if ( strpos( $groupId, $options['groupprefix'] ) === 0 && !$messageGroup->isMeta() ) {
111111 $groups[$groupId] = $messageGroup;
112112 }
113113 }

Follow-up revisions

RevisionCommit summaryAuthorDate
r110375* switch "groups" in export.php dropped. "group" now takes a comma separated ...siebrand10:25, 31 January 2012
r110385Address CR comments:...siebrand13:42, 31 January 2012

Comments

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

Could also update the year in copyright.

Status & tagging log