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

    r57793 r60805  
    6868<table class="form-table" role="presentation">
    6969<?php if ( get_site_option( 'initial_db_version' ) < 32453 ) : ?>
    70 <tr>
    71 <th scope="row"><?php _e( 'Formatting' ); ?></th>
    72 <td><fieldset><legend class="screen-reader-text"><span>
    73     <?php
    74     /* translators: Hidden accessibility text. */
    75     _e( 'Formatting' );
    76     ?>
    77 </span></legend>
     70    <?php $formatting_title = __( 'Formatting' ); ?>
     71<tr>
     72<th scope="row"><?php echo $formatting_title; ?></th>
     73<td><fieldset><legend class="screen-reader-text"><span><?php echo $formatting_title; ?></span></legend>
    7874<label for="use_smilies">
    7975<input name="use_smilies" type="checkbox" id="use_smilies" value="1" <?php checked( '1', get_option( 'use_smilies' ) ); ?> />
Note: See TracChangeset for help on using the changeset viewer.