diff --git src/bp-blogs/bp-blogs-activity.php src/bp-blogs/bp-blogs-activity.php index 2371ffdbb..24185e3e8 100644 --- src/bp-blogs/bp-blogs-activity.php +++ src/bp-blogs/bp-blogs-activity.php @@ -127,7 +127,12 @@ function bp_blogs_format_activity_action_new_blog( $action, $activity ) { $blog_url = bp_blogs_get_blogmeta( $activity->item_id, 'url' ); $blog_name = bp_blogs_get_blogmeta( $activity->item_id, 'name' ); - $action = sprintf( esc_html__( '%s created the site %s', 'buddypress' ), bp_core_get_userlink( $activity->user_id ), '' . esc_html( $blog_name ) . '' ); + $action = sprintf( + /* translators: 1: the activity user link. 2: the blog link. */ + esc_html__( '%1$s created the site %2$s', 'buddypress' ), + bp_core_get_userlink( $activity->user_id ), + '' . esc_html( $blog_name ) . '' + ); // Legacy filter - requires the BP_Blogs_Blog object. if ( has_filter( 'bp_blogs_activity_created_blog_action' ) ) { @@ -230,15 +235,26 @@ function bp_blogs_format_activity_action_new_blog_post( $action, $activity ) { } // Build the 'post link' part of the activity action string. - $post_link = '' . esc_html( $post_title ) . ''; + $post_link = '' . esc_html( $post_title ) . ''; $user_link = bp_core_get_userlink( $activity->user_id ); // Build the complete activity action string. if ( is_multisite() ) { - $action = sprintf( esc_html__( '%1$s wrote a new post, %2$s, on the site %3$s', 'buddypress' ), $user_link, $post_link, '' . esc_html( $blog_name ) . '' ); + $action = sprintf( + /* translators: 1: the activity user link. 2: the post link. 3: the blog link. */ + esc_html_x( '%1$s wrote a new post, %2$s, on the site %3$s', '`new_blog_post` activity action', 'buddypress' ), + $user_link, + $post_link, + '' . esc_html( $blog_name ) . '' + ); } else { - $action = sprintf( esc_html__( '%1$s wrote a new post, %2$s', 'buddypress' ), $user_link, $post_link ); + $action = sprintf( + /* translators: 1: the activity user link. 2: the post link. */ + esc_html_x( '%1$s wrote a new post, %2$s', '`new_blog_post` activity action', 'buddypress' ), + $user_link, + $post_link + ); } // Legacy filter - requires the post object. @@ -362,9 +378,20 @@ function bp_blogs_format_activity_action_new_blog_comment( $action, $activity ) $user_link = bp_core_get_userlink( $activity->user_id ); if ( is_multisite() ) { - $action = sprintf( esc_html__( '%1$s commented on the post, %2$s, on the site %3$s', 'buddypress' ), $user_link, $post_link, '' . esc_html( $blog_name ) . '' ); + $action = sprintf( + /* translators: 1: the activity user link. 2: the post link. 3: the blog link. */ + esc_html_x( '%1$s commented on the post, %2$s, on the site %3$s', '`new_blog_comment` activity action', 'buddypress' ), + $user_link, + $post_link, + '' . esc_html( $blog_name ) . '' + ); } else { - $action = sprintf( esc_html__( '%1$s commented on the post, %2$s', 'buddypress' ), $user_link, $post_link ); + $action = sprintf( + /* translators: 1: the activity user link. 2: the post link. */ + esc_html_x( '%1$s commented on the post, %2$s', '`new_blog_comment` activity action', 'buddypress' ), + $user_link, + $post_link + ); } // Legacy filter - requires the comment object. diff --git src/bp-blogs/bp-blogs-template.php src/bp-blogs/bp-blogs-template.php index 77d50cbff..3cbd37ecd 100644 --- src/bp-blogs/bp-blogs-template.php +++ src/bp-blogs/bp-blogs-template.php @@ -242,6 +242,7 @@ function bp_get_blogs_pagination_count() { if ( 1 == $blogs_template->total_blog_count ) { $message = __( 'Viewing 1 site', 'buddypress' ); } else { + /* translators: 1: the site from number. 2: the site to number. 3: the total number of sites. */ $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 ); } @@ -357,7 +358,11 @@ function bp_blog_avatar( $args = '' ) { 'height' => false, 'class' => 'avatar', 'id' => false, - 'alt' => sprintf( __( 'Profile picture of site author %s', 'buddypress' ), esc_attr( $author_displayname ) ), + 'alt' => sprintf( + /* translators: %s: the author display name */ + __( 'Profile picture of site author %s', 'buddypress' ), + esc_attr( $author_displayname ) + ), 'no_grav' => false, ) ); @@ -713,7 +718,11 @@ function bp_blog_latest_post( $args = array() ) { * * @param string $retval Title of the latest post. */ - $retval = sprintf( __( 'Latest Post: %s', 'buddypress' ), '' . apply_filters( 'the_title', $retval ) . '' ); + $retval = sprintf( + /* translators: %s: the title of the latest post */ + __( 'Latest Post: %s', 'buddypress' ), + '' . apply_filters( 'the_title', $retval ) . '' + ); } else { /** This filter is documented in bp-blogs/bp-blogs-template.php */ @@ -1251,6 +1260,7 @@ function bp_blogs_confirm_blog_signup( $domain, $path, $blog_title, $user_name, %s', esc_url( $blog_url ), esc_url( $blog_url ) ) ), @@ -1309,9 +1319,30 @@ function bp_blogs_blog_tabs() { } ?>
' . $r['blogs'] . '' ) . $r['after']; + $r['output'] = $r['before']; + + /* translators: %s: the number of blogs */ + $r['output'] .= sprintf( _n( '%s site', '%s sites', $r['blogs'], 'buddypress' ), '' . $r['blogs'] . '' ); + $r['output'] .= $r['after']; } }