From 7de1a2e1437154f5115fbc5ef4ce231bbc0a3048 Mon Sep 17 00:00:00 2001 From: Dominik Schilling Date: Wed, 18 Mar 2015 21:52:27 +0000 Subject: [PATCH] Comments: Move HTML tags for screen reader text into translatable strings. Placeholders aren't helpful and it's much easier to make a mistake if you're dealing with placeholders. Introduced in [31388]. props pento. fixes #26553. Built from https://develop.svn.wordpress.org/trunk@31821 git-svn-id: http://core.svn.wordpress.org/trunk@31803 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/comment-template.php | 25 ++++++++++++------------- wp-includes/version.php | 2 +- 2 files changed, 13 insertions(+), 14 deletions(-) diff --git a/wp-includes/comment-template.php b/wp-includes/comment-template.php index 7028d5c65c..f10d56ee59 100644 --- a/wp-includes/comment-template.php +++ b/wp-includes/comment-template.php @@ -1280,29 +1280,28 @@ function comments_popup_link( $zero = false, $one = false, $more = false, $css_c global $wpcommentspopupfile, $wpcommentsjavascript; $id = get_the_ID(); - $span = ''; $title = get_the_title(); - $span_close = ''; - $number = get_comments_number( $id ); if ( false === $zero ) { - /* translators: 1: Opening span tag with a class, 2: post title, 3: closing span tag */ - $zero = sprintf( __( 'No Comments%1$s on %2$s%3$s' ), $span, $title, $span_close ); + /* translators: %s: post title */ + $zero = sprintf( __( 'No Comments on %s' ), $title ); } + if ( false === $one ) { - /* translators: 1: Opening span tag with a class, 2: post title, 3: closing span tag */ - $one = sprintf( __( '1 Comment%1$s on %2$s%3$s' ), $span, $title, $span_close ); + /* translators: %s: post title */ + $one = sprintf( __( '1 Comment on %s' ), $title ); } + if ( false === $more ) { - /* translators: 1: Opening span tag with a class, 2: post title, 3: closing span tag, 4: number of comments */ - $more = sprintf( _n( '%4$s Comment%1$s on %2$s%3$s', '%4$s Comments%1$s on %2$s%3$s', $number ), - $span, $title, $span_close, number_format_i18n( $number ) - ); + /* translators: 1: Number of comments 2: post title */ + $more = _n( '%1$s Comment on %2$s', '%1$s Comments on %2$s', $number ); + $more = sprintf( $more, number_format_i18n( $number ), $title ); } + if ( false === $none ) { - /* translators: 1: Opening span tag with a class, 2: post title, 3: closing span tag */ - $none = sprintf( __( 'Comments Off%1$s on %2$s%3$s' ), $span, $title, $span_close ); + /* translators: %s: post title */ + $none = sprintf( __( 'Comments Off on %s' ), $title ); } if ( 0 == $number && !comments_open() && !pings_open() ) { diff --git a/wp-includes/version.php b/wp-includes/version.php index 9c571d3cc5..82758cbc4d 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.2-beta1-31820'; +$wp_version = '4.2-beta1-31821'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.