Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
04/17/2015 01:27:06 PM (10 years ago)
Author:
boonebgorges
Message:

Improved plural forms for localizable strings.

Strings that are intended for use only in the case of a single item should not
be bundled with strings intended for use with plurals, as this pattern does not
work with languages that use the singular nominal form for numbers other than
one. See https://core.trac.wordpress.org/ticket/28502#comment:23.

This changeset also fixes a few places where a formatted string, rather than a
raw integer, was being passed as the $count value to _n().

Props SergeyBiryukov.
Fixes #6368.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-blogs/bp-blogs-template.php

    r9471 r9765  
    473473    $total     = bp_core_number_format( $blogs_template->total_blog_count );
    474474
    475     echo sprintf( _n( 'Viewing 1 site', 'Viewing %1$s - %2$s of %3$s sites', $total, 'buddypress' ), $from_num, $to_num, $total );
     475    if ( 1 == $blogs_template->total_blog_count ) {
     476        $message = __( 'Viewing 1 site', 'buddypress' );
     477    } else {
     478        $message = sprintf( _n( 'Viewing %1$s - %2$s of %3$s site', 'Viewing %1$s - %2$s of %3$s sites', $blogs_template->total_blog_count, 'buddypress' ), $from_num, $to_num, $total );
     479    }
     480
     481    echo $message;
    476482}
    477483
Note: See TracChangeset for help on using the changeset viewer.