Making WordPress.org


Ignore:
Timestamp:
11/23/2015 07:27:59 PM (9 years ago)
Author:
ocean90
Message:

Translate: Add a warning to plugin pages if a plugin has only one sub-project.

File:
1 edited

Legend:

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

    r2089 r2118  
    2626        // Split out into $[Locale][Project] = %
    2727        $translation_locale_statuses = array();
     28        $sub_projects = array();
    2829        foreach ( $rows as $set ) {
    2930
     
    3435            }
    3536            $sub_project = str_replace( "$project_path/", '', $set->path );
     37            $sub_projects[ $sub_project ] = true;
    3638
    3739            /*
     
    5557            ksort( $translation_locale_statuses[ $locale_key ], SORT_NATURAL );
    5658        }
    57         unset( $project_path, $locale_key, $rows, $set, $sub_project );
     59
     60        // If the plugin has only one sub-project something went wrong, likely a missing
     61        // text domain which is why no 'code' projects will be created.
     62        $has_error = count( $sub_projects ) < 2;
     63
     64        unset( $project_path, $locale_key, $rows, $set, $sub_project, $sub_projects );
    5865
    5966        // Calculate a list of [Locale] = % subtotals
Note: See TracChangeset for help on using the changeset viewer.