Make WordPress Core


Ignore:
Timestamp:
09/28/2025 10:36:30 PM (2 months ago)
Author:
joedolson
Message:

I18n: Combine duplicate text strings into variables.

In cases where a string is used both for a visible label and a screen reader text label, the screen reader text should never be different from the visible label. To help ensure this doesn't happen, use only a single string. The associated screen reader text comments are no longer required.

This is also true for a few cases where there are strings in contexts where variables can't be used. In these cases, the screen reader text comments are also removed.

Props sabernhardt, swissspidy, audrasjb, joedolson.
Fixes #63620.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/network/site-info.php

    r60358 r60805  
    197197        </tr>
    198198        <?php
     199        $site_attributes_title = __( 'Attributes' );
     200
    199201        $attribute_fields = array( 'public' => _x( 'Public', 'site' ) );
    200202        if ( ! $is_main_site ) {
     
    206208        ?>
    207209        <tr>
    208             <th scope="row"><?php _e( 'Attributes' ); ?></th>
     210            <th scope="row"><?php echo $site_attributes_title; ?></th>
    209211            <td>
    210212            <fieldset>
    211             <legend class="screen-reader-text">
    212                 <?php
    213                 /* translators: Hidden accessibility text. */
    214                 _e( 'Set site attributes' );
    215                 ?>
    216             </legend>
     213            <legend class="screen-reader-text"><?php echo $site_attributes_title; ?></legend>
    217214            <?php foreach ( $attribute_fields as $field_key => $field_label ) : ?>
    218215                <label><input type="checkbox" name="blog[<?php echo $field_key; ?>]" value="1" <?php checked( (bool) $details->$field_key, true ); ?> <?php disabled( ! in_array( (int) $details->$field_key, array( 0, 1 ), true ) ); ?> />
Note: See TracChangeset for help on using the changeset viewer.