Make WordPress Core


Ignore:
Timestamp:
03/04/2016 11:07:29 AM (9 years ago)
Author:
SergeyBiryukov
Message:

I18N: Move the aria-label text in wp_plugin_update_row() and wp_theme_update_row() to a separate string for easier translation.

Add translator comments.

Props ramiy.
See #36048.

File:
1 edited

Legend:

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

    r36394 r36844  
    339339
    340340        if ( ! current_user_can( 'update_plugins' ) ) {
    341             /* translators: 1: plugin name, 2: details URL, 3: escaped plugin name, 4: version number */
    342             printf( __( 'There is a new version of %1$s available. <a href="%2$s" class="thickbox" aria-label="View %3$s version %4$s details">View version %4$s details</a>.' ),
     341            /* translators: 1: plugin name, 2: details URL, 3: accessibility text, 4: version number */
     342            printf( __( 'There is a new version of %1$s available. <a href="%2$s" class="thickbox" aria-label="%3$s">View version %4$s details</a>.' ),
    343343                $plugin_name,
    344344                esc_url( $details_url ),
    345                 esc_attr( $plugin_name ),
     345                /* translators: 1: plugin name, 2: version number */
     346                esc_attr( sprintf( __( 'View %1$s version %2$s details' ), $plugin_name, $r->new_version ) ),
    346347                $r->new_version
    347348            );
    348349        } elseif ( empty( $r->package ) ) {
    349             /* translators: 1: plugin name, 2: details URL, 3: escaped plugin name, 4: version number */
    350             printf( __( 'There is a new version of %1$s available. <a href="%2$s" class="thickbox" aria-label="View %3$s version %4$s details">View version %4$s details</a>. <em>Automatic update is unavailable for this plugin.</em>' ),
     350            /* translators: 1: plugin name, 2: details URL, 3: accessibility text, 4: version number */
     351            printf( __( 'There is a new version of %1$s available. <a href="%2$s" class="thickbox" aria-label="%3$s">View version %4$s details</a>. <em>Automatic update is unavailable for this plugin.</em>' ),
    351352                $plugin_name,
    352353                esc_url( $details_url ),
    353                 esc_attr( $plugin_name ),
     354                /* translators: 1: plugin name, 2: version number */
     355                esc_attr( sprintf( __( 'View %1$s version %2$s details' ), $plugin_name, $r->new_version ) ),
    354356                $r->new_version
    355357            );
    356358        } else {
    357             /* translators: 1: plugin name, 2: details URL, 3: escaped plugin name, 4: version number, 5: update URL */
    358             printf( __( 'There is a new version of %1$s available. <a href="%2$s" class="thickbox" aria-label="View %3$s version %4$s details">View version %4$s details</a> or <a href="%5$s" class="update-link" aria-label="update %3$s now">update now</a>.' ),
     359            /* translators: 1: plugin name, 2: details URL, 3: accessibility text, 4: version number, 5: update URL, 6: accessibility text */
     360            printf( __( 'There is a new version of %1$s available. <a href="%2$s" class="thickbox" aria-label="%3$s">View version %4$s details</a> or <a href="%5$s" class="update-link" aria-label="%6$s">update now</a>.' ),
    359361                $plugin_name,
    360362                esc_url( $details_url ),
    361                 esc_attr( $plugin_name ),
     363                /* translators: 1: plugin name, 2: version number */
     364                esc_attr( sprintf( __( 'View %1$s version %2$s details' ), $plugin_name, $r->new_version ) ),
    362365                $r->new_version,
    363                 wp_nonce_url( self_admin_url( 'update.php?action=upgrade-plugin&plugin=' ) . $file, 'upgrade-plugin_' . $file )
     366                wp_nonce_url( self_admin_url( 'update.php?action=upgrade-plugin&plugin=' ) . $file, 'upgrade-plugin_' . $file ),
     367                /* translators: %û: plugin name */
     368                esc_attr( sprintf( __( 'Update %s now' ), $plugin_name ) )
    364369            );
    365370        }
     
    451456    if ( !isset( $current->response[ $theme_key ] ) )
    452457        return false;
     458
    453459    $r = $current->response[ $theme_key ];
     460
     461    $theme_name = $theme['Name'];
    454462
    455463    $details_url = add_query_arg( array( 'TB_iframe' => 'true', 'width' => 1024, 'height' => 800 ), $current->response[ $theme_key ]['url'] );
     
    461469    echo '<tr class="plugin-update-tr' . $active . '" id="' . esc_attr( $theme->get_stylesheet() . '-update' ) . '" data-slug="' . esc_attr( $theme->get_stylesheet() ) . '"><td colspan="' . $wp_list_table->get_column_count() . '" class="plugin-update colspanchange"><div class="update-message">';
    462470    if ( ! current_user_can('update_themes') ) {
    463         /* translators: 1: theme name, 2: details URL, 3: escaped theme name, 4: version number */
    464         printf( __( 'There is a new version of %1$s available. <a href="%2$s" class="thickbox" aria-label="View %3$s version %4$s details">View version %4$s details</a>.'),
    465             $theme['Name'],
     471        /* translators: 1: theme name, 2: details URL, 3: accessibility text, 4: version number */
     472        printf( __( 'There is a new version of %1$s available. <a href="%2$s" class="thickbox" aria-label="%3$s">View version %4$s details</a>.'),
     473            $theme_name,
    466474            esc_url( $details_url ),
    467             esc_attr( $theme['Name'] ),
    468             $r->new_version
     475            /* translators: 1: theme name, 2: version number */
     476            esc_attr( sprintf( __( 'View %1$s version %2$s details' ), $theme_name, $r['new_version'] ) ),
     477            $r['new_version']
    469478        );
    470479    } elseif ( empty( $r['package'] ) ) {
    471         /* translators: 1: theme name, 2: details URL, 3: escaped theme name, 4: version number */
    472         printf( __( 'There is a new version of %1$s available. <a href="%2$s" class="thickbox" aria-label="View %3$s version %4$s details">View version %4$s details</a>. <em>Automatic update is unavailable for this theme.</em>' ),
    473             $theme['Name'],
     480        /* translators: 1: theme name, 2: details URL, 3: accessibility text, 4: version number */
     481        printf( __( 'There is a new version of %1$s available. <a href="%2$s" class="thickbox" aria-label="%3$s">View version %4$s details</a>. <em>Automatic update is unavailable for this theme.</em>' ),
     482            $theme_name,
    474483            esc_url( $details_url ),
    475             esc_attr( $theme['Name'] ),
     484            /* translators: 1: theme name, 2: version number */
     485            esc_attr( sprintf( __( 'View %1$s version %2$s details' ), $theme_name, $r['new_version'] ) ),
    476486            $r['new_version']
    477487        );
    478488    } else {
    479         /* translators: 1: theme name, 2: details URL, 3: escaped theme name, 4: version number, 5: update URL */
    480         printf( __( 'There is a new version of %1$s available. <a href="%2$s" class="thickbox" aria-label="View %3$s version %4$s details">View version %4$s details</a> or <a href="%5$s" class="update-link" aria-label="update %3$s now">update now</a>.' ),
    481             $theme['Name'],
     489        /* translators: 1: theme name, 2: details URL, 3: accessibility text, 4: version number, 5: update URL, 6: accessibility text */
     490        printf( __( 'There is a new version of %1$s available. <a href="%2$s" class="thickbox" aria-label="%3$s">View version %4$s details</a> or <a href="%5$s" class="update-link" aria-label="%6$s">update now</a>.' ),
     491            $theme_name,
    482492            esc_url( $details_url ),
    483             esc_attr( $theme['Name'] ),
     493            /* translators: 1: theme name, 2: version number */
     494            esc_attr( sprintf( __( 'View %1$s version %2$s details' ), $theme_name, $r['new_version'] ) ),
    484495            $r['new_version'],
    485             wp_nonce_url( self_admin_url( 'update.php?action=upgrade-theme&theme=' ) . $theme_key, 'upgrade-theme_' . $theme_key )
     496            wp_nonce_url( self_admin_url( 'update.php?action=upgrade-theme&theme=' ) . $theme_key, 'upgrade-theme_' . $theme_key ),
     497            /* translators: %s: theme name */
     498            esc_attr( sprintf( __( 'Update %s now' ), $theme_name ) )
    486499        );
    487500    }
Note: See TracChangeset for help on using the changeset viewer.