From 7b61f1305a2d06372192cfa39b6a84e5b6ecbf45 Mon Sep 17 00:00:00 2001 From: Joe Dolson Date: Thu, 11 Nov 2021 17:19:58 +0000 Subject: [PATCH] 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. git-svn-id: https://develop.svn.wordpress.org/trunk@52139 602fd350-edb4-49c9-b593-d223f7449a82 --- src/js/_enqueues/wp/updates.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/js/_enqueues/wp/updates.js b/src/js/_enqueues/wp/updates.js index 1e101f0c59..1e00589cec 100644 --- a/src/js/_enqueues/wp/updates.js +++ b/src/js/_enqueues/wp/updates.js @@ -33,6 +33,7 @@ var $document = $( document ), __ = wp.i18n.__, _x = wp.i18n._x, + _n = wp.i18n._n, sprintf = wp.i18n.sprintf; wp = wp || {}; @@ -352,8 +353,14 @@ $appearanceNavMenuUpdateCount = $( 'a[href="themes.php"] .update-plugins' ), itemCount; - $adminBarUpdates.find( '.ab-item' ).removeAttr( 'title' ); $adminBarUpdates.find( '.ab-label' ).text( settings.totals.counts.total ); + $adminBarUpdates.find( '.updates-available-text' ).text( + sprintf( + /* translators: %s: Total number of updates available. */ + _n( '%s update available', '%s updates available', settings.totals.counts.total ), + settings.totals.counts.total + ) + ); // Remove the update count from the toolbar if it's zero. if ( 0 === settings.totals.counts.total ) {