Skip to content

Commit 175d780

Browse files
Add translator comments for strings in wp-admin/edit-comments.php.
Props ramiy for initial patch. Fixes #34586. git-svn-id: https://develop.svn.wordpress.org/trunk@35549 602fd350-edb4-49c9-b593-d223f7449a82
1 parent 90f4b36 commit 175d780

1 file changed

Lines changed: 37 additions & 16 deletions

File tree

src/wp-admin/edit-comments.php

Lines changed: 37 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -117,19 +117,22 @@
117117
$comments_count = wp_count_comments( $post_id );
118118
$draft_or_post_title = wp_html_excerpt( _draft_or_post_title( $post_id ), 50, '…' );
119119
if ( $comments_count->moderated > 0 ) {
120-
$title = sprintf(
121-
__( 'Comments (%s) on “%s”' ),
120+
/* translators: 1: comments count 2: post title */
121+
$title = sprintf( __( 'Comments (%1$s) on “%2$s”' ),
122122
number_format_i18n( $comments_count->moderated ),
123123
$draft_or_post_title
124124
);
125125
} else {
126-
$title = sprintf( __( 'Comments on “%s”' ), $draft_or_post_title );
126+
/* translators: %s: post title */
127+
$title = sprintf( __( 'Comments on “%s”' ),
128+
$draft_or_post_title
129+
);
127130
}
128131
} else {
129132
$comments_count = wp_count_comments();
130133
if ( $comments_count->moderated > 0 ) {
131-
$title = sprintf(
132-
__( 'Comments (%s)' ),
134+
/* translators: %s: comments count */
135+
$title = sprintf( __( 'Comments (%s)' ),
133136
number_format_i18n( $comments_count->moderated )
134137
);
135138
} else {
@@ -176,19 +179,27 @@
176179

177180
<div class="wrap">
178181
<h1><?php
179-
if ( $post_id )
180-
echo sprintf( __( 'Comments on &#8220;%s&#8221;' ),
181-
sprintf( '<a href="%s">%s</a>',
182+
if ( $post_id ) {
183+
/* translators: %s: link to post */
184+
printf( __( 'Comments on &#8220;%s&#8221;' ),
185+
sprintf( '<a href="%1$s">%2$s</a>',
182186
get_edit_post_link( $post_id ),
183187
wp_html_excerpt( _draft_or_post_title( $post_id ), 50, '&hellip;' )
184188
)
185189
);
186-
else
190+
} else {
187191
_e( 'Comments' );
192+
}
188193

189-
if ( isset($_REQUEST['s']) && $_REQUEST['s'] )
190-
echo '<span class="subtitle">' . sprintf( __( 'Search results for &#8220;%s&#8221;' ), wp_html_excerpt( esc_html( wp_unslash( $_REQUEST['s'] ) ), 50, '&hellip;' ) ) . '</span>'; ?>
191-
</h1>
194+
if ( isset($_REQUEST['s']) && $_REQUEST['s'] ) {
195+
echo '<span class="subtitle">';
196+
/* translators: %s: search keywords */
197+
printf( __( 'Search results for &#8220;%s&#8221;' ),
198+
wp_html_excerpt( esc_html( wp_unslash( $_REQUEST['s'] ) ), 50, '&hellip;' )
199+
);
200+
echo '</span>';
201+
}
202+
?></h1>
192203

193204
<?php
194205
if ( isset( $_REQUEST['error'] ) ) {
@@ -216,27 +227,37 @@
216227
$same = isset( $_REQUEST['same'] ) ? (int) $_REQUEST['same'] : 0;
217228

218229
if ( $approved > 0 || $deleted > 0 || $trashed > 0 || $untrashed > 0 || $spammed > 0 || $unspammed > 0 || $same > 0 ) {
219-
if ( $approved > 0 )
230+
if ( $approved > 0 ) {
231+
/* translators: %s: number of comments approved */
220232
$messages[] = sprintf( _n( '%s comment approved', '%s comments approved', $approved ), $approved );
233+
}
221234

222235
if ( $spammed > 0 ) {
223236
$ids = isset($_REQUEST['ids']) ? $_REQUEST['ids'] : 0;
237+
/* translators: %s: number of comments marked as spam */
224238
$messages[] = sprintf( _n( '%s comment marked as spam.', '%s comments marked as spam.', $spammed ), $spammed ) . ' <a href="' . esc_url( wp_nonce_url( "edit-comments.php?doaction=undo&action=unspam&ids=$ids", "bulk-comments" ) ) . '">' . __('Undo') . '</a><br />';
225239
}
226240

227-
if ( $unspammed > 0 )
241+
if ( $unspammed > 0 ) {
242+
/* translators: %s: number of comments restored from the spam */
228243
$messages[] = sprintf( _n( '%s comment restored from the spam', '%s comments restored from the spam', $unspammed ), $unspammed );
244+
}
229245

230246
if ( $trashed > 0 ) {
231247
$ids = isset($_REQUEST['ids']) ? $_REQUEST['ids'] : 0;
248+
/* translators: %s: number of comments moved to the Trash */
232249
$messages[] = sprintf( _n( '%s comment moved to the Trash.', '%s comments moved to the Trash.', $trashed ), $trashed ) . ' <a href="' . esc_url( wp_nonce_url( "edit-comments.php?doaction=undo&action=untrash&ids=$ids", "bulk-comments" ) ) . '">' . __('Undo') . '</a><br />';
233250
}
234251

235-
if ( $untrashed > 0 )
252+
if ( $untrashed > 0 ) {
253+
/* translators: %s: number of comments restored from the Trash */
236254
$messages[] = sprintf( _n( '%s comment restored from the Trash', '%s comments restored from the Trash', $untrashed ), $untrashed );
255+
}
237256

238-
if ( $deleted > 0 )
257+
if ( $deleted > 0 ) {
258+
/* translators: %s: number of comments permanently deleted */
239259
$messages[] = sprintf( _n( '%s comment permanently deleted', '%s comments permanently deleted', $deleted ), $deleted );
260+
}
240261

241262
if ( $same > 0 && $comment = get_comment( $same ) ) {
242263
switch ( $comment->comment_approved ) {

0 commit comments

Comments
 (0)