Make WordPress Core


Ignore:
Timestamp:
03/18/2019 03:21:17 PM (6 years ago)
Author:
afercia
Message:

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 #33030.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/admin-bar.php

    r44608 r44924  
    886886    $awaiting_mod  = wp_count_comments();
    887887    $awaiting_mod  = $awaiting_mod->moderated;
    888     $awaiting_text = sprintf( _n( '%s comment awaiting moderation', '%s comments awaiting moderation', $awaiting_mod ), number_format_i18n( $awaiting_mod ) );
     888    $awaiting_text = sprintf(
     889        /* translators: %s: number of comments in moderation */
     890        _n( '%s Comment in moderation', '%s Comments in moderation', $awaiting_mod ),
     891        number_format_i18n( $awaiting_mod )
     892    );
    889893
    890894    $icon   = '<span class="ab-icon"></span>';
    891895    $title  = '<span class="ab-label awaiting-mod pending-count count-' . $awaiting_mod . '" aria-hidden="true">' . number_format_i18n( $awaiting_mod ) . '</span>';
    892     $title .= '<span class="screen-reader-text">' . $awaiting_text . '</span>';
     896    $title .= '<span class="screen-reader-text comments-in-moderation-text">' . $awaiting_text . '</span>';
    893897
    894898    $wp_admin_bar->add_menu(
Note: See TracChangeset for help on using the changeset viewer.