Make WordPress Core


Ignore:
Timestamp:
02/07/2023 05:08:26 PM (22 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/image-edit.php

    r55180 r55276  
    113113    <div class="imgedit-group-top">
    114114        <h2><?php _e( 'Scale Image' ); ?></h2>
    115         <button type="button" class="dashicons dashicons-editor-help imgedit-help-toggle" onclick="imageEdit.toggleHelp(this);" aria-expanded="false"><span class="screen-reader-text"><?php esc_html_e( 'Scale Image Help' ); ?></span></button>
     115        <button type="button" class="dashicons dashicons-editor-help imgedit-help-toggle" onclick="imageEdit.toggleHelp(this);" aria-expanded="false"><span class="screen-reader-text">
     116            <?php
     117            /* translators: Hidden accessibility text. */
     118            esc_html_e( 'Scale Image Help' );
     119            ?>
     120        </span></button>
    116121        <div class="imgedit-help">
    117122        <p><?php _e( 'You can proportionally scale the original image. For best results, scaling should be done before you crop, flip, or rotate. Images can only be scaled down, not up.' ); ?></p>
     
    133138        <legend><?php _e( 'New dimensions:' ); ?></legend>
    134139        <div class="nowrap">
    135         <label for="imgedit-scale-width-<?php echo $post_id; ?>" class="screen-reader-text"><?php _e( 'scale width' ); ?></label>
     140        <label for="imgedit-scale-width-<?php echo $post_id; ?>" class="screen-reader-text">
     141            <?php
     142            /* translators: Hidden accessibility text. */
     143            _e( 'scale width' );
     144            ?>
     145        </label>
    136146        <input type="text" id="imgedit-scale-width-<?php echo $post_id; ?>" onkeyup="imageEdit.scaleChanged(<?php echo $post_id; ?>, 1, this)" onblur="imageEdit.scaleChanged(<?php echo $post_id; ?>, 1, this)" value="<?php echo isset( $meta['width'] ) ? $meta['width'] : 0; ?>" />
    137147        <span class="imgedit-separator" aria-hidden="true">&times;</span>
    138         <label for="imgedit-scale-height-<?php echo $post_id; ?>" class="screen-reader-text"><?php _e( 'scale height' ); ?></label>
     148        <label for="imgedit-scale-height-<?php echo $post_id; ?>" class="screen-reader-text">
     149            <?php
     150            /* translators: Hidden accessibility text. */
     151            _e( 'scale height' );
     152            ?>
     153        </label>
    139154        <input type="text" id="imgedit-scale-height-<?php echo $post_id; ?>" onkeyup="imageEdit.scaleChanged(<?php echo $post_id; ?>, 0, this)" onblur="imageEdit.scaleChanged(<?php echo $post_id; ?>, 0, this)" value="<?php echo isset( $meta['height'] ) ? $meta['height'] : 0; ?>" />
    140155        <span class="imgedit-scale-warn" id="imgedit-scale-warn-<?php echo $post_id; ?>">!</span>
     
    174189    <div class="imgedit-group-top">
    175190        <h2><?php _e( 'Image Crop' ); ?></h2>
    176         <button type="button" class="dashicons dashicons-editor-help imgedit-help-toggle" onclick="imageEdit.toggleHelp(this);" aria-expanded="false"><span class="screen-reader-text"><?php esc_html_e( 'Image Crop Help' ); ?></span></button>
     191        <button type="button" class="dashicons dashicons-editor-help imgedit-help-toggle" onclick="imageEdit.toggleHelp(this);" aria-expanded="false"><span class="screen-reader-text">
     192            <?php
     193            /* translators: Hidden accessibility text. */
     194            esc_html_e( 'Image Crop Help' );
     195            ?>
     196        </span></button>
    177197
    178198        <div class="imgedit-help">
     
    190210        <legend><?php _e( 'Aspect ratio:' ); ?></legend>
    191211        <div class="nowrap">
    192         <label for="imgedit-crop-width-<?php echo $post_id; ?>" class="screen-reader-text"><?php _e( 'crop ratio width' ); ?></label>
     212        <label for="imgedit-crop-width-<?php echo $post_id; ?>" class="screen-reader-text">
     213            <?php
     214            /* translators: Hidden accessibility text. */
     215            _e( 'crop ratio width' );
     216            ?>
     217        </label>
    193218        <input type="text" id="imgedit-crop-width-<?php echo $post_id; ?>" onkeyup="imageEdit.setRatioSelection(<?php echo $post_id; ?>, 0, this)" onblur="imageEdit.setRatioSelection(<?php echo $post_id; ?>, 0, this)" />
    194219        <span class="imgedit-separator" aria-hidden="true">:</span>
    195         <label for="imgedit-crop-height-<?php echo $post_id; ?>" class="screen-reader-text"><?php _e( 'crop ratio height' ); ?></label>
     220        <label for="imgedit-crop-height-<?php echo $post_id; ?>" class="screen-reader-text">
     221            <?php
     222            /* translators: Hidden accessibility text. */
     223            _e( 'crop ratio height' );
     224            ?>
     225        </label>
    196226        <input type="text" id="imgedit-crop-height-<?php echo $post_id; ?>" onkeyup="imageEdit.setRatioSelection(<?php echo $post_id; ?>, 1, this)" onblur="imageEdit.setRatioSelection(<?php echo $post_id; ?>, 1, this)" />
    197227        </div>
     
    201231        <legend><?php _e( 'Selection:' ); ?></legend>
    202232        <div class="nowrap">
    203         <label for="imgedit-sel-width-<?php echo $post_id; ?>" class="screen-reader-text"><?php _e( 'selection width' ); ?></label>
     233        <label for="imgedit-sel-width-<?php echo $post_id; ?>" class="screen-reader-text">
     234            <?php
     235            /* translators: Hidden accessibility text. */
     236            _e( 'selection width' );
     237            ?>
     238        </label>
    204239        <input type="text" id="imgedit-sel-width-<?php echo $post_id; ?>" onkeyup="imageEdit.setNumSelection(<?php echo $post_id; ?>, this)" onblur="imageEdit.setNumSelection(<?php echo $post_id; ?>, this)" />
    205240        <span class="imgedit-separator" aria-hidden="true">&times;</span>
    206         <label for="imgedit-sel-height-<?php echo $post_id; ?>" class="screen-reader-text"><?php _e( 'selection height' ); ?></label>
     241        <label for="imgedit-sel-height-<?php echo $post_id; ?>" class="screen-reader-text">
     242            <?php
     243            /* translators: Hidden accessibility text. */
     244            _e( 'selection height' );
     245            ?>
     246        </label>
    207247        <input type="text" id="imgedit-sel-height-<?php echo $post_id; ?>" onkeyup="imageEdit.setNumSelection(<?php echo $post_id; ?>, this)" onblur="imageEdit.setNumSelection(<?php echo $post_id; ?>, this)" />
    208248        </div>
     
    219259    <div class="imgedit-group-top">
    220260        <h2><?php _e( 'Thumbnail Settings' ); ?></h2>
    221         <button type="button" class="dashicons dashicons-editor-help imgedit-help-toggle" onclick="imageEdit.toggleHelp(this);" aria-expanded="false"><span class="screen-reader-text"><?php esc_html_e( 'Thumbnail Settings Help' ); ?></span></button>
     261        <button type="button" class="dashicons dashicons-editor-help imgedit-help-toggle" onclick="imageEdit.toggleHelp(this);" aria-expanded="false"><span class="screen-reader-text">
     262            <?php
     263            /* translators: Hidden accessibility text. */
     264            esc_html_e( 'Thumbnail Settings Help' );
     265            ?>
     266        </span></button>
    222267        <div class="imgedit-help">
    223268        <p><?php _e( 'You can edit the image while preserving the thumbnail. For example, you may wish to have a square thumbnail that displays just a section of the image.' ); ?></p>
Note: See TracChangeset for help on using the changeset viewer.