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/media-template.php

    r55187 r55276  
    164164        sprintf(
    165165            '<span class="screen-reader-text"> %s</span>',
    166             /* translators: Accessibility text. */
     166            /* translators: Hidden accessibility text. */
    167167            __( '(opens in a new tab)' )
    168168        )
     
    185185        <h2 class="media-frame-actions-heading screen-reader-text">
    186186        <?php
    187             /* translators: Accessibility text. */
     187            /* translators: Hidden accessibility text. */
    188188            _e( 'Selected media actions' );
    189189        ?>
     
    197197        <div tabindex="0" class="<?php echo $class; ?>" role="dialog" aria-labelledby="media-frame-title">
    198198            <# if ( data.hasCloseButton ) { #>
    199                 <button type="button" class="media-modal-close"><span class="media-modal-icon"><span class="screen-reader-text"><?php _e( 'Close dialog' ); ?></span></span></button>
     199                <button type="button" class="media-modal-close"><span class="media-modal-icon"><span class="screen-reader-text">
     200                    <?php
     201                    /* translators: Hidden accessibility text. */
     202                    _e( 'Close dialog' );
     203                    ?>
     204                </span></span></button>
    200205            <# } #>
    201206            <div class="media-modal-content" role="document"></div>
     
    222227        <# var messageClass = data.message ? 'has-upload-message' : 'no-upload-message'; #>
    223228        <# if ( data.canClose ) { #>
    224         <button class="close dashicons dashicons-no"><span class="screen-reader-text"><?php _e( 'Close uploader' ); ?></span></button>
     229        <button class="close dashicons dashicons-no"><span class="screen-reader-text">
     230            <?php
     231            /* translators: Hidden accessibility text. */
     232            _e( 'Close uploader' );
     233            ?>
     234        </span></button>
    225235        <# } #>
    226236        <div class="uploader-inline-content {{ messageClass }}">
     
    311321    <script type="text/html" id="tmpl-media-library-view-switcher">
    312322        <a href="<?php echo esc_url( add_query_arg( 'mode', 'list', admin_url( 'upload.php' ) ) ); ?>" class="view-list">
    313             <span class="screen-reader-text"><?php _e( 'List view' ); ?></span>
     323            <span class="screen-reader-text">
     324                <?php
     325                /* translators: Hidden accessibility text. */
     326                _e( 'List view' );
     327                ?>
     328            </span>
    314329        </a>
    315330        <a href="<?php echo esc_url( add_query_arg( 'mode', 'grid', admin_url( 'upload.php' ) ) ); ?>" class="view-grid current" aria-current="page">
    316             <span class="screen-reader-text"><?php _e( 'Grid view' ); ?></span>
     331            <span class="screen-reader-text">
     332                <?php
     333                /* translators: Hidden accessibility text. */
     334                _e( 'Grid view' );
     335                ?>
     336            </span>
    317337        </a>
    318338    </script>
     
    343363    <script type="text/html" id="tmpl-edit-attachment-frame">
    344364        <div class="edit-media-header">
    345             <button class="left dashicons"<# if ( ! data.hasPrevious ) { #> disabled<# } #>><span class="screen-reader-text"><?php _e( 'Edit previous media item' ); ?></span></button>
    346             <button class="right dashicons"<# if ( ! data.hasNext ) { #> disabled<# } #>><span class="screen-reader-text"><?php _e( 'Edit next media item' ); ?></span></button>
     365            <button class="left dashicons"<# if ( ! data.hasPrevious ) { #> disabled<# } #>><span class="screen-reader-text"><?php /* translators: Hidden accessibility text. */ _e( 'Edit previous media item' ); ?></span></button>
     366            <button class="right dashicons"<# if ( ! data.hasNext ) { #> disabled<# } #>><span class="screen-reader-text"><?php /* translators: Hidden accessibility text. */ _e( 'Edit next media item' ); ?></span></button>
    347367            <button type="button" class="media-modal-close"><span class="media-modal-icon"><span class="screen-reader-text"><?php _e( 'Close dialog' ); ?></span></span></button>
    348368        </div>
     
    354374    <script type="text/html" id="tmpl-attachment-details-two-column">
    355375        <div class="attachment-media-view {{ data.orientation }}">
    356             <h2 class="screen-reader-text"><?php _e( 'Attachment Preview' ); ?></h2>
     376            <h2 class="screen-reader-text"><?php /* translators: Hidden accessibility text. */ _e( 'Attachment Preview' ); ?></h2>
    357377            <div class="thumbnail thumbnail-{{ data.type }}">
    358378                <# if ( data.uploading ) { #>
     
    405425            </span>
    406426            <div class="details">
    407                 <h2 class="screen-reader-text"><?php _e( 'Details' ); ?></h2>
     427                <h2 class="screen-reader-text">
     428                    <?php
     429                    /* translators: Hidden accessibility text. */
     430                    _e( 'Details' );
     431                    ?>
     432                </h2>
    408433                <div class="uploaded"><strong><?php _e( 'Uploaded on:' ); ?></strong> {{ data.dateFormatted }}</div>
    409434                <div class="uploaded-by">
     
    578603            </div>
    579604            <# if ( data.buttons.close ) { #>
    580                 <button type="button" class="button-link attachment-close media-modal-icon"><span class="screen-reader-text"><?php _e( 'Remove' ); ?></span></button>
     605                <button type="button" class="button-link attachment-close media-modal-icon"><span class="screen-reader-text">
     606                    <?php
     607                    /* translators: Hidden accessibility text. */
     608                    _e( 'Remove' );
     609                    ?>
     610                </span></button>
    581611            <# } #>
    582612        </div>
    583613        <# if ( data.buttons.check ) { #>
    584             <button type="button" class="check" tabindex="-1"><span class="media-modal-icon"></span><span class="screen-reader-text"><?php _e( 'Deselect' ); ?></span></button>
     614            <button type="button" class="check" tabindex="-1"><span class="media-modal-icon"></span><span class="screen-reader-text">
     615                <?php
     616                /* translators: Hidden accessibility text. */
     617                _e( 'Deselect' );
     618                ?>
     619            </span></button>
    585620        <# } #>
    586621        <#
Note: See TracChangeset for help on using the changeset viewer.