Twenty Fifteen: Add missing singular placeholder in `comments.php`.

Uses the recommended pattern for better compatibility with languages that use the singular form for other numbers. Also adds translator comments.

Props bplv, xkon.
See #39660.

git-svn-id: https://develop.svn.wordpress.org/trunk@41761 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Sergey Biryukov 2017-10-05 00:40:20 +00:00
parent 8cda3a2f55
commit 8ae64e992b
1 changed files with 18 additions and 2 deletions

View File

@ -25,8 +25,24 @@ if ( post_password_required() ) {
<?php if ( have_comments() ) : ?>
<h2 class="comments-title">
<?php
printf( _nx( 'One thought on &ldquo;%2$s&rdquo;', '%1$s thoughts on &ldquo;%2$s&rdquo;', get_comments_number(), 'comments title', 'twentyfifteen' ),
number_format_i18n( get_comments_number() ), get_the_title() );
$comments_number = get_comments_number();
if ( '1' === $comments_number ) {
/* translators: %s: post title */
printf( _x( 'One thought on &ldquo;%s&rdquo;', 'comments title', 'twentyfifteen' ), get_the_title() );
} else {
printf(
/* translators: 1: number of comments, 2: post title */
_nx(
'%1$s thought on &ldquo;%2$s&rdquo;',
'%1$s thoughts on &ldquo;%2$s&rdquo;',
$comments_number,
'comments title',
'twentyfifteen'
),
number_format_i18n( $comments_number ),
get_the_title()
);
}
?>
</h2>