Make WordPress Core


Ignore:
Timestamp:
09/28/2025 10:36:30 PM (3 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/install.php

    r60363 r60805  
    181181            <p id="admin-email-desc"><?php _e( 'Double-check your email address before continuing.' ); ?></p></td>
    182182        </tr>
     183        <?php $blog_privacy_selector_title = has_action( 'blog_privacy_selector' ) ? __( 'Site visibility' ) : __( 'Search engine visibility' ); ?>
    183184        <tr>
    184             <th scope="row"><?php has_action( 'blog_privacy_selector' ) ? _e( 'Site visibility' ) : _e( 'Search engine visibility' ); ?></th>
     185            <th scope="row"><?php echo $blog_privacy_selector_title; ?></th>
    185186            <td>
    186187                <fieldset>
    187                     <legend class="screen-reader-text"><span>
    188                         <?php
    189                         has_action( 'blog_privacy_selector' )
    190                             /* translators: Hidden accessibility text. */
    191                             ? _e( 'Site visibility' )
    192                             /* translators: Hidden accessibility text. */
    193                             : _e( 'Search engine visibility' );
    194                         ?>
    195                     </span></legend>
     188                    <legend class="screen-reader-text"><span><?php echo $blog_privacy_selector_title; ?></span></legend>
    196189                    <?php
    197190                    if ( has_action( 'blog_privacy_selector' ) ) {
Note: See TracChangeset for help on using the changeset viewer.