From 448234f96601cf8cca3f59ae7682afb8c58c4bc1 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Fri, 17 May 2019 00:52:32 +0000 Subject: [PATCH] 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 --- src/wp-admin/includes/media.php | 10 +++++----- src/wp-includes/media-template.php | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/wp-admin/includes/media.php b/src/wp-admin/includes/media.php index e30cc08b1b..5c54b21402 100644 --- a/src/wp-admin/includes/media.php +++ b/src/wp-admin/includes/media.php @@ -3020,15 +3020,15 @@ function edit_form_image_editor( $post ) {

', + /* translators: 1: link to tutorial, 2: additional link attributes, 3: accessibility text */ + __( 'Describe the purpose of the image%3$s. 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( ' %s', /* translators: accessibility text */ __( '(opens in a new tab)' ) - ), - '' + ) ); ?>

diff --git a/src/wp-includes/media-template.php b/src/wp-includes/media-template.php index 1711f50ab4..d730cac7d7 100644 --- a/src/wp-includes/media-template.php +++ b/src/wp-includes/media-template.php @@ -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.' ), - '', + /* translators: 1: link to tutorial, 2: additional link attributes, 3: accessibility text */ + __( 'Describe the purpose of the image%3$s. 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( ' %s', /* translators: accessibility text */ __( '(opens in a new tab)' ) - ), - '' + ) ); ?>