Make WordPress Core


Ignore:
Timestamp:
02/07/2023 05:08:26 PM (17 months 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-content/themes/twentyseventeen/searchform.php

    r46827 r55276  
    1515<form role="search" method="get" class="search-form" action="<?php echo esc_url( home_url( '/' ) ); ?>">
    1616    <label for="<?php echo $unique_id; ?>">
    17         <span class="screen-reader-text"><?php echo _x( 'Search for:', 'label', 'twentyseventeen' ); ?></span>
     17        <span class="screen-reader-text">
     18            <?php
     19            /* translators: Hidden accessibility text. */
     20            echo _x( 'Search for:', 'label', 'twentyseventeen' );
     21            ?>
     22        </span>
    1823    </label>
    1924    <input type="search" id="<?php echo $unique_id; ?>" class="search-field" placeholder="<?php echo esc_attr_x( 'Search &hellip;', 'placeholder', 'twentyseventeen' ); ?>" value="<?php echo get_search_query(); ?>" name="s" />
    20     <button type="submit" class="search-submit"><?php echo twentyseventeen_get_svg( array( 'icon' => 'search' ) ); ?><span class="screen-reader-text"><?php echo _x( 'Search', 'submit button', 'twentyseventeen' ); ?></span></button>
     25    <button type="submit" class="search-submit"><?php echo twentyseventeen_get_svg( array( 'icon' => 'search' ) ); ?><span class="screen-reader-text">
     26        <?php
     27        /* translators: Hidden accessibility text. */
     28        echo _x( 'Search', 'submit button', 'twentyseventeen' );
     29        ?>
     30    </span></button>
    2131</form>
Note: See TracChangeset for help on using the changeset viewer.