<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[44924] trunk/src: Accessibility: Improve the Comments and Privacy count text.</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { white-space: pre-line; overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta" style="font-size: 105%">
<dt style="float: left; width: 6em; font-weight: bold">Revision</dt> <dd><a style="font-weight: bold" href="https://core.trac.wordpress.org/changeset/44924">44924</a><script type="application/ld+json">{"@context":"http://schema.org","@type":"EmailMessage","description":"Review this Commit","action":{"@type":"ViewAction","url":"https://core.trac.wordpress.org/changeset/44924","name":"Review Commit"}}</script></dd>
<dt style="float: left; width: 6em; font-weight: bold">Author</dt> <dd>afercia</dd>
<dt style="float: left; width: 6em; font-weight: bold">Date</dt> <dd>2019-03-18 15:21:17 +0000 (Mon, 18 Mar 2019)</dd>
</dl>
<pre style='padding-left: 1em; margin: 2em 0; border-left: 2px solid #ccc; line-height: 1.25; font-size: 105%; font-family: sans-serif'>Accessibility: Improve the Comments and Privacy count text.
- standardizes the Comment count string to `%s Comment in moderation', '%s Comments in moderation` so it can be bulk-updated
- adds the string as visually hidden text in the admin menu
- introduces an `updateInModerationText` JS simple function, responsible to correctly update all the related text using the data from the AJAX response
- adds a visually hidden text "1 Privacy Policy update" to the Privacy menu items count
- adds/improves translators comments
Changes that apply to all the count bubbles (Updates, plugins, etc.)
- makes the bubbles and their text slightly bigger
- improves the active menu item bubble contrast by changing the background color to red (option 2 in the screenshot attached in a previous comment)
Props adamsoucie, afercia.
Fixes <a href="https://core.trac.wordpress.org/ticket/33030">#33030</a>.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunksrcjs_enqueuesadmineditcommentsjs">trunk/src/js/_enqueues/admin/edit-comments.js</a></li>
<li><a href="#trunksrcwpadmincssadminmenucss">trunk/src/wp-admin/css/admin-menu.css</a></li>
<li><a href="#trunksrcwpadminincludesajaxactionsphp">trunk/src/wp-admin/includes/ajax-actions.php</a></li>
<li><a href="#trunksrcwpadminincludesdashboardphp">trunk/src/wp-admin/includes/dashboard.php</a></li>
<li><a href="#trunksrcwpadminmenuphp">trunk/src/wp-admin/menu.php</a></li>
<li><a href="#trunksrcwpincludesadminbarphp">trunk/src/wp-includes/admin-bar.php</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunksrcjs_enqueuesadmineditcommentsjs"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/js/_enqueues/admin/edit-comments.js</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/js/_enqueues/admin/edit-comments.js 2019-03-17 13:10:44 UTC (rev 44923)
+++ trunk/src/js/_enqueues/admin/edit-comments.js 2019-03-18 15:21:17 UTC (rev 44924)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -7,7 +7,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> (function($) {
</span><span class="cx" style="display: block; padding: 0 10px"> var getCount, updateCount, updateCountText, updatePending, updateApproved,
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- updateHtmlTitle, updateDashboardText, adminTitle = document.title,
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ updateHtmlTitle, updateDashboardText, updateInModerationText, adminTitle = document.title,
</ins><span class="cx" style="display: block; padding: 0 10px"> isDashboard = $('#dashboard_right_now').length,
</span><span class="cx" style="display: block; padding: 0 10px"> titleDiv, titleRegEx;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -86,20 +86,38 @@
</span><span class="cx" style="display: block; padding: 0 10px"> });
</span><span class="cx" style="display: block; padding: 0 10px"> };
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- updateDashboardText = function ( response ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ updateDashboardText = function( response ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( ! isDashboard || ! response || ! response.i18n_comments_text ) {
</span><span class="cx" style="display: block; padding: 0 10px"> return;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- var rightNow = $( '#dashboard_right_now' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $( '.comment-count a', '#dashboard_right_now' ).text( response.i18n_comments_text );
+ };
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $( '.comment-count a', rightNow ).text( response.i18n_comments_text );
- $( '.comment-mod-count a', rightNow ).text( response.i18n_moderation_text )
- .parent()
- [ response.in_moderation > 0 ? 'removeClass' : 'addClass' ]( 'hidden' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * Updates the "comments in moderation" text across the UI.
+ *
+ * @since 5.2.0
+ *
+ * @param {object} response Ajax response from the server.
+ *
+ * @return {void}
+ */
+ updateInModerationText = function( response ) {
+ if ( ! response || ! response.i18n_moderation_text ) {
+ return;
+ }
+
+ // Update the "comment in moderation" text across the UI.
+ $( '.comments-in-moderation-text' ).text( response.i18n_moderation_text );
+ // Hide the "comment in moderation" text in the Dashboard "At a Glance" widget.
+ if ( isDashboard && response.in_moderation ) {
+ $( '.comment-mod-count', '#dashboard_right_now' )
+ [ response.in_moderation > 0 ? 'removeClass' : 'addClass' ]( 'hidden' );
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> };
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- updateHtmlTitle = function ( diff ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ updateHtmlTitle = function( diff ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> var newTitle, regExMatch, titleCount, commentFrag;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> titleRegEx = titleRegEx || new RegExp( adminCommentsL10n.docTitleCommentsCount.replace( '%s', '\\([0-9' + thousandsSeparator + ']+\\)' ) + '?' );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -238,6 +256,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> diff = $('#' + settings.element).is('.' + settings.dimClass) ? 1 : -1;
</span><span class="cx" style="display: block; padding: 0 10px"> if ( response ) {
</span><span class="cx" style="display: block; padding: 0 10px"> updateDashboardText( response.supplemental );
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ updateInModerationText( response.supplemental );
</ins><span class="cx" style="display: block; padding: 0 10px"> updatePending( diff, response.supplemental.postId );
</span><span class="cx" style="display: block; padding: 0 10px"> updateApproved( -1 * diff, response.supplemental.postId );
</span><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -318,7 +337,11 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> spamDiff, trashDiff, pendingDiff, approvedDiff,
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- approved = commentRow.hasClass( 'approved' ),
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /*
+ * As `wpList` toggles only the `unapproved` class, the approved comment
+ * rows can have both the `approved` and `unapproved` classes.
+ */
+ approved = commentRow.hasClass( 'approved' ) && ! commentRow.hasClass( 'unapproved' ),
</ins><span class="cx" style="display: block; padding: 0 10px"> unapproved = commentRow.hasClass( 'unapproved' ),
</span><span class="cx" style="display: block; padding: 0 10px"> spammed = commentRow.hasClass( 'spam' ),
</span><span class="cx" style="display: block; padding: 0 10px"> trashed = commentRow.hasClass( 'trash' ),
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -325,6 +348,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> undoing = false; // ticket #35904
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> updateDashboardText( newTotal );
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ updateInModerationText( newTotal );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // the order of these checks is important
</span><span class="cx" style="display: block; padding: 0 10px"> // .unspam can also have .approve or .unapprove
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -508,7 +532,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> refillTheExtraList();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> animated = $( ':animated', '#the-comment-list' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- animatedCallback = function () {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ animatedCallback = function() {
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( ! $( '#the-comment-list tr:visible' ).length ) {
</span><span class="cx" style="display: block; padding: 0 10px"> theList.get(0).wpList.add( theExtraList.find( '.no-items' ).clone() );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -603,10 +627,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> });
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> this.comments_listing = $('#comments-form > input[name="comment_status"]').val() || '';
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-
- /* $(listTable).bind('beforeChangePage', function(){
- commentReply.close();
- }); */
</del><span class="cx" style="display: block; padding: 0 10px"> },
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> addEvents : function(r) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -843,12 +863,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( r.supplemental.i18n_comments_text ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( isDashboard ) {
- updateDashboardText( r.supplemental );
- } else {
- updateApproved( 1, r.supplemental.parent_post_id );
- updateCountText( 'span.all-count', 1 );
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ updateDashboardText( r.supplemental );
+ updateInModerationText( r.supplemental );
+ updateApproved( 1, r.supplemental.parent_post_id );
+ updateCountText( 'span.all-count', 1 );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> c = $.trim(r.data); // Trim leading whitespaces
</span></span></pre></div>
<a id="trunksrcwpadmincssadminmenucss"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-admin/css/admin-menu.css</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/css/admin-menu.css 2019-03-17 13:10:44 UTC (rev 44923)
+++ trunk/src/wp-admin/css/admin-menu.css 2019-03-18 15:21:17 UTC (rev 44924)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -515,14 +515,15 @@
</span><span class="cx" style="display: block; padding: 0 10px"> #adminmenu .update-plugins {
</span><span class="cx" style="display: block; padding: 0 10px"> display: inline-block;
</span><span class="cx" style="display: block; padding: 0 10px"> vertical-align: top;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- margin: 1px 0 0 2px;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ box-sizing: border-box;
+ margin: 1px 0 -1px 2px;
</ins><span class="cx" style="display: block; padding: 0 10px"> padding: 0 5px;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- min-width: 7px;
- height: 17px;
- border-radius: 11px;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ min-width: 18px;
+ height: 18px;
+ border-radius: 9px;
</ins><span class="cx" style="display: block; padding: 0 10px"> background-color: #ca4a1f;
</span><span class="cx" style="display: block; padding: 0 10px"> color: #fff;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- font-size: 9px;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ font-size: 11px;
</ins><span class="cx" style="display: block; padding: 0 10px"> line-height: 17px;
</span><span class="cx" style="display: block; padding: 0 10px"> text-align: center;
</span><span class="cx" style="display: block; padding: 0 10px"> z-index: 26;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -530,7 +531,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> #adminmenu li.current a .awaiting-mod,
</span><span class="cx" style="display: block; padding: 0 10px"> #adminmenu li a.wp-has-current-submenu .update-plugins {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- background-color: #00b9eb;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ background-color: #ca4a1f;
</ins><span class="cx" style="display: block; padding: 0 10px"> color: #fff;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span></span></pre></div>
<a id="trunksrcwpadminincludesajaxactionsphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-admin/includes/ajax-actions.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/includes/ajax-actions.php 2019-03-17 13:10:44 UTC (rev 44923)
+++ trunk/src/wp-admin/includes/ajax-actions.php 2019-03-18 15:21:17 UTC (rev 44924)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -460,7 +460,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="cx" style="display: block; padding: 0 10px"> 'i18n_moderation_text' => sprintf(
</span><span class="cx" style="display: block; padding: 0 10px"> /* translators: %s: number of comments in moderation */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- _nx( '%s in moderation', '%s in moderation', $counts->moderated, 'comments' ),
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ _n( '%s Comment in moderation', '%s Comments in moderation', $counts->moderated ),
</ins><span class="cx" style="display: block; padding: 0 10px"> number_format_i18n( $counts->moderated )
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="cx" style="display: block; padding: 0 10px"> 'comment_link' => $comment_link,
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -509,21 +509,27 @@
</span><span class="cx" style="display: block; padding: 0 10px"> // The time since the last comment count.
</span><span class="cx" style="display: block; padding: 0 10px"> $time = time();
</span><span class="cx" style="display: block; padding: 0 10px"> $comment = get_comment( $comment_id );
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $counts = wp_count_comments();
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $x = new WP_Ajax_Response(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'what' => 'comment',
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // Here for completeness - not used.
</del><span class="cx" style="display: block; padding: 0 10px"> 'id' => $comment_id,
</span><span class="cx" style="display: block; padding: 0 10px"> 'supplemental' => array(
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'status' => $comment ? $comment->comment_approved : '',
- 'postId' => $comment ? $comment->comment_post_ID : '',
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'status' => $comment ? $comment->comment_approved : '',
+ 'postId' => $comment ? $comment->comment_post_ID : '',
</ins><span class="cx" style="display: block; padding: 0 10px"> /* translators: %s: number of comments */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'total_items_i18n' => sprintf( _n( '%s item', '%s items', $total ), number_format_i18n( $total ) ),
- 'total_pages' => ceil( $total / $per_page ),
- 'total_pages_i18n' => number_format_i18n( ceil( $total / $per_page ) ),
- 'total' => $total,
- 'time' => $time,
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'total_items_i18n' => sprintf( _n( '%s item', '%s items', $total ), number_format_i18n( $total ) ),
+ 'total_pages' => ceil( $total / $per_page ),
+ 'total_pages_i18n' => number_format_i18n( ceil( $total / $per_page ) ),
+ 'total' => $total,
+ 'time' => $time,
+ 'in_moderation' => $counts->moderated,
+ 'i18n_moderation_text' => sprintf(
+ /* translators: %s: number of comments in moderation */
+ _n( '%s Comment in moderation', '%s Comments in moderation', $counts->moderated ),
+ number_format_i18n( $counts->moderated )
+ ),
</ins><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1291,8 +1297,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> number_format_i18n( $counts->approved )
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="cx" style="display: block; padding: 0 10px"> 'i18n_moderation_text' => sprintf(
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- /* translators: %s: number of comments moderated */
- _nx( '%s in moderation', '%s in moderation', $counts->moderated, 'comments' ),
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /* translators: %s: number of comments in moderation */
+ _n( '%s Comment in moderation', '%s Comments in moderation', $counts->moderated ),
</ins><span class="cx" style="display: block; padding: 0 10px"> number_format_i18n( $counts->moderated )
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span></span></pre></div>
<a id="trunksrcwpadminincludesdashboardphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-admin/includes/dashboard.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/includes/dashboard.php 2019-03-17 13:10:44 UTC (rev 44923)
+++ trunk/src/wp-admin/includes/dashboard.php 2019-03-18 15:21:17 UTC (rev 44924)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -291,9 +291,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> <?php
</span><span class="cx" style="display: block; padding: 0 10px"> $moderated_comments_count_i18n = number_format_i18n( $num_comm->moderated );
</span><span class="cx" style="display: block; padding: 0 10px"> /* translators: %s: number of comments in moderation */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $text = sprintf( _nx( '%s in moderation', '%s in moderation', $num_comm->moderated, 'comments' ), $moderated_comments_count_i18n );
- /* translators: %s: number of comments in moderation */
- $aria_label = sprintf( _nx( '%s comment in moderation', '%s comments in moderation', $num_comm->moderated, 'comments' ), $moderated_comments_count_i18n );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $text = sprintf( _n( '%s Comment in moderation', '%s Comments in moderation', $num_comm->moderated ), $moderated_comments_count_i18n );
</ins><span class="cx" style="display: block; padding: 0 10px"> ?>
</span><span class="cx" style="display: block; padding: 0 10px"> <li class="comment-mod-count
</span><span class="cx" style="display: block; padding: 0 10px"> <?php
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -301,7 +299,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> echo ' hidden';
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> ?>
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- "><a href="edit-comments.php?comment_status=moderated" aria-label="<?php echo esc_attr( $aria_label ); ?>"><?php echo $text; ?></a></li>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ "><a href="edit-comments.php?comment_status=moderated" class="comments-in-moderation-text"><?php echo $text; ?></a></li>
</ins><span class="cx" style="display: block; padding: 0 10px"> <?php
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span></span></pre></div>
<a id="trunksrcwpadminmenuphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-admin/menu.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/menu.php 2019-03-17 13:10:44 UTC (rev 44923)
+++ trunk/src/wp-admin/menu.php 2019-03-18 15:21:17 UTC (rev 44924)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -42,6 +42,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><span class="cx" style="display: block; padding: 0 10px"> $cap = 'update_languages';
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /* translators: %s: number of pending updates */
</ins><span class="cx" style="display: block; padding: 0 10px"> $submenu['index.php'][10] = array( sprintf( __( 'Updates %s' ), "<span class='update-plugins count-{$update_data['counts']['total']}'><span class='update-count'>" . number_format_i18n( $update_data['counts']['total'] ) . '</span></span>' ), $cap, 'update-core.php' );
</span><span class="cx" style="display: block; padding: 0 10px"> unset( $cap );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -74,10 +75,15 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Avoid the comment count query for users who cannot edit_posts.
</span><span class="cx" style="display: block; padding: 0 10px"> if ( current_user_can( 'edit_posts' ) ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $awaiting_mod = wp_count_comments();
- $awaiting_mod = $awaiting_mod->moderated;
- $menu[25] = array(
- sprintf( __( 'Comments %s' ), '<span class="awaiting-mod count-' . absint( $awaiting_mod ) . '"><span class="pending-count">' . number_format_i18n( $awaiting_mod ) . '</span></span>' ),
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $awaiting_mod = wp_count_comments();
+ $awaiting_mod = $awaiting_mod->moderated;
+ $awaiting_mod_i18n = number_format_i18n( $awaiting_mod );
+ /* translators: %s: number of comments in moderation */
+ $awaiting_mod_text = sprintf( _n( '%s Comment in moderation', '%s Comments in moderation', $awaiting_mod ), $awaiting_mod_i18n );
+
+ $menu[25] = array(
+ /* translators: %s: number of comments in moderation */
+ sprintf( __( 'Comments %s' ), '<span class="awaiting-mod count-' . absint( $awaiting_mod ) . '"><span class="pending-count" aria-hidden="true">' . $awaiting_mod_i18n . '</span><span class="comments-in-moderation-text screen-reader-text">' . $awaiting_mod_text . '</span></span>' ),
</ins><span class="cx" style="display: block; padding: 0 10px"> 'edit_posts',
</span><span class="cx" style="display: block; padding: 0 10px"> 'edit-comments.php',
</span><span class="cx" style="display: block; padding: 0 10px"> '',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -214,6 +220,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $count = "<span class='update-plugins count-{$update_data['counts']['plugins']}'><span class='plugin-count'>" . number_format_i18n( $update_data['counts']['plugins'] ) . '</span></span>';
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+/* translators: %s: number of pending plugin updates */
</ins><span class="cx" style="display: block; padding: 0 10px"> $menu[65] = array( sprintf( __( 'Plugins %s' ), $count ), 'activate_plugins', 'plugins.php', '', 'menu-top menu-icon-plugins', 'menu-plugins', 'dashicons-admin-plugins' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $submenu['plugins.php'][5] = array( __( 'Installed Plugins' ), 'activate_plugins', 'plugins.php' );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -264,11 +271,14 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $change_notice = '';
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-if ( current_user_can( 'manage_privacy_options' ) && WP_Privacy_Policy_Content::text_change_check() ) {
- $change_notice = ' <span class="update-plugins 1"><span class="plugin-count">' . number_format_i18n( 1 ) . '</span></span>';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+if ( current_user_can( 'manage_privacy_options' ) && ! WP_Privacy_Policy_Content::text_change_check() ) {
+ $change_notice_number = number_format_i18n( 1 );
+ /* translators: %s: number of Privacy Policy update is always 1 */
+ $change_notice_text = sprintf( __( '%s Privacy Policy update' ), $change_notice_number );
+ $change_notice = '<span class="update-plugins 1"><span class="plugin-count" aria-hidden="true">' . $change_notice_number . '</span><span class="screen-reader-text">' . $change_notice_text . '</span></span>';
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-// translators: %s is the update notification bubble, if updates are available.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+/* translators: %s: update notification bubble, if updates are available */
</ins><span class="cx" style="display: block; padding: 0 10px"> $menu[80] = array( sprintf( __( 'Settings %s' ), $change_notice ), 'manage_options', 'options-general.php', '', 'menu-top menu-icon-settings', 'menu-settings', 'dashicons-admin-settings' );
</span><span class="cx" style="display: block; padding: 0 10px"> $submenu['options-general.php'][10] = array( _x( 'General', 'settings screen' ), 'manage_options', 'options-general.php' );
</span><span class="cx" style="display: block; padding: 0 10px"> $submenu['options-general.php'][15] = array( __( 'Writing' ), 'manage_options', 'options-writing.php' );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -276,7 +286,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $submenu['options-general.php'][25] = array( __( 'Discussion' ), 'manage_options', 'options-discussion.php' );
</span><span class="cx" style="display: block; padding: 0 10px"> $submenu['options-general.php'][30] = array( __( 'Media' ), 'manage_options', 'options-media.php' );
</span><span class="cx" style="display: block; padding: 0 10px"> $submenu['options-general.php'][40] = array( __( 'Permalinks' ), 'manage_options', 'options-permalink.php' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // translators: %s is the update notification bubble, if updates are available.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /* translators: %s: update notification bubble, if updates are available */
</ins><span class="cx" style="display: block; padding: 0 10px"> $submenu['options-general.php'][45] = array( sprintf( __( 'Privacy %s' ), $change_notice ), 'manage_privacy_options', 'privacy.php' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $_wp_last_utility_menu = 80; // The index of the last top-level menu in the utility menu group
</span></span></pre></div>
<a id="trunksrcwpincludesadminbarphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/admin-bar.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/admin-bar.php 2019-03-17 13:10:44 UTC (rev 44923)
+++ trunk/src/wp-includes/admin-bar.php 2019-03-18 15:21:17 UTC (rev 44924)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -885,11 +885,15 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $awaiting_mod = wp_count_comments();
</span><span class="cx" style="display: block; padding: 0 10px"> $awaiting_mod = $awaiting_mod->moderated;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $awaiting_text = sprintf( _n( '%s comment awaiting moderation', '%s comments awaiting moderation', $awaiting_mod ), number_format_i18n( $awaiting_mod ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $awaiting_text = sprintf(
+ /* translators: %s: number of comments in moderation */
+ _n( '%s Comment in moderation', '%s Comments in moderation', $awaiting_mod ),
+ number_format_i18n( $awaiting_mod )
+ );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $icon = '<span class="ab-icon"></span>';
</span><span class="cx" style="display: block; padding: 0 10px"> $title = '<span class="ab-label awaiting-mod pending-count count-' . $awaiting_mod . '" aria-hidden="true">' . number_format_i18n( $awaiting_mod ) . '</span>';
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $title .= '<span class="screen-reader-text">' . $awaiting_text . '</span>';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $title .= '<span class="screen-reader-text comments-in-moderation-text">' . $awaiting_text . '</span>';
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $wp_admin_bar->add_menu(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span></span></pre>
</div>
</div>
</body>
</html>