Changeset 3046
- Timestamp:
- 04/29/2016 09:38:10 AM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-plugin-directory/inc/sync/class-translation-sync.php
r3028 r3046 53 53 $time = date( 'r' ); 54 54 $message = "_Time: {$time}_\nTranslation sync from {$sub_project} to {$sub_project_counterpart} in process...\n"; 55 $updates = 0; 55 56 foreach ( $translation_sets as $translation_set ) { 56 57 if ( 0 == $translation_set->current_count() ) { … … 60 61 // Sync translations in a separate process. 61 62 $cmd = WPORGTRANSLATE_WPCLI . ' wporg-translate sync-plugin-translations ' . escapeshellarg( $args['gp_project'] ) . ' ' . escapeshellarg( $translation_set->locale ) . ' --set=' . escapeshellarg( $translation_set->slug ); 62 $output = shell_exec( $cmd ); 63 if ( 'No translations available.' !== $output ) { 64 $message .= "\t" . $output; 65 } 66 } 63 $output = ''; 64 $return_var = 0; 65 exec( $cmd, $output, $return_var ); 66 if ( $return_var ) { 67 $message .= "\tFailure: " . implode( "\n\t", $output ) . "\n"; 68 } else { 69 $message .= "\t" . implode( "\n\t", $output ) . "\n"; 70 } 71 $updates += 1; 72 } 73 74 if ( ! $updates ) { 75 $message .= "\tNo translations are available to sync.\n"; 76 } 77 67 78 $message .= 'Translation sync was successfully processed.'; 68 79
Note: See TracChangeset
for help on using the changeset viewer.