From 20c9a88a1815f95c6e3ac623e83eb60b1f382093 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Wed, 18 Nov 2015 18:03:47 +0000 Subject: [PATCH] I18N: After [34424], replace the placeholder with comments count after `translate_nooped_plural()` runs, not before. Props hnle. Fixes #34680. git-svn-id: https://develop.svn.wordpress.org/trunk@35670 602fd350-edb4-49c9-b593-d223f7449a82 --- .../includes/class-wp-comments-list-table.php | 71 +++++++++---------- 1 file changed, 34 insertions(+), 37 deletions(-) diff --git a/src/wp-admin/includes/class-wp-comments-list-table.php b/src/wp-admin/includes/class-wp-comments-list-table.php index 4a68221624..6560ff2c52 100644 --- a/src/wp-admin/includes/class-wp-comments-list-table.php +++ b/src/wp-admin/includes/class-wp-comments-list-table.php @@ -204,45 +204,39 @@ class WP_Comments_List_Table extends WP_List_Table { //, number_format_i18n($num_comments->moderated) ), "" . number_format_i18n($num_comments->moderated) . ""), //, number_format_i18n($num_comments->spam) ), "" . number_format_i18n($num_comments->spam) . "") $stati = array( - 'all' => str_replace( '%s', '%s', - /* translators: %s: all comments count */ - _nx_noop( - 'All (%s)', - 'All (%s)', - 'comments' - ) + /* translators: %s: all comments count */ + 'all' => _nx_noop( + 'All (%s)', + 'All (%s)', + 'comments' ), // singular not used - 'moderated' => str_replace( '%s', '%s', - /* translators: %s: pending comments count */ - _nx_noop( - 'Pending (%s)', - 'Pending (%s)', - 'comments' - ) + + /* translators: %s: pending comments count */ + 'moderated' => _nx_noop( + 'Pending (%s)', + 'Pending (%s)', + 'comments' ), - 'approved' => str_replace( '%s', '%s', - /* translators: %s: approved comments count */ - _nx_noop( - 'Approved (%s)', - 'Approved (%s)', - 'comments' - ) + + /* translators: %s: approved comments count */ + 'approved' => _nx_noop( + 'Approved (%s)', + 'Approved (%s)', + 'comments' ), - 'spam' => str_replace( '%s', '%s', - /* translators: %s: spam comments count */ - _nx_noop( - 'Spam (%s)', - 'Spam (%s)', - 'comments' - ) + + /* translators: %s: spam comments count */ + 'spam' => _nx_noop( + 'Spam (%s)', + 'Spam (%s)', + 'comments' ), - 'trash' => str_replace( '%s', '%s', - /* translators: %s: trashed comments count */ - _nx_noop( - 'Trash (%s)', - 'Trash (%s)', - 'comments' - ) + + /* translators: %s: trashed comments count */ + 'trash' => _nx_noop( + 'Trash (%s)', + 'Trash (%s)', + 'comments' ) ); @@ -266,9 +260,12 @@ class WP_Comments_List_Table extends WP_List_Table { if ( !empty( $_REQUEST['s'] ) ) $link = add_query_arg( 's', esc_attr( wp_unslash( $_REQUEST['s'] ) ), $link ); */ - $status_links[$status] = "" . sprintf( + $status_links[ $status ] = "" . sprintf( translate_nooped_plural( $label, $num_comments->$status ), - number_format_i18n( $num_comments->$status ) + sprintf( '%s', + $status, + number_format_i18n( $num_comments->$status ) + ) ) . ''; }