Index: src/wp-admin/includes/class-wp-plugin-install-list-table.php
===================================================================
--- src/wp-admin/includes/class-wp-plugin-install-list-table.php (revision 31951)
+++ src/wp-admin/includes/class-wp-plugin-install-list-table.php (working copy)
@@ -402,7 +402,7 @@
case 'install':
if ( $status['url'] ) {
/* translators: 1: Plugin name and version. */
- $action_links[] = '' . __( 'Install Now' ) . '';
+ $action_links[] = '' . __( 'Install Now' ) . '';
}
break;
@@ -409,7 +409,7 @@
case 'update_available':
if ( $status['url'] ) {
/* translators: 1: Plugin name and version */
- $action_links[] = '' . __( 'Update Now' ) . '';
+ $action_links[] = '' . __( 'Update Now' ) . '';
}
break;
Index: src/wp-admin/js/updates.js
===================================================================
--- src/wp-admin/js/updates.js (revision 31951)
+++ src/wp-admin/js/updates.js (working copy)
@@ -33,7 +33,7 @@
/**
* Filesystem credentials to be packaged along with the request.
*
- * @since 4.2.0
+ * @since 4.2.0
*
* @var object
*/
@@ -96,10 +96,10 @@
*/
wp.updates.decrementCount = function( upgradeType ) {
var count,
- pluginCount,
- $adminBarUpdateCount = $( '#wp-admin-bar-updates .ab-label' ),
- $dashboardNavMenuUpdateCount = $( 'a[href="update-core.php"] .update-plugins' ),
- $pluginsMenuItem = $( '#menu-plugins' );
+ pluginCount,
+ $adminBarUpdateCount = $( '#wp-admin-bar-updates .ab-label' ),
+ $dashboardNavMenuUpdateCount = $( 'a[href="update-core.php"] .update-plugins' ),
+ $pluginsMenuItem = $( '#menu-plugins' );
count = $adminBarUpdateCount.text();
@@ -145,11 +145,13 @@
* @param {string} slug
*/
wp.updates.updatePlugin = function( plugin, slug ) {
- var $message;
+ var $message, name;
if ( 'plugins' === pagenow || 'plugins-network' === pagenow ) {
$message = $( '[data-slug="' + slug + '"]' ).next().find( '.update-message' );
} else if ( 'plugin-install' === pagenow ) {
$message = $( '.plugin-card-' + slug ).find( '.update-now' );
+ name = $message.data( 'name' );
+ $message.attr( 'aria-label', wp.updates.l10n.updatingLabel.replace( '%s', name ) );
}
$message.addClass( 'updating-message' );
@@ -198,18 +200,22 @@
* @param {object} response
*/
wp.updates.updateSuccess = function( response ) {
- var $updateMessage;
+ var $updateMessage, name;
if ( 'plugins' === pagenow || 'plugins-network' === pagenow ) {
- var $pluginRow = $( '[data-slug="' + response.slug + '"]' ).first();
+ var $pluginRow = $( '[data-slug="' + response.slug + '"]' ).first(),
+ newText = $pluginRow.find( '.plugin-version-author-uri' ).html().replace( response.oldVersion, response.newVersion );
+
$updateMessage = $pluginRow.next().find( '.update-message' );
$pluginRow.addClass( 'updated' ).removeClass( 'update' );
// Update the version number in the row.
- var newText = $pluginRow.find('.plugin-version-author-uri').html().replace( response.oldVersion, response.newVersion );
- $pluginRow.find('.plugin-version-author-uri').html( newText );
+ $pluginRow.find( '.plugin-version-author-uri' ).html( newText );
} else if ( 'plugin-install' === pagenow ) {
$updateMessage = $( '.plugin-card-' + response.slug ).find( '.update-now' );
$updateMessage.addClass( 'button-disabled' );
+
+ name = $updateMessage.data( 'name' );
+ $updateMessage.attr( 'aria-label', wp.updates.l10n.updatedLabel.replace( '%s', name ) );
}
$updateMessage.removeClass( 'updating-message' ).addClass( 'updated-message' );
@@ -236,7 +242,7 @@
* @param {object} response
*/
wp.updates.updateError = function( response ) {
- var $message;
+ var $message, name;
wp.updates.updateDoneSuccessfully = false;
if ( response.errorCode && response.errorCode == 'unable_to_connect_to_filesystem' ) {
wp.updates.credentialError( response, 'update-plugin' );
@@ -246,6 +252,9 @@
$message = $( '[data-slug="' + response.slug + '"]' ).next().find( '.update-message' );
} else if ( 'plugin-install' === pagenow ) {
$message = $( '.plugin-card-' + response.slug ).find( '.update-now' );
+
+ name = $message.data( 'name' );
+ $message.attr( 'aria-label', wp.updates.l10n.updateFailedLabel.replace( '%s', name ) );
}
$message.removeClass( 'updating-message' );
$message.text( wp.updates.l10n.updateFailed );
Index: src/wp-includes/script-loader.php
===================================================================
--- src/wp-includes/script-loader.php (revision 31951)
+++ src/wp-includes/script-loader.php (working copy)
@@ -524,12 +524,15 @@
did_action( 'init' ) && $scripts->localize( 'updates', '_wpUpdatesSettings', array(
'ajax_nonce' => wp_create_nonce( 'updates' ),
'l10n' => array(
- 'updating' => __( 'Updating...' ),
- 'updated' => __( 'Updated!' ),
- 'updateFailed' => __( 'Update failed.' ),
- 'updatingMsg' => __( 'Updating... please wait.' ),
- 'updatedMsg' => __( 'Update completed successfully.' ),
- 'updateCancel' => __( 'Update canceled' ),
+ 'updating' => __( 'Updating...' ),
+ 'updated' => __( 'Updated!' ),
+ 'updateFailed' => __( 'Update Failed' ),
+ 'updatingLabel' => __( 'Updating %s...' ),
+ 'updatedLabel' => __( '%s updated!' ),
+ 'updateFailedLabel' => __( '%s update failed' ),
+ 'updatingMsg' => __( 'Updating... please wait.' ),
+ 'updatedMsg' => __( 'Update completed successfully.' ),
+ 'updateCancel' => __( 'Update canceled.' ),
)
) );