WordPress.org

Make WordPress Core

Changeset 25784


Ignore:
Timestamp:
10/15/2013 05:07:55 AM (5 years ago)
Author:
nacin
Message:

Hide language-specific warnings/labels on update-core.php when we are dealing with a point release partial build.

see #22704, #18200.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/update-core.php

    r25783 r25784  
    2323
    2424function list_core_update( $update ) {
    25     global $wp_local_package, $wpdb;
    26     static $first_pass = true;
    27 
    28     $version_string = ('en_US' == $update->locale && 'en_US' == get_locale() ) ?
    29             $update->current : sprintf("%s&ndash;<strong>%s</strong>", $update->current, $update->locale);
     25    global $wp_local_package, $wpdb, $wp_version;
     26    static $first_pass = true;
     27 
     28    if ( 'en_US' == $update->locale && 'en_US' == get_locale() )
     29        $version_string = $update->current;
     30    // If the only available update is a partial builds, it doesn't need a language-specific version string.
     31    elseif ( 'en_US' == $update->locale && $update->packages->partial && $wp_version == $update->partial_version && ( $updates = get_core_updates() ) && 1 == count( $updates ) )
     32        $version_string = $update->current;
     33    else
     34        $version_string = sprintf( "%s&ndash;<strong>%s</strong>", $update->current, $update->locale );
     35 
    3036    $current = false;
    3137    if ( !isset($update->response) || 'latest' == $update->response )
     
    9096    if ( 'en_US' != $update->locale && ( !isset($wp_local_package) || $wp_local_package != $update->locale ) )
    9197        echo '<p class="hint">'.__('This localized version contains both the translation and various other localization fixes. You can skip upgrading if you want to keep your current translation.').'</p>';
    92     else if ( 'en_US' == $update->locale && get_locale() != 'en_US' ) {
     98    // Partial builds don't need language-specific warnings.
     99    elseif ( 'en_US' == $update->locale && get_locale() != 'en_US' && ( ! $update->packages->partial && $wp_version == $update->partial_version ) ) {
    93100        echo '<p class="hint">'.sprintf( __('You are about to install WordPress %s <strong>in English (US).</strong> There is a chance this update will break your translation. You may prefer to wait for the localized version to be released.'), $update->response != 'development' ? $update->current : '' ).'</p>';
    94101    }
Note: See TracChangeset for help on using the changeset viewer.