Make WordPress Core

Ticket #55316: 55316.3.diff

File 55316.3.diff, 2.3 KB (added by costdev, 4 years ago)

Patch updated with i18n.

  • src/js/_enqueues/wp/updates.js

    diff --git a/src/js/_enqueues/wp/updates.js b/src/js/_enqueues/wp/updates.js
    index 1e00589cec..64aa42d0d8 100644
    a b  
    970970                        var $form            = $( '#bulk-action-form' ),
    971971                                $views           = $( '.subsubsub' ),
    972972                                $pluginRow       = $( this ),
     973                                $currentView     = $views.find( '[aria-current="page"]' ),
     974                                $itemsCount      = $( '.displaying-num' ),
    973975                                columnCount      = $form.find( 'thead th:not(.hidden), thead td' ).length,
    974976                                pluginDeletedRow = wp.template( 'item-deleted-row' ),
    975977                                /**
     
    977979                                 *
    978980                                 * @type {Object}
    979981                                 */
    980                                 plugins          = settings.plugins;
     982                                plugins          = settings.plugins,
     983                                remainingCount;
    981984
    982985                        // Add a success message after deleting a plugin.
    983986                        if ( ! $pluginRow.hasClass( 'plugin-update-tr' ) ) {
     
    10571060                                        $form.find( '#the-list' ).append( '<tr class="no-items"><td class="colspanchange" colspan="' + columnCount + '">' + __( 'No plugins are currently available.' ) + '</td></tr>' );
    10581061                                }
    10591062                        }
     1063
     1064                        if ( $itemsCount.length && $currentView.length ) {
     1065                                remainingCount = plugins[ $currentView.parent( 'li' ).attr('class') ].length;
     1066                                $itemsCount.text(
     1067                                        sprintf(
     1068                                                /* translators: %s: The remaining number of plugins. */
     1069                                                _n( '%s item', '%s items', remainingCount ),
     1070                                                remainingCount
     1071                                        )
     1072                                );
     1073                        }
    10601074                } );
    10611075
    10621076                wp.a11y.speak( _x( 'Deleted!', 'plugin' ) );
  • src/wp-includes/script-loader.php

    diff --git a/src/wp-includes/script-loader.php b/src/wp-includes/script-loader.php
    index 25615b77a9..21be7f9a70 100644
    a b function wp_default_scripts( $scripts ) { 
    13291329                $scripts->add( 'privacy-tools', "/wp-admin/js/privacy-tools$suffix.js", array( 'jquery', 'wp-a11y' ), false, 1 );
    13301330                $scripts->set_translations( 'privacy-tools' );
    13311331
    1332                 $scripts->add( 'updates', "/wp-admin/js/updates$suffix.js", array( 'common', 'jquery', 'wp-util', 'wp-a11y', 'wp-sanitize' ), false, 1 );
     1332                $scripts->add( 'updates', "/wp-admin/js/updates$suffix.js", array( 'common', 'jquery', 'wp-util', 'wp-a11y', 'wp-sanitize', 'wp-i18n' ), false, 1 );
    13331333                $scripts->set_translations( 'updates' );
    13341334                did_action( 'init' ) && $scripts->localize(
    13351335                        'updates',