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.

git-svn-id: https://develop.svn.wordpress.org/trunk@45334 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Sergey Biryukov 2019-05-17 00:52:32 +00:00
parent e6dcab7803
commit 448234f966
2 changed files with 10 additions and 10 deletions

View File

@ -3020,15 +3020,15 @@ function edit_form_image_editor( $post ) {
<p class="attachment-alt-text-description" id="alt-text-description"> <p class="attachment-alt-text-description" id="alt-text-description">
<?php <?php
printf( printf(
/* translators: 1: link start tag, 2: accessibility text, 3: link end tag */ /* translators: 1: link to tutorial, 2: additional link attributes, 3: accessibility text */
__( '%1$sDescribe the purpose of the image%2$s%3$s. Leave empty if the image is purely decorative.' ), __( '<a href="%1$s" %2$s>Describe the purpose of the image%3$s</a>. Leave empty if the image is purely decorative.' ),
'<a href="' . esc_url( 'https://www.w3.org/WAI/tutorials/images/decision-tree' ) . '" target="_blank" rel="noopener noreferrer">', esc_url( 'https://www.w3.org/WAI/tutorials/images/decision-tree' ),
'target="_blank" rel="noopener noreferrer"',
sprintf( sprintf(
'<span class="screen-reader-text"> %s</span>', '<span class="screen-reader-text"> %s</span>',
/* translators: accessibility text */ /* translators: accessibility text */
__( '(opens in a new tab)' ) __( '(opens in a new tab)' )
), )
'</a>'
); );
?> ?>
</p> </p>

View File

@ -163,15 +163,15 @@ function wp_print_media_templates() {
} }
$alt_text_description = sprintf( $alt_text_description = sprintf(
/* translators: 1: link start tag, 2: accessibility text, 3: link end tag */ /* translators: 1: link to tutorial, 2: additional link attributes, 3: accessibility text */
__( '%1$sDescribe the purpose of the image%2$s%3$s. Leave empty if the image is purely decorative.' ), __( '<a href="%1$s" %2$s>Describe the purpose of the image%3$s</a>. Leave empty if the image is purely decorative.' ),
'<a href="' . esc_url( 'https://www.w3.org/WAI/tutorials/images/decision-tree' ) . '" target="_blank" rel="noopener noreferrer">', esc_url( 'https://www.w3.org/WAI/tutorials/images/decision-tree' ),
'target="_blank" rel="noopener noreferrer"',
sprintf( sprintf(
'<span class="screen-reader-text"> %s</span>', '<span class="screen-reader-text"> %s</span>',
/* translators: accessibility text */ /* translators: accessibility text */
__( '(opens in a new tab)' ) __( '(opens in a new tab)' )
), )
'</a>'
); );
?> ?>
<!--[if lte IE 8]> <!--[if lte IE 8]>