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-admin/includes/class-custom-background.php

    r54133 r55276  
    414414<tr>
    415415<th scope="row"><?php _e( 'Image Position' ); ?></th>
    416 <td><fieldset><legend class="screen-reader-text"><span><?php _e( 'Image Position' ); ?></span></legend>
     416<td><fieldset><legend class="screen-reader-text"><span>
     417            <?php
     418            /* translators: Hidden accessibility text. */
     419            _e( 'Image Position' );
     420            ?>
     421</span></legend>
    417422<div class="background-position-control">
    418423            <?php foreach ( $background_position_options as $group ) : ?>
     
    433438<tr>
    434439<th scope="row"><label for="background-size"><?php _e( 'Image Size' ); ?></label></th>
    435 <td><fieldset><legend class="screen-reader-text"><span><?php _e( 'Image Size' ); ?></span></legend>
     440<td><fieldset><legend class="screen-reader-text"><span>
     441            <?php
     442            /* translators: Hidden accessibility text. */
     443            _e( 'Image Size' );
     444            ?>
     445</span></legend>
    436446<select id="background-size" name="background-size">
    437447<option value="auto"<?php selected( 'auto', get_theme_mod( 'background_size', get_theme_support( 'custom-background', 'default-size' ) ) ); ?>><?php _ex( 'Original', 'Original Size' ); ?></option>
     
    444454<tr>
    445455<th scope="row"><?php _ex( 'Repeat', 'Background Repeat' ); ?></th>
    446 <td><fieldset><legend class="screen-reader-text"><span><?php _ex( 'Repeat', 'Background Repeat' ); ?></span></legend>
     456<td><fieldset><legend class="screen-reader-text"><span>
     457            <?php
     458            /* translators: Hidden accessibility text. */
     459            _ex( 'Repeat', 'Background Repeat' );
     460            ?>
     461</span></legend>
    447462<input name="background-repeat" type="hidden" value="no-repeat">
    448463<label><input type="checkbox" name="background-repeat" value="repeat"<?php checked( 'repeat', get_theme_mod( 'background_repeat', get_theme_support( 'custom-background', 'default-repeat' ) ) ); ?>> <?php _e( 'Repeat Background Image' ); ?></label>
     
    452467<tr>
    453468<th scope="row"><?php _ex( 'Scroll', 'Background Scroll' ); ?></th>
    454 <td><fieldset><legend class="screen-reader-text"><span><?php _ex( 'Scroll', 'Background Scroll' ); ?></span></legend>
     469<td><fieldset><legend class="screen-reader-text"><span>
     470            <?php
     471            /* translators: Hidden accessibility text. */
     472            _ex( 'Scroll', 'Background Scroll' );
     473            ?>
     474</span></legend>
    455475<input name="background-attachment" type="hidden" value="fixed">
    456476<label><input name="background-attachment" type="checkbox" value="scroll" <?php checked( 'scroll', get_theme_mod( 'background_attachment', get_theme_support( 'custom-background', 'default-attachment' ) ) ); ?>> <?php _e( 'Scroll with Page' ); ?></label>
     
    460480<tr>
    461481<th scope="row"><?php _e( 'Background Color' ); ?></th>
    462 <td><fieldset><legend class="screen-reader-text"><span><?php _e( 'Background Color' ); ?></span></legend>
     482<td><fieldset><legend class="screen-reader-text"><span>
     483        <?php
     484        /* translators: Hidden accessibility text. */
     485        _e( 'Background Color' );
     486        ?>
     487</span></legend>
    463488        <?php
    464489        $default_color = '';
Note: See TracChangeset for help on using the changeset viewer.