Skip to content
Permalink
Browse files

I18N: Avoid using placeholders for link start and end tags in alt tex…

…t 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.

git-svn-id: https://develop.svn.wordpress.org/branches/5.2@45335 602fd350-edb4-49c9-b593-d223f7449a82
  • Loading branch information...
SergeyBiryukov committed May 17, 2019
1 parent 9369170 commit 8a27fb9c47ff75292d4c8f004bc87f1da538da66
Showing with 10 additions and 10 deletions.
  1. +5 −5 src/wp-admin/includes/media.php
  2. +5 −5 src/wp-includes/media-template.php
@@ -3020,15 +3020,15 @@ function edit_form_image_editor( $post ) {
<p class="attachment-alt-text-description" id="alt-text-description">
<?php
printf(
/* translators: 1: link start tag, 2: accessibility text, 3: link end tag */
__( '%1$sDescribe the purpose of the image%2$s%3$s. 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">',
/* translators: 1: link to tutorial, 2: additional link attributes, 3: accessibility text */
__( '<a href="%1$s" %2$s>Describe the purpose of the image%3$s</a>. Leave empty if the image is purely decorative.' ),
esc_url( 'https://www.w3.org/WAI/tutorials/images/decision-tree' ),
'target="_blank" rel="noopener noreferrer"',
sprintf(
'<span class="screen-reader-text"> %s</span>',
/* translators: accessibility text */
__( '(opens in a new tab)' )
),
'</a>'
)
);
?>
</p>
@@ -163,15 +163,15 @@ function wp_print_media_templates() {
}
$alt_text_description = sprintf(
/* translators: 1: link start tag, 2: accessibility text, 3: link end tag */
__( '%1$sDescribe the purpose of the image%2$s%3$s. 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">',
/* translators: 1: link to tutorial, 2: additional link attributes, 3: accessibility text */
__( '<a href="%1$s" %2$s>Describe the purpose of the image%3$s</a>. Leave empty if the image is purely decorative.' ),
esc_url( 'https://www.w3.org/WAI/tutorials/images/decision-tree' ),
'target="_blank" rel="noopener noreferrer"',
sprintf(
'<span class="screen-reader-text"> %s</span>',
/* translators: accessibility text */
__( '(opens in a new tab)' )
),
'</a>'
)
);
?>
<!--[if lte IE 8]>

0 comments on commit 8a27fb9

Please sign in to comment.
You can’t perform that action at this time.