WordPress.org

Make WordPress Core

Changeset 36032


Ignore:
Timestamp:
12/20/2015 04:08:38 PM (5 years ago)
Author:
afercia
Message:

Accessibility: Remove title attributes from the updates links on the Plugin and Themes list tables.

Adds aria-label attributes on some links and on the "update nag" link. Adds translator comments.

Fixes #35167.

File:
1 edited

Legend:

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

    r34912 r36032  
    232232
    233233    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">Please update now</a>.'), $cur->current, network_admin_url( 'update-core.php' ) );
     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' ) );
    235235    } else {
    236236        $msg = sprintf( __('<a href="https://codex.wordpress.org/Version_%1$s">WordPress %1$s</a> is available! Please notify the site administrator.'), $cur->current );
     
    339339
    340340        if ( ! current_user_can( 'update_plugins' ) ) {
    341             printf( __('There is a new version of %1$s available. <a href="%2$s" class="thickbox" title="%3$s">View version %4$s details</a>.'), $plugin_name, esc_url($details_url), esc_attr($plugin_name), $r->new_version );
    342         } elseif ( empty($r->package) ) {
    343             printf( __('There is a new version of %1$s available. <a href="%2$s" class="thickbox" title="%3$s">View version %4$s details</a>. <em>Automatic update is unavailable for this plugin.</em>'), $plugin_name, esc_url($details_url), esc_attr($plugin_name), $r->new_version );
     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>.' ),
     343                $plugin_name,
     344                esc_url( $details_url ),
     345                esc_attr( $plugin_name ),
     346                $r->new_version
     347            );
     348        } 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>' ),
     351                $plugin_name,
     352                esc_url( $details_url ),
     353                esc_attr( $plugin_name ),
     354                $r->new_version
     355            );
    344356        } else {
    345             printf( __( 'There is a new version of %1$s available. <a href="%2$s" class="thickbox" title="%3$s">View version %4$s details</a> or <a href="%5$s" class="update-link">update now</a>.' ), $plugin_name, esc_url( $details_url ), esc_attr( $plugin_name ), $r->new_version, wp_nonce_url( self_admin_url( 'update.php?action=upgrade-plugin&plugin=' ) . $file, 'upgrade-plugin_' . $file ) );
     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                $plugin_name,
     360                esc_url( $details_url ),
     361                esc_attr( $plugin_name ),
     362                $r->new_version,
     363                wp_nonce_url( self_admin_url( 'update.php?action=upgrade-plugin&plugin=' ) . $file, 'upgrade-plugin_' . $file )
     364            );
    346365        }
    347366        /**
     
    440459    echo '<tr class="plugin-update-tr"><td colspan="' . $wp_list_table->get_column_count() . '" class="plugin-update colspanchange"><div class="update-message">';
    441460    if ( ! current_user_can('update_themes') ) {
    442         printf( __('There is a new version of %1$s available. <a href="%2$s" class="thickbox" title="%3$s">View version %4$s details</a>.'), $theme['Name'], esc_url($details_url), esc_attr($theme['Name']), $r->new_version );
     461        /* translators: 1: theme name, 2: details URL, 3: escaped theme name, 4: version number */
     462        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>.'),
     463            $theme['Name'],
     464            esc_url( $details_url ),
     465            esc_attr( $theme['Name'] ),
     466            $r->new_version
     467        );
    443468    } elseif ( empty( $r['package'] ) ) {
    444         printf( __('There is a new version of %1$s available. <a href="%2$s" class="thickbox" title="%3$s">View version %4$s details</a>. <em>Automatic update is unavailable for this theme.</em>'), $theme['Name'], esc_url($details_url), esc_attr($theme['Name']), $r['new_version'] );
     469        /* translators: 1: theme name, 2: details URL, 3: escaped theme name, 4: version number */
     470        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>' ),
     471            $theme['Name'],
     472            esc_url( $details_url ),
     473            esc_attr( $theme['Name'] ),
     474            $r['new_version']
     475        );
    445476    } else {
    446         printf( __('There is a new version of %1$s available. <a href="%2$s" class="thickbox" title="%3$s">View version %4$s details</a> or <a href="%5$s">update now</a>.'), $theme['Name'], esc_url($details_url), esc_attr($theme['Name']), $r['new_version'], wp_nonce_url( self_admin_url('update.php?action=upgrade-theme&theme=') . $theme_key, 'upgrade-theme_' . $theme_key) );
     477        /* translators: 1: theme name, 2: details URL, 3: escaped theme name, 4: version number, 5: update URL */
     478        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" aria-label="update %3$s now">update now</a>.' ),
     479            $theme['Name'],
     480            esc_url( $details_url ),
     481            esc_attr( $theme['Name'] ),
     482            $r['new_version'],
     483            wp_nonce_url( self_admin_url( 'update.php?action=upgrade-theme&theme=' ) . $theme_key, 'upgrade-theme_' . $theme_key )
     484        );
    447485    }
    448486    /**
Note: See TracChangeset for help on using the changeset viewer.