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-admin/options-general.php

    r54689 r55276  
    149149<tr>
    150150<th scope="row"><?php _e( 'Membership' ); ?></th>
    151 <td> <fieldset><legend class="screen-reader-text"><span><?php _e( 'Membership' ); ?></span></legend><label for="users_can_register">
     151<td> <fieldset><legend class="screen-reader-text"><span>
     152    <?php
     153    /* translators: Hidden accessibility text. */
     154    _e( 'Membership' );
     155    ?>
     156</span></legend><label for="users_can_register">
    152157<input name="users_can_register" type="checkbox" id="users_can_register" value="1" <?php checked( '1', get_option( 'users_can_register' ) ); ?> />
    153158    <?php _e( 'Anyone can register' ); ?></label>
     
    315320<th scope="row"><?php _e( 'Date Format' ); ?></th>
    316321<td>
    317     <fieldset><legend class="screen-reader-text"><span><?php _e( 'Date Format' ); ?></span></legend>
     322    <fieldset><legend class="screen-reader-text"><span>
     323        <?php
     324        /* translators: Hidden accessibility text. */
     325        _e( 'Date Format' );
     326        ?>
     327    </span></legend>
    318328<?php
    319329    /**
     
    340350    echo '<label><input type="radio" name="date_format" id="date_format_custom_radio" value="\c\u\s\t\o\m"';
    341351    checked( $custom );
    342     echo '/> <span class="date-time-text date-time-custom-text">' . __( 'Custom:' ) . '<span class="screen-reader-text"> ' . __( 'enter a custom date format in the following field' ) . '</span></span></label>' .
    343         '<label for="date_format_custom" class="screen-reader-text">' . __( 'Custom date format:' ) . '</label>' .
     352    echo '/> <span class="date-time-text date-time-custom-text">' . __( 'Custom:' ) . '<span class="screen-reader-text"> ' .
     353            /* translators: Hidden accessibility text. */
     354            __( 'enter a custom date format in the following field' ) .
     355        '</span></span></label>' .
     356        '<label for="date_format_custom" class="screen-reader-text">' .
     357            /* translators: Hidden accessibility text. */
     358            __( 'Custom date format:' ) .
     359        '</label>' .
    344360        '<input type="text" name="date_format_custom" id="date_format_custom" value="' . esc_attr( get_option( 'date_format' ) ) . '" class="small-text" />' .
    345361        '<br />' .
     
    353369<th scope="row"><?php _e( 'Time Format' ); ?></th>
    354370<td>
    355     <fieldset><legend class="screen-reader-text"><span><?php _e( 'Time Format' ); ?></span></legend>
     371    <fieldset><legend class="screen-reader-text"><span>
     372        <?php
     373        /* translators: Hidden accessibility text. */
     374        _e( 'Time Format' );
     375        ?>
     376    </span></legend>
    356377<?php
    357378    /**
     
    377398    echo '<label><input type="radio" name="time_format" id="time_format_custom_radio" value="\c\u\s\t\o\m"';
    378399    checked( $custom );
    379     echo '/> <span class="date-time-text date-time-custom-text">' . __( 'Custom:' ) . '<span class="screen-reader-text"> ' . __( 'enter a custom time format in the following field' ) . '</span></span></label>' .
    380         '<label for="time_format_custom" class="screen-reader-text">' . __( 'Custom time format:' ) . '</label>' .
     400    echo '/> <span class="date-time-text date-time-custom-text">' . __( 'Custom:' ) . '<span class="screen-reader-text"> ' .
     401            /* translators: Hidden accessibility text. */
     402            __( 'enter a custom time format in the following field' ) .
     403        '</span></span></label>' .
     404        '<label for="time_format_custom" class="screen-reader-text">' .
     405            /* translators: Hidden accessibility text. */
     406            __( 'Custom time format:' ) .
     407        '</label>' .
    381408        '<input type="text" name="time_format_custom" id="time_format_custom" value="' . esc_attr( get_option( 'time_format' ) ) . '" class="small-text" />' .
    382409        '<br />' .
Note: See TracChangeset for help on using the changeset viewer.