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-groups/bp-groups-admin.php

    r9665 r9765  
    10401040    ) );
    10411041
    1042     $viewing_text = sprintf(
    1043         _n( 'Viewing 1 member', 'Viewing %1$s - %2$s of %3$s members', $query->total_users, 'buddypress' ),
    1044         number_format_i18n( $current_page_start ),
    1045         number_format_i18n( $current_page_end ),
    1046         (int) $query->total_users
    1047     );
     1042    if ( 1 == $query->total_users ) {
     1043        $viewing_text = __( 'Viewing 1 member', 'buddypress' );
     1044    } else {
     1045        $viewing_text = sprintf(
     1046            _n( 'Viewing %1$s - %2$s of %3$s member', 'Viewing %1$s - %2$s of %3$s members', $query->total_users, 'buddypress' ),
     1047            bp_core_number_format( $current_page_start ),
     1048            bp_core_number_format( $current_page_end ),
     1049            bp_core_number_format( $query->total_users )
     1050        );
     1051    }
    10481052
    10491053    $pagination .= '<span class="bp-group-admin-pagination-viewing">' . $viewing_text . '</span>';
Note: See TracChangeset for help on using the changeset viewer.