Make WordPress Core

Ticket #37563: 37563.11.diff

File 37563.11.diff, 7.3 KB (added by ocean90, 9 years ago)
  • src/wp-admin/includes/class-wp-plugin-install-list-table.php

     
    476476                                                        $action_links[] = '<button type="button" class="button button-disabled" disabled="disabled">' . _x( 'Active', 'plugin' ) . '</button>';
    477477                                                } elseif ( current_user_can( 'activate_plugins' ) ) {
    478478                                                        $button_text  = __( 'Activate' );
     479                                                        /* translators: %s: Plugin name */
     480                                                        $button_label = _x( 'Activate %s', 'plugin' );
    479481                                                        $activate_url = add_query_arg( array(
    480482                                                                '_wpnonce'    => wp_create_nonce( 'activate-plugin_' . $status['file'] ),
    481483                                                                'action'      => 'activate',
     
    484486
    485487                                                        if ( is_network_admin() ) {
    486488                                                                $button_text  = __( 'Network Activate' );
     489                                                                /* translators: %s: Plugin name */
     490                                                                $button_label = _x( 'Network Activate %s', 'plugin' );
    487491                                                                $activate_url = add_query_arg( array( 'networkwide' => 1 ), $activate_url );
    488492                                                        }
    489493
    490494                                                        $action_links[] = sprintf(
    491495                                                                '<a href="%1$s" class="button activate-now button-secondary" aria-label="%2$s">%3$s</a>',
    492496                                                                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'] ) ),
    495498                                                                $button_text
    496499                                                        );
    497500                                                } else {
  • src/wp-admin/js/updates.js

     
    523523                        $message = $( '[data-slug="' + args.slug + '"]' );
    524524                }
    525525
    526                 $message.text( wp.updates.l10n.installing );
     526                if ( $message.html() !== wp.updates.l10n.installing ) {
     527                        $message.data( 'originaltext', $message.html() );
     528                }
    527529
    528530                $message
    529531                        .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 );
    531534
    532535                wp.a11y.speak( wp.updates.l10n.installingMsg, 'polite' );
    533536
     
    15051508                // Restore callbacks.
    15061509                response = wp.updates._addCallbacks( response, action );
    15071510
    1508                 wp.updates.queue.push( {
     1511                wp.updates.queue.unshift( {
    15091512                        action: action,
    15101513
    15111514                        /*
     
    17081711                                $updatingMessage.removeClass( 'updating-message' );
    17091712                        } else if ( 'plugins' === pagenow || 'plugins-network' === pagenow ) {
    17101713                                $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' );
    17131714                        } else {
    17141715                                $message = $updatingMessage;
    17151716                        }
    17161717
    1717                         if ( $message ) {
     1718                        if ( $message && $message.hasClass( 'updating-message' ) ) {
    17181719                                originalText = $message.data( 'originaltext' );
    17191720
    17201721                                if ( 'undefined' === typeof originalText ) {
     
    17241725                                $message
    17251726                                        .removeClass( 'updating-message' )
    17261727                                        .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                                }
    17271736                        }
    17281737
    17291738                        wp.a11y.speak( wp.updates.l10n.updateCancel, 'polite' );
     
    19992008
    20002009                        // Find all the checkboxes which have been checked.
    20012010                        itemsSelected.each( function( index, element ) {
    2002                                 var $checkbox  = $( element ),
     2011                                var $checkbox = $( element ),
    20032012                                        $itemRow = $checkbox.parents( 'tr' );
    20042013
    2005                                 // Un-check the box.
    2006                                 $checkbox.prop( 'checked', false );
    2007 
    20082014                                // Only add update-able items to the update queue.
    20092015                                if ( 'update-selected' === bulkAction && ( ! $itemRow.hasClass( 'update' ) || $itemRow.find( 'notice-error' ).length ) ) {
     2016
     2017                                        // Un-check the box.
     2018                                        $checkbox.prop( 'checked', false );
    20102019                                        return;
    20112020                                }
    20122021
     
    20222031
    20232032                        // Display bulk notification for updates of any kind.
    20242033                        $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;
    20262036
    20272037                                if ( 'wp-' + response.update + '-update-success' === event.type ) {
    20282038                                        success++;
    20292039                                } 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();
    20312041
    20322042                                        error++;
    20332043                                        errorMessages.push( itemName + ': ' + response.errorMessage );
    20342044                                }
    20352045
     2046                                $itemRow.find( 'input[name="checked[]"]:checked' ).prop( 'checked', false );
     2047
    20362048                                wp.updates.adminNotice = wp.template( 'wp-bulk-updates-admin-notice' );
    20372049
    20382050                                wp.updates.addAdminNotice( {
  • src/wp-includes/script-loader.php

     
    616616                                'updated'                    => __( 'Updated!' ),
    617617                                'update'                     => __( 'Update' ),
    618618                                'updateNow'                  => __( 'Update Now' ),
     619                                /* translators: %s: Plugin name and version */
     620                                'updateNowLabel'             => __( 'Update %s now' ),
    619621                                'updateFailedShort'          => __( 'Update Failed!' ),
    620622                                /* translators: %s: Error string for a failed update */
    621623                                'updateFailed'               => __( 'Update Failed: %s' ),
     
    634636                                'beforeunload'               => __( 'Updates may not complete if you navigate away from this page.' ),
    635637                                'installNow'                 => __( 'Install Now' ),
    636638                                /* translators: %s: Plugin name */
    637                                 'installNowLabel'            => __( 'Install %s' ),
     639                                'installNowLabel'            => __( 'Install %s now' ),
    638640                                'installing'                 => __( 'Installing...' ),
    639641                                'installed'                  => __( 'Installed!' ),
    640642                                'installFailedShort'         => __( 'Install Failed!' ),
  • tests/qunit/fixtures/updates.js

     
    99                'updated': 'Updated!',
    1010                'update': 'Update',
    1111                'updateNow': 'Update Now',
     12                'updateNowLabel': 'Update %s now',
    1213                'updateFailedShort': 'Update Failed!',
    1314                'updateFailed': 'Update Failed: %s',
    1415                'updatingLabel': 'Updating %s...',
     
    1920                'updateCancel': 'Update canceled.',
    2021                'beforeunload': 'Updates may not complete if you navigate away from this page.',
    2122                'installNow': 'Install Now',
     23                'installNowLabel': 'Install %s now',
    2224                'installing': 'Installing...',
    2325                'installed': 'Installed!',
    2426                'installFailedShort': 'Install Failed!',