Making WordPress.org


Ignore:
Timestamp:
03/30/2019 09:44:40 AM (7 years ago)
Author:
ocean90
Message:

Translate: Fix condition for displaying the language build status notice.

See #4251.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-customizations/templates/locale-project.php

    r8548 r8557  
    108108
    109109<?php
    110 if ( 'wp-plugins' === $project->path && ! in_array( 'dev', $sub_project_slugs ) && ! in_array( 'stable', $sub_project_slugs ) ) {
    111         ?>
    112         <div class="wporg-notice wporg-notice-error">
    113                 <p>This plugin is not <a href="https://developer.wordpress.org/plugins/internationalization/how-to-internationalize-your-plugin/">properly prepared for localization</a> (<a href="https://make.wordpress.org/meta/handbook/documentation/translations/#this-plugin-is-not-properly-prepared-for-localization-%e2%80%93-help">View detailed logs on Slack</a>). If you would like to translate this plugin, <a href="<?php echo esc_url( 'https://wordpress.org/support/plugin/' . $sub_project->slug ); ?>">please contact the author</a>.</p>
    114         </div>
    115         <?php
    116 }
    117 
    118 if ( 'wp-plugins' === $project->path && $sub_project_status->percent_complete < 95 ) {
    119         $stable_project_slug = in_array( 'stable', $sub_project_slugs, true ) ? 'stable' : 'dev';
    120         $stable_project_name = 'stable' === $stable_project_slug ? 'Stable (latest release) ' : 'Development (trunk) ';
    121         $status = $sub_project_statuses[ $stable_project_slug ];
    122         ?>
    123         <div class="wporg-notice wporg-notice-info">
    124                 <p>Translations for the readme are published almost immediately.
    125                         The language pack for the plugin will be generated when 95% of the <a href="<?php echo esc_url( gp_url_project( $sub_project->path, gp_url_join( $stable_project_slug, $locale->slug, $set_slug ) ) ); ?>"><?php echo $stable_project_name; ?></a> sub-project strings have been translated (currently <?php echo $status->percent_complete . '%'; ?>).</p>
    126         </div>
    127         <?php
    128 }
    129 
    130 if ( 'wp-themes' === $project->path && $sub_project_status->percent_complete < 95 ) {
     110if ( 'wp-plugins' === $project->path ) {
     111        if ( ! in_array( 'dev', $sub_project_slugs ) && ! in_array( 'stable', $sub_project_slugs ) ) {
     112                ?>
     113                <div class="wporg-notice wporg-notice-error">
     114                        <p>This plugin is not <a href="https://developer.wordpress.org/plugins/internationalization/how-to-internationalize-your-plugin/">properly prepared for localization</a> (<a href="https://make.wordpress.org/meta/handbook/documentation/translations/#this-plugin-is-not-properly-prepared-for-localization-%e2%80%93-help">View detailed logs on Slack</a>). If you would like to translate this plugin, <a href="<?php echo esc_url( 'https://wordpress.org/support/plugin/' . $sub_project->slug ); ?>">please contact the author</a>.</p>
     115                </div>
     116                <?php
     117        } else {
     118                $stable_project_slug = in_array( 'stable', $sub_project_slugs, true ) ? 'stable' : 'dev';
     119                $stable_project_name = 'stable' === $stable_project_slug ? 'Stable (latest release) ' : 'Development (trunk) ';
     120                $status              = $sub_project_statuses[ $stable_project_slug ];
     121                ?>
     122                <div class="wporg-notice wporg-notice-info">
     123                        <p>Translations for the readme are published almost immediately.
     124                                The language pack for the plugin will be generated when 95% of the <a href="<?php echo esc_url( gp_url_project( $sub_project->path, gp_url_join( $stable_project_slug, $locale->slug, $set_slug ) ) ); ?>"><?php echo $stable_project_name; ?></a> sub-project strings have been translated (currently <?php echo $status->percent_complete . '%'; ?>).</p>
     125                </div>
     126                <?php
     127        }
     128} elseif ( 'wp-themes' === $project->path ) {
    131129        ?>
    132130        <div class="wporg-notice wporg-notice-info">
Note: See TracChangeset for help on using the changeset viewer.