Making WordPress.org

Changeset 2048


Ignore:
Timestamp:
11/06/2015 07:45:48 PM (11 years ago)
Author:
obenland
Message:

Translate: Waiting strings should be waiting and fuzzy strings.

Continues to use untranslated strings to determine sort order of languages.

See #1365.

File:
1 edited

Legend:

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

    r2046 r2048  
    1616                                path, locale, locale_slug,
    1717                                (100 * stats.current/stats.all) as percent_complete,
    18                                 stats.untranslated as waiting_strings
     18                                stats.waiting+stats.fuzzy as waiting_strings,
     19                                stats.untranslated as untranslated
    1920                        FROM {$gpdb->prefix}project_translation_status stats
    2021                                LEFT JOIN {$gpdb->prefix}projects p ON stats.project_id = p.id
     
    4142                        $translation_locale_statuses[ $locale_key ][ $sub_project ] = ( $percent_complete > 50 ) ? floor( $percent_complete ) : ceil( $percent_complete );
    4243
    43                         // Increment the amount of waiting strings.
     44                        // Increment the amount of waiting and untranslated strings.
    4445                        if ( ! isset( $translation_locale_statuses[ $locale_key ]['waiting'] ) ) {
    4546                                $translation_locale_statuses[ $locale_key ]['waiting'] = 0;
    4647                        }
     48                        if ( ! isset( $translation_locale_statuses[ $locale_key ]['untranslated'] ) ) {
     49                                $translation_locale_statuses[ $locale_key ]['untranslated'] = 0;
     50                        }
    4751                        $translation_locale_statuses[ $locale_key ]['waiting'] += (int) $set->waiting_strings;
     52                        $translation_locale_statuses[ $locale_key ]['untranslated'] += (int) $set->untranslated;
     53
    4854
    4955                        ksort( $translation_locale_statuses[ $locale_key ], SORT_NATURAL );
     
    5359                // Order by waiting strings, ascending.
    5460                uksort( $translation_locale_statuses, function ( $a, $b ) use ( $translation_locale_statuses ) {
    55                         if ( $translation_locale_statuses[ $a ]['waiting'] > $translation_locale_statuses[ $b ]['waiting'] ) {
     61                        if ( $translation_locale_statuses[ $a ]['untranslated'] > $translation_locale_statuses[ $b ]['untranslated'] ) {
    5662                                return 1;
    57                         } elseif ( $translation_locale_statuses[ $a ]['waiting'] == $translation_locale_statuses[ $b ]['waiting'] ) {
     63                        } elseif ( $translation_locale_statuses[ $a ]['untranslated'] == $translation_locale_statuses[ $b ]['untranslated'] ) {
    5864                                return strnatcmp( $a, $b );
    5965                        } else {
Note: See TracChangeset for help on using the changeset viewer.