Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
10/17/2013 04:24:33 PM (13 years ago)
Author:
boonebgorges
Message:

Improved plural i18n for pagination links

Cases where there is only one page of results will now read, eg, "...of 1
member" instead of "...of 1 members".

Where the pagination links are put through apply_filters(), this changeset
also adds the passing of the $from_num, $to_num, and $total values to the
filter.

Fixes #5107

Props imath

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-forums/bp-forums-template.php

    r7345 r7439  
    966966                        $pag_filter = sprintf( __( ' matching tag "%s"', 'buddypress' ), $forum_template->search_terms );
    967967
    968                 return apply_filters( 'bp_get_forum_pagination_count', sprintf( __( 'Viewing topic %s to %s (of %s total topics%s)', 'buddypress' ), $from_num, $to_num, $total, $pag_filter ) );
     968                return apply_filters( 'bp_get_forum_pagination_count', sprintf( _n( 'Viewing topic %s to %s (of %d topic%s)', 'Viewing topic %s to %s (of %d total topics%s)', $total, 'buddypress' ), $from_num, $to_num, number_format_i18n( $total ), $pag_filter ), $from_num, $to_num, $total );
    969969        }
    970970
     
    13061306        $total = bp_core_number_format( $topic_template->total_post_count );
    13071307
    1308         echo apply_filters( 'bp_the_topic_pagination_count', sprintf( __( 'Viewing post %1$s to %2$s (%3$s total posts)', 'buddypress' ), $from_num, $to_num, $total ) );
     1308        echo apply_filters( 'bp_the_topic_pagination_count', sprintf( _n( 'Viewing post %1$s to %2$s (%3$s post)', 'Viewing post %1$s to %2$s (%3$s total posts)', $total, 'buddypress' ), $from_num, $to_num, number_format_i18n( $total ) ), $from_num, $to_num, $total );
    13091309}
    13101310
Note: See TracChangeset for help on using the changeset viewer.