Make WordPress Core


Ignore:
Timestamp:
02/07/2023 05:08:26 PM (2 years ago)
Author:
SergeyBiryukov
Message:

I18N: Mark screen reader strings as such with translator comments.

This aims to provide better context for translators and make it easier to determine that some strings contain hidden accessibility text and are not displayed in the UI.

Props kebbet, mercime, pavelevap, ocean90, swissspidy, Chouby, jipmoors, afercia, desrosj, costdev, audrasjb, SergeyBiryukov.
Fixes #29748.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/customize/class-wp-customize-themes-section.php

    r49539 r55276  
    125125        <# if ( 'wporg' === data.action ) { #>
    126126            <div class="search-form">
    127                 <label for="wp-filter-search-input-{{ data.id }}" class="screen-reader-text"><?php _e( 'Search themes&hellip;' ); ?></label>
     127                <label for="wp-filter-search-input-{{ data.id }}" class="screen-reader-text">
     128                    <?php
     129                    /* translators: Hidden accessibility text. */
     130                    _e( 'Search themes&hellip;' );
     131                    ?>
     132                </label>
    128133                <input type="search" id="wp-filter-search-input-{{ data.id }}" placeholder="<?php esc_attr_e( 'Search themes&hellip;' ); ?>" aria-describedby="{{ data.id }}-live-search-desc" class="wp-filter-search">
    129134                <div class="search-icon" aria-hidden="true"></div>
    130                 <span id="{{ data.id }}-live-search-desc" class="screen-reader-text"><?php _e( 'The search results will be updated as you type.' ); ?></span>
     135                <span id="{{ data.id }}-live-search-desc" class="screen-reader-text">
     136                    <?php
     137                    /* translators: Hidden accessibility text. */
     138                    _e( 'The search results will be updated as you type.' );
     139                    ?>
     140                </span>
    131141            </div>
    132142            <button type="button" class="button feature-filter-toggle">
    133143                <span class="filter-count-0"><?php _e( 'Filter themes' ); ?></span><span class="filter-count-filters">
    134                 <?php
    135                 /* translators: %s: Number of filters selected. */
    136                 printf( __( 'Filter themes (%s)' ), '<span class="theme-filter-count">0</span>' );
    137                 ?>
     144                    <?php
     145                    /* translators: %s: Number of filters selected. */
     146                    printf( __( 'Filter themes (%s)' ), '<span class="theme-filter-count">0</span>' );
     147                    ?>
    138148                </span>
    139149            </button>
    140150        <# } else { #>
    141151            <div class="themes-filter-container">
    142                 <label for="{{ data.id }}-themes-filter" class="screen-reader-text"><?php _e( 'Search themes&hellip;' ); ?></label>
     152                <label for="{{ data.id }}-themes-filter" class="screen-reader-text">
     153                    <?php
     154                    /* translators: Hidden accessibility text. */
     155                    _e( 'Search themes&hellip;' );
     156                    ?>
     157                </label>
    143158                <input type="search" id="{{ data.id }}-themes-filter" placeholder="<?php esc_attr_e( 'Search themes&hellip;' ); ?>" aria-describedby="{{ data.id }}-live-search-desc" class="wp-filter-search wp-filter-search-themes" />
    144159                <div class="search-icon" aria-hidden="true"></div>
    145                 <span id="{{ data.id }}-live-search-desc" class="screen-reader-text"><?php _e( 'The search results will be updated as you type.' ); ?></span>
     160                <span id="{{ data.id }}-live-search-desc" class="screen-reader-text">
     161                    <?php
     162                    /* translators: Hidden accessibility text. */
     163                    _e( 'The search results will be updated as you type.' );
     164                    ?>
     165                </span>
    146166            </div>
    147167        <# } #>
Note: See TracChangeset for help on using the changeset viewer.