Make WordPress Core

Changeset 41761


Ignore:
Timestamp:
10/05/2017 12:40:20 AM (6 years ago)
Author:
SergeyBiryukov
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-content/themes/twentyfifteen/comments.php

    r30896 r41761  
    2626        <h2 class="comments-title">
    2727            <?php
    28                 printf( _nx( 'One thought on &ldquo;%2$s&rdquo;', '%1$s thoughts on &ldquo;%2$s&rdquo;', get_comments_number(), 'comments title', 'twentyfifteen' ),
    29                     number_format_i18n( get_comments_number() ), get_the_title() );
     28                $comments_number = get_comments_number();
     29                if ( '1' === $comments_number ) {
     30                    /* translators: %s: post title */
     31                    printf( _x( 'One thought on &ldquo;%s&rdquo;', 'comments title', 'twentyfifteen' ), get_the_title() );
     32                } else {
     33                    printf(
     34                        /* translators: 1: number of comments, 2: post title */
     35                        _nx(
     36                            '%1$s thought on &ldquo;%2$s&rdquo;',
     37                            '%1$s thoughts on &ldquo;%2$s&rdquo;',
     38                            $comments_number,
     39                            'comments title',
     40                            'twentyfifteen'
     41                        ),
     42                        number_format_i18n( $comments_number ),
     43                        get_the_title()
     44                    );
     45                }
    3046            ?>
    3147        </h2>
Note: See TracChangeset for help on using the changeset viewer.