Make WordPress Core


Ignore:
Timestamp:
05/17/2019 12:55:22 AM (6 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.
Merges [45334] to the 5.2 branch.
Fixes #47159.

Location:
branches/5.2
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/5.2

  • branches/5.2/src/wp-includes/media-template.php

    r45153 r45335  
    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.