Changeset 38221
- Timestamp:
- 08/09/2016 01:13:08 AM (8 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/class-wp-plugin-install-list-table.php
r38119 r38221 477 477 } elseif ( current_user_can( 'activate_plugins' ) ) { 478 478 $button_text = __( 'Activate' ); 479 /* translators: %s: Plugin name */ 480 $button_label = _x( 'Activate %s', 'plugin' ); 479 481 $activate_url = add_query_arg( array( 480 482 '_wpnonce' => wp_create_nonce( 'activate-plugin_' . $status['file'] ), … … 485 487 if ( is_network_admin() ) { 486 488 $button_text = __( 'Network Activate' ); 489 /* translators: %s: Plugin name */ 490 $button_label = _x( 'Network Activate %s', 'plugin' ); 487 491 $activate_url = add_query_arg( array( 'networkwide' => 1 ), $activate_url ); 488 492 } … … 491 495 '<a href="%1$s" class="button activate-now button-secondary" aria-label="%2$s">%3$s</a>', 492 496 esc_url( $activate_url ), 493 /* translators: %s: Plugin name */ 494 esc_attr( sprintf( _x( 'Activate %s', 'plugin' ), $plugin['name'] ) ), 497 esc_attr( sprintf( $button_label, $plugin['name'] ) ), 495 498 $button_text 496 499 ); -
trunk/src/wp-admin/js/updates.js
r38218 r38221 524 524 } 525 525 526 $message.text( wp.updates.l10n.installing ); 526 if ( $message.html() !== wp.updates.l10n.installing ) { 527 $message.data( 'originaltext', $message.html() ); 528 } 527 529 528 530 $message 529 531 .addClass( 'updating-message' ) 530 .attr( 'aria-label', wp.updates.l10n.pluginInstallingLabel.replace( '%s', $message.data( 'name' ) ) ); 532 .attr( 'aria-label', wp.updates.l10n.pluginInstallingLabel.replace( '%s', $message.data( 'name' ) ) ) 533 .text( wp.updates.l10n.installing ); 531 534 532 535 wp.a11y.speak( wp.updates.l10n.installingMsg, 'polite' ); … … 1506 1509 response = wp.updates._addCallbacks( response, action ); 1507 1510 1508 wp.updates.queue. push( {1511 wp.updates.queue.unshift( { 1509 1512 action: action, 1510 1513 … … 1709 1712 } else if ( 'plugins' === pagenow || 'plugins-network' === pagenow ) { 1710 1713 $message = $( 'tr[data-plugin="' + job.data.plugin + '"]' ).find( '.update-message' ); 1711 } else if ( 'plugin-install' === pagenow || 'plugin-install-network' === pagenow ) {1712 $message = $( '.update-now.updating-message' );1713 1714 } else { 1714 1715 $message = $updatingMessage; 1715 1716 } 1716 1717 1717 if ( $message ) {1718 if ( $message && $message.hasClass( 'updating-message' ) ) { 1718 1719 originalText = $message.data( 'originaltext' ); 1719 1720 … … 1725 1726 .removeClass( 'updating-message' ) 1726 1727 .html( originalText ); 1728 1729 if ( 'plugin-install' === pagenow || 'plugin-install-network' === pagenow ) { 1730 if ( 'update-plugin' === job.action ) { 1731 $message.attr( 'aria-label', wp.updates.l10n.updateNowLabel.replace( '%s', $message.data( 'name' ) ) ); 1732 } else if ( 'install-plugin' === job.action ) { 1733 $message.attr( 'aria-label', wp.updates.l10n.installNowLabel.replace( '%s', $message.data( 'name' ) ) ); 1734 } 1735 } 1727 1736 } 1728 1737 … … 2000 2009 // Find all the checkboxes which have been checked. 2001 2010 itemsSelected.each( function( index, element ) { 2002 var $checkbox 2011 var $checkbox = $( element ), 2003 2012 $itemRow = $checkbox.parents( 'tr' ); 2004 2005 // Un-check the box.2006 $checkbox.prop( 'checked', false );2007 2013 2008 2014 // Only add update-able items to the update queue. 2009 2015 if ( 'update-selected' === bulkAction && ( ! $itemRow.hasClass( 'update' ) || $itemRow.find( 'notice-error' ).length ) ) { 2016 2017 // Un-check the box. 2018 $checkbox.prop( 'checked', false ); 2010 2019 return; 2011 2020 } … … 2023 2032 // Display bulk notification for updates of any kind. 2024 2033 $document.on( 'wp-plugin-update-success wp-plugin-update-error wp-theme-update-success wp-theme-update-error', function( event, response ) { 2025 var $bulkActionNotice, itemName; 2034 var $itemRow = $( '[data-slug="' + response.slug + '"]' ), 2035 $bulkActionNotice, itemName; 2026 2036 2027 2037 if ( 'wp-' + response.update + '-update-success' === event.type ) { 2028 2038 success++; 2029 2039 } else { 2030 itemName = response.pluginName ? response.pluginName : $ ( '[data-slug="' + response.slug + '"]' ).find( '.column-primary strong' ).text();2040 itemName = response.pluginName ? response.pluginName : $itemRow.find( '.column-primary strong' ).text(); 2031 2041 2032 2042 error++; 2033 2043 errorMessages.push( itemName + ': ' + response.errorMessage ); 2034 2044 } 2045 2046 $itemRow.find( 'input[name="checked[]"]:checked' ).prop( 'checked', false ); 2035 2047 2036 2048 wp.updates.adminNotice = wp.template( 'wp-bulk-updates-admin-notice' ); -
trunk/src/wp-includes/script-loader.php
r38205 r38221 617 617 'update' => __( 'Update' ), 618 618 'updateNow' => __( 'Update Now' ), 619 /* translators: %s: Plugin name and version */ 620 'updateNowLabel' => __( 'Update %s now' ), 619 621 'updateFailedShort' => __( 'Update Failed!' ), 620 622 /* translators: %s: Error string for a failed update */ … … 635 637 'installNow' => __( 'Install Now' ), 636 638 /* translators: %s: Plugin name */ 637 'installNowLabel' => __( 'Install %s ' ),639 'installNowLabel' => __( 'Install %s now' ), 638 640 'installing' => __( 'Installing...' ), 639 641 'installed' => __( 'Installed!' ), -
trunk/tests/qunit/fixtures/updates.js
r38205 r38221 10 10 'update': 'Update', 11 11 'updateNow': 'Update Now', 12 'updateNowLabel': 'Update %s now', 12 13 'updateFailedShort': 'Update Failed!', 13 14 'updateFailed': 'Update Failed: %s', … … 20 21 'beforeunload': 'Updates may not complete if you navigate away from this page.', 21 22 'installNow': 'Install Now', 23 'installNowLabel': 'Install %s now', 22 24 'installing': 'Installing...', 23 25 'installed': 'Installed!',
Note: See TracChangeset
for help on using the changeset viewer.