Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
04/17/2015 01:27:06 PM (7 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-notifications/bp-notifications-template.php

    r9574 r9765  
    11851185        $to_num     = bp_core_number_format( ( $start_num + ( $query_loop->pag_num - 1 ) > $query_loop->total_notification_count ) ? $query_loop->total_notification_count : $start_num + ( $query_loop->pag_num - 1 ) );
    11861186        $total      = bp_core_number_format( $query_loop->total_notification_count );
    1187         $pag        = sprintf( _n( 'Viewing 1 notification', 'Viewing %1$s - %2$s of %3$s notifications', $total, 'buddypress' ), $from_num, $to_num, $total );
     1187
     1188        if ( 1 == $query_loop->total_notification_count ) {
     1189            $pag = __( 'Viewing 1 notification', 'buddypress' );
     1190        } else {
     1191            $pag = sprintf( _n( 'Viewing %1$s - %2$s of %3$s notification', 'Viewing %1$s - %2$s of %3$s notifications', $query_loop->total_notification_count, 'buddypress' ), $from_num, $to_num, $total );
     1192        }
    11881193
    11891194        /**
Note: See TracChangeset for help on using the changeset viewer.