Making WordPress.org


Ignore:
Timestamp:
09/18/2015 12:54:38 AM (8 years ago)
Author:
dd32
Message:

Translate: Stats overview: Add the Forums and Waiting projects to the table. The Waiting column shows the number of strings waiting.
I attempted to add the Colour coding to the waiting list, but a straight percentage calculation isn't the best option, it needs to use a logarithemtric scale, on a percentage scale those with 500 waiting strings look great compared to 2000.
See #1202

File:
1 edited

Legend:

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

    r1881 r1885  
    3232            'meta/themes' => false,
    3333            'meta/plugins' => false,
     34            'meta/forums' => false,
    3435            'apps/android' => false,
    35             'apps/ios' => false
     36            'apps/ios' => false,
     37            'waiting' => false,
    3638        );
    3739
     
    5456        $sql = "SELECT
    5557                path, locale, locale_slug,
    56                 (100 * stats.current/stats.all) as percent_complete
     58                (100 * stats.current/stats.all) as percent_complete,
     59                stats.waiting+stats.fuzzy as waiting_strings
    5760            FROM {$gpdb->prefix}project_translation_status stats
    5861                LEFT JOIN {$gpdb->prefix}projects p ON stats.project_id = p.id
     
    7073            }
    7174            $translation_locale_statuses[ $locale_key ][ $set->path ] = floor( (float) $set->percent_complete );
     75            $translation_locale_statuses[ $locale_key ]['waiting'] += (int) $set->waiting_strings;
    7276        }
    7377        unset( $rows, $locale_key, $set );
     
    7680        $translation_locale_complete = array();
    7781        foreach ( $translation_locale_statuses as $locale => $sets ) {
     82            unset( $sets['waiting'] );
    7883            $translation_locale_complete[ $locale ] = round( array_sum( $sets ) / count( $sets ), 3 );
    7984        }
Note: See TracChangeset for help on using the changeset viewer.