Index: trunk/extensions/Translate/scripts/cli.inc |
— | — | @@ -40,4 +40,18 @@ |
41 | 41 | STDOUT( $message, $channel, true ); |
42 | 42 | } |
43 | 43 | |
44 | | -register_shutdown_function('STDOUT', false); |
\ No newline at end of file |
| 44 | +register_shutdown_function('STDOUT', false); |
| 45 | + |
| 46 | + |
| 47 | +class Cli { |
| 48 | + |
| 49 | + public static function parseLanguageCodes( /* string */ $codes ) { |
| 50 | + $langs = array_map( 'trim', explode( ',', $codes ) ); |
| 51 | + if ( $langs[0] === '*' ) { |
| 52 | + $languages = Language::getLanguageNames(); |
| 53 | + ksort($languages); |
| 54 | + $langs = array_keys($languages); |
| 55 | + } |
| 56 | + return $langs; |
| 57 | + } |
| 58 | +} |
\ No newline at end of file |
Index: trunk/extensions/Translate/scripts/poimport.php |
— | — | @@ -221,14 +221,14 @@ |
222 | 222 | global $wgTitle, $wgArticle; |
223 | 223 | $wgTitle = Title::makeTitleSafe( $namespace, $title ); |
224 | 224 | |
225 | | - STDOUT( "Updating {$wgTitle->getPrefixedText()}... ", true ); |
| 225 | + STDOUT( "Updating {$wgTitle->getPrefixedText()}... ", $title ); |
226 | 226 | if ( !$wgTitle instanceof Title ) { |
227 | | - STDOUT( "INVALID TITLE!", false ); |
| 227 | + STDOUT( "INVALID TITLE!", $title ); |
228 | 228 | return; |
229 | 229 | } |
230 | 230 | |
231 | 231 | if ( $this->dryrun ) { |
232 | | - STDOUT( "DRY RUN!", false ); |
| 232 | + STDOUT( "DRY RUN!", $title ); |
233 | 233 | return; |
234 | 234 | } |
235 | 235 | |
— | — | @@ -237,9 +237,9 @@ |
238 | 238 | $success = $wgArticle->doEdit( $text, 'Updating translation from gettext import' ); |
239 | 239 | |
240 | 240 | if ( $success ) { |
241 | | - STDOUT( "OK!", false ); |
| 241 | + STDOUT( "OK!", $title ); |
242 | 242 | } else { |
243 | | - STDOUT( "Failed!", false ); |
| 243 | + STDOUT( "Failed!", $title ); |
244 | 244 | } |
245 | 245 | } |
246 | 246 | } |
Index: trunk/extensions/Translate/scripts/export.php |
— | — | @@ -20,7 +20,7 @@ |
21 | 21 | |
22 | 22 | Options: |
23 | 23 | --target Target directory for exported files |
24 | | - --lang Comma separated list of language codes |
| 24 | + --lang Comma separated list of language codes or * |
25 | 25 | --group Group id |
26 | 26 | EOT |
27 | 27 | ); |
— | — | @@ -48,9 +48,8 @@ |
49 | 49 | exit(1); |
50 | 50 | } |
51 | 51 | |
52 | | -$langs = array_map( 'trim', explode( ',', $options['lang'] ) ); |
| 52 | +$langs = Cli::parseLanguageCodes( $options['langs'] ); |
53 | 53 | |
54 | | - |
55 | 54 | $group = MessageGroups::getGroup( $options['group'] ); |
56 | 55 | |
57 | 56 | if ( !$group instanceof MessageGroup ) { |
Index: trunk/extensions/Translate/scripts/fuzzy.php |
— | — | @@ -64,7 +64,7 @@ |
65 | 65 | |
66 | 66 | $wgUser = User::newFromName( $wgTranslateFuzzyBotName ); |
67 | 67 | |
68 | | - if ( $wgUser->isAnon() ) { |
| 68 | + if ( !$wgUser->isLoggedIn() ) { |
69 | 69 | STDOUT( "Creating user $wgTranslateFuzzyBotName" ); |
70 | 70 | $wgUser->addToDatabase(); |
71 | 71 | } |
Index: trunk/extensions/Translate/scripts/alias-export.php |
— | — | @@ -1,6 +1,6 @@ |
2 | 2 | <?php |
3 | 3 | /** |
4 | | - * Script to export translations of one message group to file(s). |
| 4 | + * Script to export special page aliases of extensions. |
5 | 5 | * |
6 | 6 | * @author Niklas Laxstrom |
7 | 7 | * |
— | — | @@ -9,7 +9,7 @@ |
10 | 10 | * @file |
11 | 11 | */ |
12 | 12 | |
13 | | -$optionsWithArgs = array( 'lang', 'target', 'group' ); |
| 13 | +$optionsWithArgs = array( 'lang', 'target' ); |
14 | 14 | require( dirname(__FILE__) . '/cli.inc' ); |
15 | 15 | |
16 | 16 | function showUsage() { |
— | — | @@ -20,8 +20,7 @@ |
21 | 21 | |
22 | 22 | Options: |
23 | 23 | --target Target directory for exported files |
24 | | - --lang Comma separated list of language codes |
25 | | - --group Group id |
| 24 | + --lang Comma separated list of language codes or * |
26 | 25 | EOT |
27 | 26 | ); |
28 | 27 | exit( 1 ); |
— | — | @@ -45,7 +44,7 @@ |
46 | 45 | exit(1); |
47 | 46 | } |
48 | 47 | |
49 | | -$langs = array_map( 'trim', explode( ',', $options['lang'] ) ); |
| 48 | +$langs = Cli::parseLanguageCodes( $options['lang'] ); |
50 | 49 | |
51 | 50 | |
52 | 51 | if ( !file_exists(TRANSLATE_ALIASFILE) || !is_readable(TRANSLATE_ALIASFILE) ) { |