Make WordPress Core


Ignore:
Timestamp:
02/07/2023 05:08:26 PM (18 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-admin/includes/misc.php

    r55161 r55276  
    415415                aria-setsize="<?php echo esc_attr( $size ); ?>"
    416416                aria-posinset="<?php echo esc_attr( $index ); ?>">
    417                 <span class="folder-label"><?php echo esc_html( $label ); ?> <span class="screen-reader-text"><?php _e( 'folder' ); ?></span><span aria-hidden="true" class="icon"></span></span>
     417                <span class="folder-label"><?php echo esc_html( $label ); ?> <span class="screen-reader-text">
     418                    <?php
     419                    /* translators: Hidden accessibility text. */
     420                    _e( 'folder' );
     421                    ?>
     422                </span><span aria-hidden="true" class="icon"></span></span>
    418423                <ul role="group" class="tree-folder"><?php wp_print_theme_file_tree( $theme_file, $level + 1, $index, $size ); ?></ul>
    419424            </li>
     
    512517                aria-setsize="<?php echo esc_attr( $size ); ?>"
    513518                aria-posinset="<?php echo esc_attr( $index ); ?>">
    514                 <span class="folder-label"><?php echo esc_html( $label ); ?> <span class="screen-reader-text"><?php _e( 'folder' ); ?></span><span aria-hidden="true" class="icon"></span></span>
     519                <span class="folder-label"><?php echo esc_html( $label ); ?> <span class="screen-reader-text">
     520                    <?php
     521                    /* translators: Hidden accessibility text. */
     522                    _e( 'folder' );
     523                    ?>
     524                </span><span aria-hidden="true" class="icon"></span></span>
    515525                <ul role="group" class="tree-folder"><?php wp_print_plugin_file_tree( $plugin_file, '', $level + 1, $index, $size ); ?></ul>
    516526            </li>
     
    10131023    ?>
    10141024    <fieldset id="color-picker" class="scheme-list">
    1015         <legend class="screen-reader-text"><span><?php _e( 'Admin Color Scheme' ); ?></span></legend>
     1025        <legend class="screen-reader-text"><span>
     1026            <?php
     1027            /* translators: Hidden accessibility text. */
     1028            _e( 'Admin Color Scheme' );
     1029            ?>
     1030        </span></legend>
    10161031        <?php
    10171032        wp_nonce_field( 'save-color-scheme', 'color-nonce', false );
Note: See TracChangeset for help on using the changeset viewer.