Skip to:
Content

BuddyPress.org

Changeset 10676


Ignore:
Timestamp:
03/23/2016 02:48:29 PM (8 years ago)
Author:
boonebgorges
Message:

Remove markup from translatable strings when building Friends nav items.

Props ramiy.
Fixes #6902.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-friends/classes/class-bp-friends-component.php

    r10652 r10676  
    138138
    139139        // Add 'Friends' to the main navigation.
    140         $count    = friends_get_total_friend_count();
    141         $class    = ( 0 === $count ) ? 'no-count' : 'count';
     140        $count = friends_get_total_friend_count();
     141        $class = ( 0 === $count ) ? 'no-count' : 'count';
     142
     143        $main_nav_name = sprintf(
     144            /* translators: %s: Friend count for the current user */
     145            __( 'Friends %s', 'buddypress' ),
     146            sprintf(
     147                '<span class="%s">%s</span>',
     148                esc_attr( $class ),
     149                bp_core_number_format( $count )
     150            )
     151        );
     152
    142153        $main_nav = array(
    143             'name'                => sprintf( __( 'Friends <span class="%s">%s</span>', 'buddypress' ), esc_attr( $class ), bp_core_number_format( $count ) ),
     154            'name'                => $main_nav_name,
    144155            'slug'                => $slug,
    145156            'position'            => 60,
     
    194205            $count = count( friends_get_friendship_request_user_ids( bp_loggedin_user_id() ) );
    195206            if ( !empty( $count ) ) {
    196                 $title   = sprintf( _x( 'Friends <span class="count">%s</span>',          'My Account Friends menu',         'buddypress' ), bp_core_number_format( $count ) );
    197                 $pending = sprintf( _x( 'Pending Requests <span class="count">%s</span>', 'My Account Friends menu sub nav', 'buddypress' ), bp_core_number_format( $count ) );
     207                $title = sprintf(
     208                    /* translators: %s: Pending friend request count for the current user */
     209                    _x( 'Friends %s', 'My Account Friends menu', 'buddypress' ),
     210                    '<span class="count">' . bp_core_number_format( $count ) . '</span>'
     211                );
     212                $pending = sprintf(
     213                    /* translators: %s: Pending friend request count for the current user */
     214                    _x( 'Pending Requests %s', 'My Account Friends menu sub nav', 'buddypress' ),
     215                    '<span class="count">' . bp_core_number_format( $count ) . '</span>'
     216                );
    198217            } else {
    199218                $title   = _x( 'Friends',            'My Account Friends menu',         'buddypress' );
Note: See TracChangeset for help on using the changeset viewer.