Changeset 3507
- Timestamp:
- 06/20/2016 04:07:11 PM (8 years ago)
- Location:
- sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory
- Files:
-
- 2 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/bin/import-plugin-to-glotpress.php
r3497 r3507 50 50 $start_time = microtime( 1 ); 51 51 52 echo "Processing I18N Import for $plugin_slug... 52 echo "Processing I18N Import for $plugin_slug...\n"; 53 53 try { 54 54 if ( 'readme' === $type ) { -
sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/cli/i18n/class-readme-import.php
r3497 r3507 2 2 namespace WordPressdotorg\Plugin_Directory\CLI\I18N; 3 3 4 use WordPressdotorg\Plugin_Directory\Plugin_I18n;5 4 use WordPressdotorg\Plugin_Directory\Tools\SVN; 6 5 use WordPressdotorg\Plugin_Directory\Readme\Parser; … … 13 12 * @package WordPressdotorg\Plugin_Directory\CLI\I18N 14 13 */ 15 class Readme_Import {14 class Readme_Import extends I18n_Import { 16 15 const PLUGIN_SVN_BASE = 'https://plugins.svn.wordpress.org'; 17 16 … … 152 151 } 153 152 154 // @todo: Create/update GP projects.153 parent::set_glotpress_for_plugin( $this->plugin, 'readme' ); 155 154 156 155 $branch = ( 'trunk' === $tag ) ? 'dev' : 'stable'; 157 $cmd = WPORGTRANSLATE_WPCLI . ' glotpress import-originals ' . escapeshellarg( "wp-plugins/{$this->plugin}/{$branch}-readme" ) . ' ' . escapeshellarg( $pot_file ); 158 159 echo "\n\$$cmd\n"; 160 echo shell_exec( $cmd ) . "\n"; 161 162 // @todo: Fix this. 163 $gp_branch_id = Plugin_I18n::instance()->get_gp_branch_id( $this->plugin, "{$branch}-readme" ); 164 if ( $gp_branch_id ) { 165 foreach ( $str_priorities as $str => $prio ) { 166 if ( 1 !== $prio && -1 !== $prio ) { 167 $prio = 0; 168 } 169 170 $wpdb->query( $wpdb->prepare( 171 'UPDATE ' . GLOTPRESS_TABLE_PREFIX . 'originals SET priority = %d WHERE project_id = %d AND status = %s AND singular = %s', 172 $prio, $gp_branch_id, '+active', $str 173 ) ); 174 } 175 } 156 parent::import_pot_to_glotpress_project( $this->plugin, $branch, $pot_file, $str_priorities ); 176 157 } 177 158
Note: See TracChangeset
for help on using the changeset viewer.