Making WordPress.org


Ignore:
Timestamp:
03/24/2019 10:02:15 PM (8 years ago)
Author:
ocean90
Message:

Translate: Add an info notice about language build status for themes and plugins.

Props Nao.
Fixes #4251.

File:
1 edited

Legend:

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

    r8497 r8501  
    8484
    8585                                                foreach ( $sub_projects as $_sub_project ) {
    86                                                         $status = $sub_project_statuses[ $_sub_project->id ];
     86                                                        $status = $sub_project_statuses[ $_sub_project->slug ];
    8787
    8888                                                        printf(
    … …  
    110110if ( 'wp-plugins' === $project->path && ! in_array( 'dev', $sub_project_slugs ) && ! in_array( 'stable', $sub_project_slugs ) ) {
    111111        ?>
    112         <div class="wporg-notice wporg-notice-warning">
     112        <div class="wporg-notice wporg-notice-error">
    113113                <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
     118if ( '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
     130if ( 'wp-themes' === $project->path && $sub_project_status->percent_complete < 95 ) {
     131        ?>
     132        <div class="wporg-notice wporg-notice-info">
     133                <p>The language pack for the theme will be generated when 95% of the project strings have been translated (currently <?php echo $sub_project_status->percent_complete . '%'; ?>).</p>
    114134        </div>
    115135        <?php
    … …  
    169189
    170190                        foreach ( $sub_projects as $sub_project ) {
    171                                 $status = $sub_project_statuses[ $sub_project->id ];
     191                                $status = $sub_project_statuses[ $sub_project->slug ];
    172192                                ?>
    173193                                <tr>
Note: See TracChangeset for help on using the changeset viewer.