WordPress.org

Making WordPress.org


Ignore:
Timestamp:
11/23/2015 07:27:59 PM (5 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/wordpress.org/public_html/wp-content/plugins/wporg-gp-routes/routes/wp-plugins.php

    r2109 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.