Making WordPress.org

Changeset 8501


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

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

Props Nao.
Fixes #4251.

Location:
sites/trunk/wordpress.org/public_html/wp-content/plugins
Files:
3 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>
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-customizations/templates/style.css

    r8499 r8501  
    12441244}
    12451245
     1246.wporg-notice-error {
     1247    background: #fbeaea;
     1248    border-left-color:#dc3232;
     1249}
     1250
    12461251.wporg-notice-warning {
    12471252    background: #fff8e5;
     
    12491254}
    12501255
     1256.wporg-notice-info {
     1257    background: #e5f5fa;
     1258    border-left-color:#00a0d2;
     1259}
    12511260
    12521261/* Responsive styles */
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-routes/inc/routes/class-locale.php

    r8497 r8501  
    191191        $sub_project_slugs = array();
    192192        if ( $sub_projects ) {
     193            $sub_project_ids      = array();
    193194            $sub_project_statuses = array();
    194195            foreach ( $sub_projects as $key => $_sub_project ) {
     
    196197                $status = $this->get_project_status( $_sub_project, $locale_slug, $set_slug, null, false );
    197198
    198                 $sub_project_statuses[ $_sub_project->id ] = $status;
    199             }
    200 
    201             $variants = $this->get_locale_variants( $locale_slug, array_keys( $sub_project_statuses ) );
     199                $sub_project_ids[] = $_sub_project->id;
     200
     201                $sub_project_statuses[ $_sub_project->slug ] = $status;
     202            }
     203
     204            $variants = $this->get_locale_variants( $locale_slug, $sub_project_ids );
     205
     206            unset( $sub_project_ids );
    202207        } else {
    203208            $variants = $this->get_locale_variants( $locale_slug, array( $sub_project->id ) );
Note: See TracChangeset for help on using the changeset viewer.