Make WordPress Core

Changeset 41762


Ignore:
Timestamp:
10/05/2017 12:41:23 AM (7 years ago)
Author:
SergeyBiryukov
Message:

Twenty Fourteen: 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/twentyfourteen/comments.php

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