Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
03/28/2020 01:37:18 PM (6 years ago)
Author:
imath
Message:

BP Friends: add missing /* translators */ comments

See #8260

File:
1 edited

Legend:

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

    r11598 r12589  
    8282
    8383        <div class="info-group">
    84                 <h4><?php bp_word_or_name( __( "My Friends", 'buddypress' ), __( "%s's Friends", 'buddypress' ) ) ?>  (<?php echo BP_Friends_Friendship::total_friend_count( bp_displayed_user_id() ) ?>) <span><a href="<?php echo trailingslashit( bp_displayed_user_domain() . bp_get_friends_slug() ) ?>"><?php _e('See All', 'buddypress') ?></a></span></h4>
     84                <h4>
     85                        <?php
     86                        /* translators: %s: member name */
     87                        bp_word_or_name( __( "My Friends", 'buddypress' ), __( "%s's Friends", 'buddypress' ) );
     88                        ?>
     89                        &nbsp;
     90                        (<?php echo BP_Friends_Friendship::total_friend_count( bp_displayed_user_id() ); ?>)
     91                        &nbsp;
     92                        <span>
     93                                <a href="<?php echo trailingslashit( bp_displayed_user_domain() . bp_get_friends_slug() ) ?>">
     94                                        <?php esc_html_e( 'See All', 'buddypress' ) ?>
     95                                </a>
     96                        </span>
     97                </h4>
    8598
    8699                <?php if ( $friend_ids ) { ?>
     
    102115
    103116                        <div id="message" class="info">
    104                                 <p><?php bp_word_or_name( __( "You haven't added any friend connections yet.", 'buddypress' ), __( "%s hasn't created any friend connections yet.", 'buddypress' ) ) ?></p>
     117                                <p>
     118                                        <?php
     119                                        /* translators: %s: member name */
     120                                        bp_word_or_name( __( "You haven't added any friend connections yet.", 'buddypress' ), __( "%s hasn't created any friend connections yet.", 'buddypress' ) );
     121                                        ?>
     122                                </p>
    105123                        </div>
    106124
     
    235253                global $members_template;
    236254
    237                 if ( 1 == (int) $members_template->member->total_friend_count ) {
    238 
    239                         /**
    240                          * Filters text used to denote total friend count.
    241                          *
    242                          * @since 1.2.0
    243                          *
    244                          * @param string $value String of the form "x friends".
    245                          * @param int    $value Total friend count for current member in the loop.
    246                          */
    247                         return apply_filters( 'bp_get_member_total_friend_count', sprintf( __( '%d friend', 'buddypress' ), (int) $members_template->member->total_friend_count ) );
    248                 } else {
    249 
    250                         /** This filter is documented in bp-friends/bp-friends-template.php */
    251                         return apply_filters( 'bp_get_member_total_friend_count', sprintf( __( '%d friends', 'buddypress' ), (int) $members_template->member->total_friend_count ) );
    252                 }
     255                $total_friend_count = (int) $members_template->member->total_friend_count;
     256
     257                /**
     258                 * Filters text used to denote total friend count.
     259                 *
     260                 * @since 1.2.0
     261                 *
     262                 * @param string $value String of the form "x friends".
     263                 * @param int    $value Total friend count for current member in the loop.
     264                 */
     265                return apply_filters(
     266                        'bp_get_member_total_friend_count',
     267                        /* translators: %d: total friend count */
     268                        sprintf( _n( '%d friend', '%d friends', $total_friend_count, 'buddypress' ), number_format_i18n( $total_friend_count ) )
     269                );
    253270        }
    254271
     
    717734
    718735                        // If friends exist, show some formatted output.
    719                         $r['output'] = $r['before'] . sprintf( _n( '%s friend', '%s friends', $r['friends'], 'buddypress' ), '<strong>' . $r['friends'] . '</strong>' ) . $r['after'];
     736                        $r['output'] = $r['before'];
     737
     738                        /* translators: %d: total friend count */
     739                        $r['output'] .= sprintf( _n( '%d friend', '%d friends', $r['friends'], 'buddypress' ), '<strong>' . number_format_i18n( $r['friends'] ) . '</strong>' );
     740                        $r['output'] .= $r['after'];
    720741                }
    721742        }
Note: See TracChangeset for help on using the changeset viewer.