Making WordPress.org

Changeset 2055


Ignore:
Timestamp:
11/07/2015 04:18:36 AM (9 years ago)
Author:
dd32
Message:

Translate: Include Plugins/Themes waiting/fuzzy strings in the Waiting column on https://translate.wordpress.org/stats
See #1202

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/translate.wordpress.org/includes/gp-plugins/wporg-stats-overview.php

    r1890 r2055  
    8181        unset( $rows, $locale_key, $set );
    8282
     83        // Append the Plugins/Themes waiting strings
     84        $parent_project_ids = implode(',', array(
     85            GP::$project->by_path( 'wp-plugins' )->id,
     86            GP::$project->by_path( 'wp-themes' )->id
     87        ) );
     88        $sql = "SELECT
     89                locale, locale_slug,
     90                SUM( stats.waiting ) + SUM( stats.fuzzy ) as waiting_strings
     91            FROM {$gpdb->prefix}project_translation_status stats
     92                LEFT JOIN {$gpdb->prefix}projects p ON stats.project_id = p.id
     93            WHERE
     94                p.parent_project_id IN ( $parent_project_ids )
     95            GROUP BY locale, locale_slug";
     96
     97        $rows = $gpdb->get_results( $sql );
     98        foreach ( $rows as $set ) {
     99            $locale_key = $set->locale;
     100            if ( 'default' != $set->locale_slug ) {
     101                $locale_key = $set->locale . '/' . $set->locale_slug;
     102            }
     103
     104            $translation_locale_statuses[ $locale_key ]['waiting'] += (int) $set->waiting_strings;
     105        }
     106
    83107        // Calculate a list of [Locale] = % subtotals
    84108        $translation_locale_complete = array();
Note: See TracChangeset for help on using the changeset viewer.