Make WordPress Core


Ignore:
Timestamp:
02/07/2023 05:08:26 PM (20 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/twentysixteen/inc/template-tags.php

    r53308 r55276  
    2424                '<span class="byline"><span class="author vcard">%1$s<span class="screen-reader-text">%2$s </span> <a class="url fn n" href="%3$s">%4$s</a></span></span>',
    2525                get_avatar( get_the_author_meta( 'user_email' ), $author_avatar_size ),
     26                /* translators: Hidden accessibility text. */
    2627                _x( 'Author', 'Used before post author name.', 'twentysixteen' ),
    2728                esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ),
     
    3839            printf(
    3940                '<span class="entry-format">%1$s<a href="%2$s">%3$s</a></span>',
    40                 sprintf( '<span class="screen-reader-text">%s </span>', _x( 'Format', 'Used before post format.', 'twentysixteen' ) ),
     41                sprintf(
     42                    '<span class="screen-reader-text">%s </span>',
     43                    /* translators: Hidden accessibility text. */
     44                    _x( 'Format', 'Used before post format.', 'twentysixteen' )
     45                ),
    4146                esc_url( get_post_format_link( $format ) ),
    4247                get_post_format_string( $format )
     
    8287        printf(
    8388            '<span class="posted-on"><span class="screen-reader-text">%1$s </span><a href="%2$s" rel="bookmark">%3$s</a></span>',
     89            /* translators: Hidden accessibility text. */
    8490            _x( 'Posted on', 'Used before publish date.', 'twentysixteen' ),
    8591            esc_url( get_permalink() ),
     
    102108            printf(
    103109                '<span class="cat-links"><span class="screen-reader-text">%1$s </span>%2$s</span>',
     110                /* translators: Hidden accessibility text. */
    104111                _x( 'Categories', 'Used before category names.', 'twentysixteen' ),
    105112                $categories_list
     
    111118            printf(
    112119                '<span class="tags-links"><span class="screen-reader-text">%1$s </span>%2$s</span>',
     120                /* translators: Hidden accessibility text. */
    113121                _x( 'Tags', 'Used before tag names.', 'twentysixteen' ),
    114122                $tags_list
Note: See TracChangeset for help on using the changeset viewer.