Make WordPress Core

Changeset 45334


Ignore:
Timestamp:
05/17/2019 12:52:32 AM (5 years ago)
Author:
SergeyBiryukov
Message:

I18N: Avoid using placeholders for link start and end tags in alt text description strings added in [45158].

Use an established pattern of moving additional link attributes out of the translatable string.

Props dimadin.
Fixes #47159.

Location:
trunk/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/media.php

    r45158 r45334  
    30213021            <?php
    30223022            printf(
    3023                 /* translators: 1: link start tag, 2: accessibility text, 3: link end tag */
    3024                 __( '%1$sDescribe the purpose of the image%2$s%3$s. Leave empty if the image is purely decorative.' ),
    3025                 '<a href="' . esc_url( 'https://www.w3.org/WAI/tutorials/images/decision-tree' ) . '" target="_blank" rel="noopener noreferrer">',
     3023                /* translators: 1: link to tutorial, 2: additional link attributes, 3: accessibility text */
     3024                __( '<a href="%1$s" %2$s>Describe the purpose of the image%3$s</a>. Leave empty if the image is purely decorative.' ),
     3025                esc_url( 'https://www.w3.org/WAI/tutorials/images/decision-tree' ),
     3026                'target="_blank" rel="noopener noreferrer"',
    30263027                sprintf(
    30273028                    '<span class="screen-reader-text"> %s</span>',
    30283029                    /* translators: accessibility text */
    30293030                    __( '(opens in a new tab)' )
    3030                 ),
    3031                 '</a>'
     3031                )
    30323032            );
    30333033            ?>
  • trunk/src/wp-includes/media-template.php

    r45153 r45334  
    164164
    165165    $alt_text_description = sprintf(
    166         /* translators: 1: link start tag, 2: accessibility text, 3: link end tag */
    167         __( '%1$sDescribe the purpose of the image%2$s%3$s. Leave empty if the image is purely decorative.' ),
    168         '<a href="' . esc_url( 'https://www.w3.org/WAI/tutorials/images/decision-tree' ) . '" target="_blank" rel="noopener noreferrer">',
     166        /* translators: 1: link to tutorial, 2: additional link attributes, 3: accessibility text */
     167        __( '<a href="%1$s" %2$s>Describe the purpose of the image%3$s</a>. Leave empty if the image is purely decorative.' ),
     168        esc_url( 'https://www.w3.org/WAI/tutorials/images/decision-tree' ),
     169        'target="_blank" rel="noopener noreferrer"',
    169170        sprintf(
    170171            '<span class="screen-reader-text"> %s</span>',
    171172            /* translators: accessibility text */
    172173            __( '(opens in a new tab)' )
    173         ),
    174         '</a>'
     174        )
    175175    );
    176176    ?>
Note: See TracChangeset for help on using the changeset viewer.