WordPress.org

Making WordPress.org

Changeset 3507


Ignore:
Timestamp:
06/20/2016 04:07:11 PM (4 years ago)
Author:
ocean90
Message:

Plugin Directory: Initial commit for a code POT generator/importer.

See #1691.

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  
    5050$start_time  = microtime( 1 );
    5151
    52 echo "Processing I18N Import for $plugin_slug... ";
     52echo "Processing I18N Import for $plugin_slug...\n";
    5353try {
    5454    if ( 'readme' === $type ) {
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/cli/i18n/class-readme-import.php

    r3497 r3507  
    22namespace WordPressdotorg\Plugin_Directory\CLI\I18N;
    33
    4 use WordPressdotorg\Plugin_Directory\Plugin_I18n;
    54use WordPressdotorg\Plugin_Directory\Tools\SVN;
    65use WordPressdotorg\Plugin_Directory\Readme\Parser;
     
    1312 * @package WordPressdotorg\Plugin_Directory\CLI\I18N
    1413 */
    15 class Readme_Import {
     14class Readme_Import extends I18n_Import {
    1615    const PLUGIN_SVN_BASE = 'https://plugins.svn.wordpress.org';
    1716
     
    152151        }
    153152
    154         // @todo: Create/update GP projects.
     153        parent::set_glotpress_for_plugin( $this->plugin, 'readme' );
    155154
    156155        $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 );
    176157    }
    177158
Note: See TracChangeset for help on using the changeset viewer.