Make WordPress Core


Ignore:
Timestamp:
11/06/2015 12:22:44 AM (8 years ago)
Author:
SergeyBiryukov
Message:

Add translator comments for strings in wp-admin/edit-comments.php.

Props ramiy for initial patch.
Fixes #34586.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/edit-comments.php

    r34891 r35549  
    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        );
     
    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>',
     182if ( $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' );
    188 
    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>
     192}
     193
     194if ( 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
     
    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 );
    237 
    238         if ( $deleted > 0 )
     255        }
     256
     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 ) ) {
Note: See TracChangeset for help on using the changeset viewer.