WordPress.org

Make WordPress Core


Ignore:
Timestamp:
06/10/2016 03:53:27 PM (4 years ago)
Author:
ocean90
Message:

I18N: Simplify the WordPress update notice for translators.

  • Make codex URL and accessibility text separate strings.
  • Add translator comments.

Props ramiy for initial patch.
Fixes #35721.

File:
1 edited

Legend:

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

    r37488 r37675  
    231231        return false;
    232232
    233     if ( current_user_can('update_core') ) {
    234         $msg = sprintf( __( '<a href="https://codex.wordpress.org/Version_%1$s">WordPress %1$s</a> is available! <a href="%2$s" aria-label="Please update WordPress now">Please update now</a>.' ), $cur->current, network_admin_url( 'update-core.php' ) );
     233    if ( current_user_can( 'update_core' ) ) {
     234        $msg = sprintf(
     235            /* translators: 1: Codex URL to release notes, 2: new WordPress version, 3: URL to network admin, 4: accessibility text */
     236            __( '<a href="%1$s">WordPress %2$s</a> is available! <a href="%3$s" aria-label="%4$s">Please update now</a>.' ),
     237            sprintf(
     238                /* translators: %s: WordPress version */
     239                esc_url( __( 'https://codex.wordpress.org/Version_%s' ) ),
     240                $cur->current
     241            ),
     242            $cur->current,
     243            network_admin_url( 'update-core.php' ),
     244            esc_attr__( 'Please update WordPress now' )
     245        );
    235246    } else {
    236         $msg = sprintf( __('<a href="https://codex.wordpress.org/Version_%1$s">WordPress %1$s</a> is available! Please notify the site administrator.'), $cur->current );
     247        $msg = sprintf(
     248            /* translators: 1: Codex URL to release notes, 2: new WordPress version */
     249            __( '<a href="%1$s">WordPress %2$s</a> is available! Please notify the site administrator.' ),
     250            sprintf(
     251                /* translators: %s: WordPress version */
     252                esc_url( __( 'https://codex.wordpress.org/Version_%s' ) ),
     253                $cur->current
     254            ),
     255            $cur->current
     256        );
    237257    }
    238258    echo "<div class='update-nag'>$msg</div>";
Note: See TracChangeset for help on using the changeset viewer.