Make WordPress Core

Changeset 52139


Ignore:
Timestamp:
11/11/2021 05:19:58 PM (3 years ago)
Author:
joedolson
Message:

Upgrade/Install: Update screen reader text counts in adminbar.

Update the hidden screen-reader-text update count in the adminbar when updates are run on the plugin or theme screens.

Props pento, paulschreiber, adamsilverstein, afercia, SergeyBiryukov, sabernhardt.
Fixes #29022.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/js/_enqueues/wp/updates.js

    r50547 r52139  
    3434        __ = wp.i18n.__,
    3535        _x = wp.i18n._x,
     36        _n = wp.i18n._n,
    3637        sprintf = wp.i18n.sprintf;
    3738
     
    353354            itemCount;
    354355
    355         $adminBarUpdates.find( '.ab-item' ).removeAttr( 'title' );
    356356        $adminBarUpdates.find( '.ab-label' ).text( settings.totals.counts.total );
     357        $adminBarUpdates.find( '.updates-available-text' ).text(
     358            sprintf(
     359                /* translators: %s: Total number of updates available. */
     360                _n( '%s update available', '%s updates available', settings.totals.counts.total ),
     361                settings.totals.counts.total
     362            )
     363        );
    357364
    358365        // Remove the update count from the toolbar if it's zero.
Note: See TracChangeset for help on using the changeset viewer.