Skip to:
Content

BuddyPress.org

Changeset 12589


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

BP Friends: add missing /* translators */ comments

See #8260

Location:
trunk/src/bp-friends
Files:
4 edited

Legend:

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

    r12393 r12589  
    142142    $friend_link    = bp_core_get_userlink( $activity->secondary_item_id );
    143143
     144    /* translators: 1: the initiator user link. 2: the friend user link. */
    144145    $action = sprintf( esc_html__( '%1$s and %2$s are now friends', 'buddypress' ), $initiator_link, $friend_link );
    145146
     
    176177    $friend_link    = bp_core_get_userlink( $activity->secondary_item_id );
    177178
     179    /* translators: 1: the initiator user link. 2: the friend user link. */
    178180    $action = sprintf( esc_html__( '%1$s and %2$s are now friends', 'buddypress' ), $initiator_link, $friend_link );
    179181
  • trunk/src/bp-friends/bp-friends-notifications.php

    r12087 r12589  
    3939            // Set up the string and the filter.
    4040            if ( (int) $total_items > 1 ) {
     41                /* translators: %d: the number of friends */
    4142                $text = sprintf( __( '%d friends accepted your friendship requests', 'buddypress' ), (int) $total_items );
    4243                $amount = 'multiple';
    4344            } else {
     45                /* translators: %s: friend name */
    4446                $text = sprintf( __( '%s accepted your friendship request', 'buddypress' ),  bp_core_get_user_displayname( $item_id ) );
    4547                $amount = 'single';
     
    5557            // Set up the string and the filter.
    5658            if ( (int) $total_items > 1 ) {
     59                /* translators: %d: the number of pending requests */
    5760                $text = sprintf( __( 'You have %d pending friendship requests', 'buddypress' ), (int) $total_items );
    5861                $amount = 'multiple';
    5962            } else {
     63                /* translators: %s: friend name */
    6064                $text = sprintf( __( 'You have a friendship request from %s', 'buddypress' ),  bp_core_get_user_displayname( $item_id ) );
    6165                $amount = 'single';
  • 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    }
  • trunk/src/bp-friends/classes/class-bp-friends-component.php

    r12087 r12589  
    297297                    'item_id' => bp_displayed_user_id(),
    298298                    'type'    => 'thumb',
    299                     'alt'     => sprintf( __( 'Profile picture of %s', 'buddypress' ), bp_get_displayed_user_fullname() )
     299                    'alt'     => sprintf(
     300                        /* translators: %s: member name */
     301                        __( 'Profile picture of %s', 'buddypress' ),
     302                        bp_get_displayed_user_fullname()
     303                    ),
    300304                ) );
    301305                $bp->bp_options_title = bp_get_displayed_user_fullname();
Note: See TracChangeset for help on using the changeset viewer.