Remove extra HTML from translatable strings in WP_Comments_List_Table::get_views().

Add a context and translator comments.

Props Tmeister for initial patch.
Fixes #31859.

git-svn-id: https://develop.svn.wordpress.org/trunk@34424 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Sergey Biryukov 2015-09-22 14:32:08 +00:00
parent 1de376cd8b
commit b9199cbcf7

View File

@ -204,11 +204,39 @@ class WP_Comments_List_Table extends WP_List_Table {
//, number_format_i18n($num_comments->moderated) ), "<span class='comment-count'>" . number_format_i18n($num_comments->moderated) . "</span>"),
//, number_format_i18n($num_comments->spam) ), "<span class='spam-comment-count'>" . number_format_i18n($num_comments->spam) . "</span>")
$stati = array(
'all' => _nx_noop('All', 'All', 'comments'), // singular not used
'moderated' => _n_noop('Pending <span class="count">(<span class="pending-count">%s</span>)</span>', 'Pending <span class="count">(<span class="pending-count">%s</span>)</span>'),
'approved' => _n_noop('Approved <span class="count">(<span class="approved-count">%s</span>)</span>', 'Approved <span class="count">(<span class="approved-count">%s</span>)</span>'),
'spam' => _n_noop('Spam <span class="count">(<span class="spam-count">%s</span>)</span>', 'Spam <span class="count">(<span class="spam-count">%s</span>)</span>'),
'trash' => _n_noop('Trash <span class="count">(<span class="trash-count">%s</span>)</span>', 'Trash <span class="count">(<span class="trash-count">%s</span>)</span>')
'all' => _nx_noop( 'All', 'All', 'comments' ), // singular not used
'moderated' => str_replace( '%s', '<span class="pending-count">%s</span>',
/* translators: %s: pending comments count */
_nx_noop(
'Pending <span class="count">(%s)</span>',
'Pending <span class="count">(%s)</span>',
'comments'
)
),
'approved' => str_replace( '%s', '<span class="approved-count">%s</span>',
/* translators: %s: approved comments count */
_nx_noop(
'Approved <span class="count">(%s)</span>',
'Approved <span class="count">(%s)</span>',
'comments'
)
),
'spam' => str_replace( '%s', '<span class="spam-count">%s</span>',
/* translators: %s: spam comments count */
_nx_noop(
'Spam <span class="count">(%s)</span>',
'Spam <span class="count">(%s)</span>',
'comments'
)
),
'trash' => str_replace( '%s', '<span class="trash-count">%s</span>',
/* translators: %s: trashed comments count */
_nx_noop(
'Trash <span class="count">(%s)</span>',
'Trash <span class="count">(%s)</span>',
'comments'
)
)
);
if ( !EMPTY_TRASH_DAYS )