Skip to:
Content

BuddyPress.org

Ticket #6368: 6368.2.diff

File 6368.2.diff, 18.7 KB (added by SergeyBiryukov, 10 years ago)
  • src/bp-activity/bp-activity-template.php

     
    847847                $to_num    = bp_core_number_format( ( $start_num + ( $activities_template->pag_num - 1 ) > $activities_template->total_activity_count ) ? $activities_template->total_activity_count : $start_num + ( $activities_template->pag_num - 1 ) );
    848848                $total     = bp_core_number_format( $activities_template->total_activity_count );
    849849
    850                 return sprintf( _n( 'Viewing 1 item', 'Viewing %1$s - %2$s of %3$s items', $total, 'buddypress' ), $from_num, $to_num, $total );
     850                if ( 1 == $activities_template->total_activity_count ) {
     851                        $message = __( 'Viewing 1 item', 'buddypress' );
     852                } else {
     853                        $message = sprintf( _n( 'Viewing %1$s - %2$s of %3$s item', 'Viewing %1$s - %2$s of %3$s items', $activities_template->total_activity_count, 'buddypress' ), $from_num, $to_num, $total );
     854                }
     855
     856                return $message;
    851857        }
    852858
    853859/**
  • src/bp-blogs/bp-blogs-template.php

     
    472472        $to_num    = bp_core_number_format( ( $start_num + ( $blogs_template->pag_num - 1 ) > $blogs_template->total_blog_count ) ? $blogs_template->total_blog_count : $start_num + ( $blogs_template->pag_num - 1 ) );
    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
    478484/**
  • src/bp-forums/bp-forums-template.php

     
    18781878                if ( 'tags' == $forum_template->type && !empty( $forum_template->search_terms ) )
    18791879                        $pag_filter = sprintf( __( ' matching tag "%s"', 'buddypress' ), $forum_template->search_terms );
    18801880
     1881                if ( 1 == $forum_template->total_topic_count ) {
     1882                        $message = __( 'Viewing 1 topic', 'buddypress' );
     1883                } else {
     1884                        $message = sprintf( _n( 'Viewing %1$s - %2$s of %3$s topic', 'Viewing %1$s - %2$s of %3$s topics', (int) $forum_template->total_topic_count, 'buddypress' ), $from_num, $to_num, $total, $pag_filter )
     1885                }
     1886
    18811887                /**
    18821888                 * Filters the pagination count for the current topic list.
    18831889                 *
     
    18881894                 * @param string $to_num   High end count in the view.
    18891895                 * @param string $total    Total count of topics found.
    18901896                 */
    1891                 return apply_filters( 'bp_get_forum_pagination_count', sprintf( _n( 'Viewing 1 topic', 'Viewing %1$s - %2$s of %3$s topics', (int) $forum_template->total_topic_count, 'buddypress' ), $from_num, $to_num, $total, $pag_filter ), $from_num, $to_num, $total );
     1897                return apply_filters( 'bp_get_forum_pagination_count', $message, $from_num, $to_num, $total );
    18921898        }
    18931899
    18941900/**
     
    26222628        $to_num = bp_core_number_format( ( $start_num + ( $topic_template->pag_num - 1  ) > $topic_template->total_post_count ) ? $topic_template->total_post_count : $start_num + ( $topic_template->pag_num - 1 ) );
    26232629        $total = bp_core_number_format( $topic_template->total_post_count );
    26242630
     2631        if ( 1 == $topic_template->total_post_count ) {
     2632                $message = __( 'Viewing 1 post', 'buddypress' );
     2633        } else {
     2634                $message = sprintf( _n( 'Viewing %1$s - %2$s of %3$s post', 'Viewing %1$s - %2$s of %3$s posts', (int) $topic_template->total_post_count, 'buddypress' ), $from_num, $to_num, $total )
     2635        }
     2636
    26252637        /**
    26262638         * Filters the pagination count for the current topic page.
    26272639         *
     
    26322644         * @param string $to_num   High end count in the view.
    26332645         * @param string $total    Total count of topics found.
    26342646         */
    2635         echo apply_filters( 'bp_the_topic_pagination_count', sprintf( _n( 'Viewing 1 post', 'Viewing %1$s - %2$s of %3$s posts', (int) $topic_template->total_post_count, 'buddypress' ), $from_num, $to_num, $total ), $from_num, $to_num, $total );
     2647        echo apply_filters( 'bp_the_topic_pagination_count', $message, $from_num, $to_num, $total );
    26362648}
    26372649
    26382650/**
  • src/bp-groups/bp-groups-admin.php

     
    10391039                'current'   => $page,
    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                        number_format_i18n( $current_page_start ),
     1048                        number_format_i18n( $current_page_end ),
     1049                        (int) $query->total_users
     1050                );
     1051        }
    10481052
    10491053        $pagination .= '<span class="bp-group-admin-pagination-viewing">' . $viewing_text . '</span>';
    10501054        $pagination .= '<span class="bp-group-admin-pagination-links">' . $pag_links . '</span>';
  • src/bp-groups/bp-groups-template.php

     
    17931793                $to_num    = bp_core_number_format( ( $start_num + ( $groups_template->pag_num - 1 ) > $groups_template->total_group_count ) ? $groups_template->total_group_count : $start_num + ( $groups_template->pag_num - 1 ) );
    17941794                $total     = bp_core_number_format( $groups_template->total_group_count );
    17951795
     1796                if ( 1 == $groups_template->total_group_count ) {
     1797                        $message = __( 'Viewing 1 group', 'buddypress' );
     1798                } else {
     1799                        $message = sprintf( _n( 'Viewing %1$s - %2$s of %3$s group', 'Viewing %1$s - %2$s of %3$s groups', $groups_template->total_group_count, 'buddypress' ), $from_num, $to_num, $total );
     1800                }
     1801
    17961802                /**
    17971803                 * Filters the "Viewing x-y of z groups" pagination message.
    17981804                 *
     
    18031809                 * @param string $to_num   Total amount for the high value in the range.
    18041810                 * @param string $total    Total amount of groups found.
    18051811                 */
    1806                 return apply_filters( 'bp_get_groups_pagination_count', sprintf( _n( 'Viewing 1 group', 'Viewing %1$s - %2$s of %3$s groups', $total, 'buddypress' ), $from_num, $to_num, $total ), $from_num, $to_num, $total );
     1812                return apply_filters( 'bp_get_groups_pagination_count', $message, $from_num, $to_num, $total );
    18071813        }
    18081814
    18091815/**
     
    41154121                $to_num    = bp_core_number_format( ( $start_num + ( $members_template->pag_num - 1 ) > $members_template->total_member_count ) ? $members_template->total_member_count : $start_num + ( $members_template->pag_num - 1 ) );
    41164122                $total     = bp_core_number_format( $members_template->total_member_count );
    41174123
     4124                if ( 1 == $members_template->total_member_count ) {
     4125                        $message = __( 'Viewing 1 member', 'buddypress' );
     4126                } else {
     4127                        $message = sprintf( _n( 'Viewing %1$s - %2$s of %3$s member', 'Viewing %1$s - %2$s of %3$s groups', $members_template->total_member_count, 'buddypress' ), $from_num, $to_num, $total );
     4128                }
     4129
    41184130                /**
    41194131                 * Filters the "Viewing x-y of z members" pagination message.
    41204132                 *
     
    41254137                 * @param string $to_num   Total amount for the high value in the range.
    41264138                 * @param string $total    Total amount of members found.
    41274139                 */
    4128                 return apply_filters( 'bp_get_group_member_pagination_count', sprintf( _n( 'Viewing 1 member', 'Viewing %1$s - %2$s of %3$s members', $total, 'buddypress' ), $from_num, $to_num, $total ), $from_num, $to_num, $total );
     4140                return apply_filters( 'bp_get_group_member_pagination_count', $message, $from_num, $to_num, $total );
    41294141        }
    41304142
    41314143function bp_group_member_admin_pagination() {
     
    52385250                $to_num    = bp_core_number_format( ( $start_num + ( $requests_template->pag_num - 1 ) > $requests_template->total_request_count ) ? $requests_template->total_request_count : $start_num + ( $requests_template->pag_num - 1 ) );
    52395251                $total     = bp_core_number_format( $requests_template->total_request_count );
    52405252
     5253                if ( 1 == $requests_template->total_request_count ) {
     5254                        $message = __( 'Viewing 1 request', 'buddypress' );
     5255                } else {
     5256                        $message = sprintf( _n( 'Viewing %1$s - %2$s of %3$s request', 'Viewing %1$s - %2$s of %3$s requests', $requests_template->total_request_count, 'buddypress' ), $from_num, $to_num, $total );
     5257                }
     5258
    52415259                /**
    52425260                 * Filters pagination count text for group membership requests.
    52435261                 *
     
    52455263                 *
    52465264                 * @param string $value Pagination count text for group membership requests.
    52475265                 */
    5248                 return apply_filters( 'bp_get_group_requests_pagination_count', sprintf( _n( 'Viewing 1 request', 'Viewing %1$s - %2$s of %3$s requests', $total, 'buddypress' ), $from_num, $to_num, $total ), $from_num, $to_num, $total );
     5266                return apply_filters( 'bp_get_group_requests_pagination_count', $message, $from_num, $to_num, $total );
    52495267        }
    52505268
    52515269/** Group Invitations *********************************************************/
     
    56085626                $to_num    = bp_core_number_format( ( $start_num + ( $invites_template->pag_num - 1 ) > $invites_template->total_invite_count ) ? $invites_template->total_invite_count : $start_num + ( $invites_template->pag_num - 1 ) );
    56095627                $total     = bp_core_number_format( $invites_template->total_invite_count );
    56105628
     5629                if ( 1 == $invites_template->total_invite_count ) {
     5630                        $message = __( 'Viewing 1 invitation', 'buddypress' );
     5631                } else {
     5632                        $message = sprintf( _n( 'Viewing %1$s - %2$s of %3$s invitation', 'Viewing %1$s - %2$s of %3$s invitations', $invites_template->total_invite_count, 'buddypress' ), $from_num, $to_num, $total );
     5633                }
     5634
    56115635                /** This filter is documented in bp-groups/bp-groups-template.php */
    5612                 return apply_filters( 'bp_get_groups_pagination_count', sprintf( _n( 'Viewing 1 invitation', 'Viewing %1$s - %2$s of %3$s invitations', $total, 'buddypress' ), $from_num, $to_num, $total ), $from_num, $to_num, $total );
     5636                return apply_filters( 'bp_get_groups_pagination_count', $message, $from_num, $to_num, $total );
    56135637        }
    56145638
    56155639/** Group RSS *****************************************************************/
  • src/bp-members/bp-members-admin.php

     
    18941894                switch ( $action ) {
    18951895                        case 'delete' :
    18961896                                $header_text = __( 'Delete Pending Accounts', 'buddypress' );
    1897                                 $helper_text = _n( 'You are about to delete the following account:', 'You are about to delete the following accounts:', count( $signup_ids ), 'buddypress' );
     1897                                if ( 1 == count( $signup_ids ) ) {
     1898                                        $helper_text = __( 'You are about to delete the following account:', 'buddypress' );
     1899                                } else {
     1900                                        $helper_text = __( 'You are about to delete the following accounts:', 'buddypress' );
     1901                                }
    18981902                                break;
    18991903
    19001904                        case 'activate' :
    19011905                                $header_text = __( 'Activate Pending Accounts', 'buddypress' );
    1902                                 $helper_text = _n( 'You are about to activate the following account:', 'You are about to activate the following accounts:', count( $signup_ids ), 'buddypress' );
     1906                                if ( 1 == count( $signup_ids ) ) {
     1907                                        $helper_text = __( 'You are about to activate the following account:', 'buddypress' );
     1908                                } else {
     1909                                        $helper_text = __( 'You are about to activate the following accounts:', 'buddypress' );
     1910                                }
    19031911                                break;
    19041912
    19051913                        case 'resend' :
    19061914                                $header_text = __( 'Resend Activation Emails', 'buddypress' );
    1907                                 $helper_text = _n( 'You are about to resend an activation email to the following account:', 'You are about to resend activation emails to the following accounts:', count( $signup_ids ), 'buddypress' );
     1915                                if ( 1 == count( $signup_ids ) ) {
     1916                                        $helper_text = __( 'You are about to resend an activation email to the following account:', 'buddypress' );
     1917                                } else {
     1918                                        $helper_text = __( 'You are about to resend an activation email to the following accounts:', 'buddypress' );
     1919                                }
    19081920                                break;
    19091921                }
    19101922
  • src/bp-members/bp-members-template.php

     
    631631                $to_num    = bp_core_number_format( ( $start_num + ( $members_template->pag_num - 1 ) > $members_template->total_member_count ) ? $members_template->total_member_count : $start_num + ( $members_template->pag_num - 1 ) );
    632632                $total     = bp_core_number_format( $members_template->total_member_count );
    633633
    634                 if ( 'active' == $members_template->type )
    635                         $pag = sprintf( _n( 'Viewing 1 active member', 'Viewing %1$s - %2$s of %3$s active members', $members_template->total_member_count, 'buddypress' ), $from_num, $to_num, $total );
    636                 elseif ( 'popular' == $members_template->type )
    637                         $pag = sprintf( _n( 'Viewing 1 member with friends', 'Viewing %1$s - %2$s of %3$s members with friends', $members_template->total_member_count, 'buddypress' ), $from_num, $to_num, $total );
    638                 elseif ( 'online' == $members_template->type )
    639                         $pag = sprintf( _n( 'Viewing 1 online member', 'Viewing %1$s - %2$s of %3$s online members', $members_template->total_member_count, 'buddypress' ), $from_num, $to_num, $total );
    640                 else
    641                         $pag = sprintf( _n( 'Viewing 1 member', 'Viewing %1$s - %2$s of %3$s members', $members_template->total_member_count, 'buddypress' ), $from_num, $to_num, $total );
     634                if ( 'active' == $members_template->type ) {
     635                        if ( 1 == $members_template->total_member_count ) {
     636                                $pag = __( 'Viewing 1 active member', 'buddypress' );
     637                        } else {
     638                                $pag = sprintf( _n( 'Viewing %1$s - %2$s of %3$s active member', 'Viewing %1$s - %2$s of %3$s active members', $members_template->total_member_count, 'buddypress' ), $from_num, $to_num, $total );
     639                        }
     640                } elseif ( 'popular' == $members_template->type ) {
     641                        if ( 1 == $members_template->total_member_count ) {
     642                                $pag = __( 'Viewing 1 member with friends', 'buddypress' );
     643                        } else {
     644                                $pag = sprintf( _n( 'Viewing %1$s - %2$s of %3$s member with friends', 'Viewing %1$s - %2$s of %3$s members with friends', $members_template->total_member_count, 'buddypress' ), $from_num, $to_num, $total );
     645                        }
     646                } elseif ( 'online' == $members_template->type ) {
     647                        if ( 1 == $members_template->total_member_count ) {
     648                                $pag = __( 'Viewing 1 online member', 'buddypress' );
     649                        } else {
     650                                $pag = sprintf( _n( 'Viewing %1$s - %2$s of %3$s online member', 'Viewing %1$s - %2$s of %3$s online members', $members_template->total_member_count, 'buddypress' ), $from_num, $to_num, $total );
     651                        }
     652                } else {
     653                        if ( 1 == $members_template->total_member_count ) {
     654                                $pag = __( 'Viewing 1 member', 'buddypress' );
     655                        } else {
     656                                $pag = sprintf( _n( 'Viewing %1$s - %2$s of %3$s member', 'Viewing %1$s - %2$s of %3$s members', $members_template->total_member_count, 'buddypress' ), $from_num, $to_num, $total );
     657                        }
     658                }
    642659
    643660                /**
    644661                 * Filters the members pagination count.
  • src/bp-messages/bp-messages-template.php

     
    10861086        $to_num    = bp_core_number_format( ( $start_num + ( $messages_template->pag_num - 1 ) > $messages_template->total_thread_count ) ? $messages_template->total_thread_count : $start_num + ( $messages_template->pag_num - 1 ) );
    10871087        $total     = bp_core_number_format( $messages_template->total_thread_count );
    10881088
    1089         echo sprintf( _n( 'Viewing 1 message', 'Viewing %1$s - %2$s of %3$s messages', $total, 'buddypress' ), $from_num, $to_num, number_format_i18n( $total ) );
     1089        if ( 1 == $messages_template->total_thread_count ) {
     1090                $message = __( 'Viewing 1 message', 'buddypress' );
     1091        } else {
     1092                $message = sprintf( _n( 'Viewing %1$s - %2$s of %3$s message', 'Viewing %1$s - %2$s of %3$s messages', $messages_template->total_thread_count, 'buddypress' ), $from_num, $to_num, $total );
     1093        }
     1094
     1095        echo $message;
    10901096}
    10911097
    10921098/**
  • src/bp-notifications/bp-notifications-template.php

     
    11841184                $from_num   = bp_core_number_format( $start_num );
    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 );
    11881187
     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                }
     1193
    11891194                /**
    11901195                 * Filters the pagination count for the current notification loop.
    11911196                 *
  • src/bp-templates/bp-legacy/buddypress/members/single/groups/invites.php

     
    1111                                        <a href="<?php bp_group_permalink(); ?>"><?php bp_group_avatar( 'type=thumb&width=50&height=50' ); ?></a>
    1212                                </div>
    1313
    14                                 <h4><a href="<?php bp_group_permalink(); ?>"><?php bp_group_name(); ?></a><span class="small"> - <?php printf( _nx( '1 member', '%d members', bp_get_group_total_members( false ),'Group member count', 'buddypress' ), bp_get_group_total_members( false )  ); ?></span></h4>
     14                                <h4><a href="<?php bp_group_permalink(); ?>"><?php bp_group_name(); ?></a><span class="small"> - <?php printf( _nx( '%d member', '%d members', bp_get_group_total_members( false ),'Group member count', 'buddypress' ), bp_get_group_total_members( false )  ); ?></span></h4>
    1515
    1616                                <p class="desc">
    1717                                        <?php bp_group_description_excerpt(); ?>