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-content/themes/twentyfifteen/inc/template-tags.php

    r53308 r55276  
    2121            ?>
    2222        <nav class="navigation comment-navigation">
    23         <h2 class="screen-reader-text"><?php _e( 'Comment navigation', 'twentyfifteen' ); ?></h2>
     23        <h2 class="screen-reader-text">
     24            <?php
     25            /* translators: Hidden accessibility text. */
     26            _e( 'Comment navigation', 'twentyfifteen' );
     27            ?>
     28        </h2>
    2429        <div class="nav-links">
    2530            <?php
     
    5661            printf(
    5762                '<span class="entry-format">%1$s<a href="%2$s">%3$s</a></span>',
    58                 sprintf( '<span class="screen-reader-text">%s </span>', _x( 'Format', 'Used before post format.', 'twentyfifteen' ) ),
     63                sprintf(
     64                    '<span class="screen-reader-text">%s </span>',
     65                    /* translators: Hidden accessibility text. */
     66                    _x( 'Format', 'Used before post format.', 'twentyfifteen' )
     67                ),
    5968                esc_url( get_post_format_link( $format ) ),
    6069                get_post_format_string( $format )
     
    7988            printf(
    8089                '<span class="posted-on"><span class="screen-reader-text">%1$s </span><a href="%2$s" rel="bookmark">%3$s</a></span>',
     90                /* translators: Hidden accessibility text. */
    8191                _x( 'Posted on', 'Used before publish date.', 'twentyfifteen' ),
    8292                esc_url( get_permalink() ),
     
    8999                printf(
    90100                    '<span class="byline"><span class="author vcard"><span class="screen-reader-text">%1$s </span><a class="url fn n" href="%2$s">%3$s</a></span></span>',
     101                    /* translators: Hidden accessibility text. */
    91102                    _x( 'Author', 'Used before post author name.', 'twentyfifteen' ),
    92103                    esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ),
     
    99110                printf(
    100111                    '<span class="cat-links"><span class="screen-reader-text">%1$s </span>%2$s</span>',
     112                    /* translators: Hidden accessibility text. */
    101113                    _x( 'Categories', 'Used before category names.', 'twentyfifteen' ),
    102114                    $categories_list
     
    108120                printf(
    109121                    '<span class="tags-links"><span class="screen-reader-text">%1$s </span>%2$s</span>',
     122                    /* translators: Hidden accessibility text. */
    110123                    _x( 'Tags', 'Used before tag names.', 'twentyfifteen' ),
    111124                    $tags_list
     
    120133            printf(
    121134                '<span class="full-size-link"><span class="screen-reader-text">%1$s </span><a href="%2$s">%3$s &times; %4$s</a></span>',
     135                /* translators: Hidden accessibility text. */
    122136                _x( 'Full size', 'Used before full size attachment link.', 'twentyfifteen' ),
    123137                esc_url( wp_get_attachment_url() ),
Note: See TracChangeset for help on using the changeset viewer.