Making WordPress.org

Changeset 5844


Ignore:
Timestamp:
08/29/2017 04:29:15 PM (7 years ago)
Author:
coffee2code
Message:

WordPress.tv: 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 afzalmultani, SergeyBiryukov.
Fixes #3077.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.tv/public_html/wp-content/themes/wptv2/comments.php

    r1024 r5844  
    2020    <h3 id="comments">
    2121        <?php
    22             printf( _nx( 'One response on &ldquo;%2$s&rdquo;', '%1$s responses on &ldquo;%2$s&rdquo;', get_comments_number(), 'comments title', 'wptv' ),
    23                 number_format_i18n( get_comments_number() ), '<span>' . get_the_title() . '</span>' );
     22            $comments_number = get_comments_number();
     23            if ( 1 == $comments_number ) {
     24                /* translators: %s: post title */
     25                printf( _x( 'One response on &ldquo;%2$s&rdquo;', 'comments title', 'wptv' ), '<span>' . get_the_title() . '</span>' );
     26            } else {
     27                printf(
     28                    /* translators: 1: number of comments, 2: post title */
     29                    _nx(
     30                        '%1$s response on &ldquo;%2$s&rdquo;',
     31                        '%1$s responses on &ldquo;%2$s&rdquo;',
     32                        $comments_number,
     33                        'comments title',
     34                        'wptv'
     35                    ),
     36                    number_format_i18n( $comments_number ),
     37                    '<span>' . get_the_title() . '</span>'
     38                );
     39            }
    2440        ?>
    2541    </h3>
Note: See TracChangeset for help on using the changeset viewer.