Making WordPress.org

Changeset 14469


Ignore:
Timestamp:
06/17/2025 03:06:01 AM (16 months ago)
Author:
dd32
Message:

Translate: Set the waiting key earlier in the loop to avoid a PHP Warning when a locale only has a wp-plugins or wp-themes projects.

Some locales, such as en_US, bgn, pa_PK, and sr_RS_latin don't have a WordPress.org site, and as such, the only projects are plugin/theme translations.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-routes/inc/routes/class-stats.php

    r11086 r14469  
    7777                        }
    7878
     79                        if ( ! isset( $translation_locale_statuses[ $locale_key ]['waiting'] ) ) {
     80                                $translation_locale_statuses[ $locale_key ]['waiting'] = 0;
     81                        }
     82
    7983                        /*
    8084                         * > 50% round down, so that a project with all strings except 1 translated shows 99%, instead of 100%.
    … …  
    9296                        }
    9397
    94                         if ( ! isset( $translation_locale_statuses[ $locale_key ]['waiting'] ) ) {
    95                                 $translation_locale_statuses[ $locale_key ]['waiting'] = 0;
    96                         }
    9798                        $translation_locale_statuses[ $locale_key ]['waiting'] += (int) $set->waiting_strings;
    9899                }
Note: See TracChangeset for help on using the changeset viewer.