WordPress.org

Make WordPress Core


Ignore:
Timestamp:
09/03/2019 12:39:13 AM (7 weeks ago)
Author:
SergeyBiryukov
Message:

I18N: Capitalize translator comments consistently, add trailing punctuation.

Includes minor code layout fixes.

See #44360.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/class-wp-comments-list-table.php

    r45926 r45932  
    218218
    219219        $stati = array(
    220             /* translators: %s: all comments count */
     220            /* translators: %s: Number of comments. */
    221221            'all'       => _nx_noop(
    222222                'All <span class="count">(%s)</span>',
     
    225225            ), // singular not used
    226226
    227             /* translators: %s: current user's comments count */
     227            /* translators: %s: Number of comments. */
    228228            'mine'      => _nx_noop(
    229229                'Mine <span class="count">(%s)</span>',
     
    232232            ),
    233233
    234             /* translators: %s: pending comments count */
     234            /* translators: %s: Number of comments. */
    235235            'moderated' => _nx_noop(
    236236                'Pending <span class="count">(%s)</span>',
     
    239239            ),
    240240
    241             /* translators: %s: approved comments count */
     241            /* translators: %s: Number of comments. */
    242242            'approved'  => _nx_noop(
    243243                'Approved <span class="count">(%s)</span>',
     
    246246            ),
    247247
    248             /* translators: %s: spam comments count */
     248            /* translators: %s: Number of comments. */
    249249            'spam'      => _nx_noop(
    250250                'Spam <span class="count">(%s)</span>',
     
    253253            ),
    254254
    255             /* translators: %s: trashed comments count */
     255            /* translators: %s: Number of comments. */
    256256            'trash'     => _nx_noop(
    257257                'Trash <span class="count">(%s)</span>',
     
    456456
    457457        if ( ! $post_id ) {
    458             /* translators: column name or table row header */
     458            /* translators: Column name or table row header. */
    459459            $columns['response'] = __( 'In Response To' );
    460460        }
     
    619619        if ( $comment_status && 'all' != $comment_status ) {
    620620            if ( 'approved' === $the_comment_status ) {
    621                 $actions['unapprove'] = "<a href='$unapprove_url' data-wp-lists='delete:the-comment-list:comment-$comment->comment_ID:e7e7d3:action=dim-comment&amp;new=unapproved' class='vim-u vim-destructive aria-button-if-js' aria-label='" . esc_attr__( 'Unapprove this comment' ) . "'>" . __( 'Unapprove' ) . '</a>';
     621                $actions['unapprove'] = sprintf(
     622                    '<a href="%s" data-wp-lists="%s" class="vim-u vim-destructive aria-button-if-js" aria-label="%s">%s</a>',
     623                    $unapprove_url,
     624                    "delete:the-comment-list:comment-{$comment->comment_ID}:e7e7d3:action=dim-comment&amp;new=unapproved",
     625                    esc_attr__( 'Unapprove this comment' ),
     626                    __( 'Unapprove' )
     627                );
    622628            } elseif ( 'unapproved' === $the_comment_status ) {
    623                 $actions['approve'] = "<a href='$approve_url' data-wp-lists='delete:the-comment-list:comment-$comment->comment_ID:e7e7d3:action=dim-comment&amp;new=approved' class='vim-a vim-destructive aria-button-if-js' aria-label='" . esc_attr__( 'Approve this comment' ) . "'>" . __( 'Approve' ) . '</a>';
     629                $actions['approve'] = sprintf(
     630                    '<a href="%s" data-wp-lists="%s" class="vim-a vim-destructive aria-button-if-js" aria-label="%s">%s</a>',
     631                    $approve_url,
     632                    "delete:the-comment-list:comment-{$comment->comment_ID}:e7e7d3:action=dim-comment&amp;new=approved",
     633                    esc_attr__( 'Approve this comment' ),
     634                    __( 'Approve' )
     635                );
    624636            }
    625637        } else {
    626             $actions['approve']   = "<a href='$approve_url' data-wp-lists='dim:the-comment-list:comment-$comment->comment_ID:unapproved:e7e7d3:e7e7d3:new=approved' class='vim-a aria-button-if-js' aria-label='" . esc_attr__( 'Approve this comment' ) . "'>" . __( 'Approve' ) . '</a>';
    627             $actions['unapprove'] = "<a href='$unapprove_url' data-wp-lists='dim:the-comment-list:comment-$comment->comment_ID:unapproved:e7e7d3:e7e7d3:new=unapproved' class='vim-u aria-button-if-js' aria-label='" . esc_attr__( 'Unapprove this comment' ) . "'>" . __( 'Unapprove' ) . '</a>';
     638            $actions['approve'] = sprintf(
     639                '<a href="%s" data-wp-lists="%s" class="vim-a aria-button-if-js" aria-label="%s">%s</a>',
     640                $approve_url,
     641                "dim:the-comment-list:comment-{$comment->comment_ID}:unapproved:e7e7d3:e7e7d3:new=approved",
     642                esc_attr__( 'Approve this comment' ),
     643                __( 'Approve' )
     644            );
     645
     646            $actions['unapprove'] = sprintf(
     647                '<a href="%s" data-wp-lists="%s" class="vim-u aria-button-if-js" aria-label="%s">%s</a>',
     648                $unapprove_url,
     649                "dim:the-comment-list:comment-{$comment->comment_ID}:unapproved:e7e7d3:e7e7d3:new=unapproved",
     650                esc_attr__( 'Unapprove this comment' ),
     651                __( 'Unapprove' )
     652            );
    628653        }
    629654
    630655        if ( 'spam' !== $the_comment_status ) {
    631             $actions['spam'] = "<a href='$spam_url' data-wp-lists='delete:the-comment-list:comment-$comment->comment_ID::spam=1' class='vim-s vim-destructive aria-button-if-js' aria-label='" . esc_attr__( 'Mark this comment as spam' ) . "'>" . /* translators: mark as spam link */ _x( 'Spam', 'verb' ) . '</a>';
     656            $actions['spam'] = sprinf(
     657                '<a href="%s" data-wp-lists="%s" class="vim-s vim-destructive aria-button-if-js" aria-label="%s">%s</a>',
     658                $spam_url,
     659                "delete:the-comment-list:comment-{$comment->comment_ID}::spam=1",
     660                esc_attr__( 'Mark this comment as spam' ),
     661                /* translators: "Mark as spam" link. */
     662                _x( 'Spam', 'verb' )
     663            );
    632664        } elseif ( 'spam' === $the_comment_status ) {
    633             $actions['unspam'] = "<a href='$unspam_url' data-wp-lists='delete:the-comment-list:comment-$comment->comment_ID:66cc66:unspam=1' class='vim-z vim-destructive aria-button-if-js' aria-label='" . esc_attr__( 'Restore this comment from the spam' ) . "'>" . _x( 'Not Spam', 'comment' ) . '</a>';
     665            $actions['unspam'] = sprintf(
     666                '<a href="%s" data-wp-lists="%s" class="vim-z vim-destructive aria-button-if-js" aria-label="%s">%s</a>',
     667                $unspam_url,
     668                "delete:the-comment-list:comment-{$comment->comment_ID}:66cc66:unspam=1",
     669                esc_attr__( 'Restore this comment from the spam' ),
     670                _x( 'Not Spam', 'comment' )
     671            );
    634672        }
    635673
    636674        if ( 'trash' === $the_comment_status ) {
    637             $actions['untrash'] = "<a href='$untrash_url' data-wp-lists='delete:the-comment-list:comment-$comment->comment_ID:66cc66:untrash=1' class='vim-z vim-destructive aria-button-if-js' aria-label='" . esc_attr__( 'Restore this comment from the Trash' ) . "'>" . __( 'Restore' ) . '</a>';
     675            $actions['untrash'] = sprintf(
     676                '<a href="%s" data-wp-lists="%s" class="vim-z vim-destructive aria-button-if-js" aria-label="%s">%s</a>',
     677                $untrash_url,
     678                "delete:the-comment-list:comment-{$comment->comment_ID}:66cc66:untrash=1",
     679                esc_attr__( 'Restore this comment from the Trash' ),
     680                __( 'Restore' )
     681            );
    638682        }
    639683
    640684        if ( 'spam' === $the_comment_status || 'trash' === $the_comment_status || ! EMPTY_TRASH_DAYS ) {
    641             $actions['delete'] = "<a href='$delete_url' data-wp-lists='delete:the-comment-list:comment-$comment->comment_ID::delete=1' class='delete vim-d vim-destructive aria-button-if-js' aria-label='" . esc_attr__( 'Delete this comment permanently' ) . "'>" . __( 'Delete Permanently' ) . '</a>';
     685            $actions['delete'] = sprintf(
     686                '<a href="%s" data-wp-lists="%s" class="delete vim-d vim-destructive aria-button-if-js" aria-label="%s">%s</a>',
     687                $delete_url,
     688                "delete:the-comment-list:comment-{$comment->comment_ID}::delete=1",
     689                esc_attr__( 'Delete this comment permanently' ),
     690                __( 'Delete Permanently' )
     691            );
    642692        } else {
    643             $actions['trash'] = "<a href='$trash_url' data-wp-lists='delete:the-comment-list:comment-$comment->comment_ID::trash=1' class='delete vim-d vim-destructive aria-button-if-js' aria-label='" . esc_attr__( 'Move this comment to the Trash' ) . "'>" . _x( 'Trash', 'verb' ) . '</a>';
     693            $actions['trash'] = sprintf(
     694                '<a href="%s" data-wp-lists="%s" class="delete vim-d vim-destructive aria-button-if-js" aria-label="%s">%s</a>',
     695                $trash_url,
     696                "delete:the-comment-list:comment-{$comment->comment_ID}::trash=1",
     697                esc_attr__( 'Move this comment to the Trash' ),
     698                _x( 'Trash', 'verb' )
     699            );
    644700        }
    645701
    646702        if ( 'spam' !== $the_comment_status && 'trash' !== $the_comment_status ) {
    647             $actions['edit'] = "<a href='comment.php?action=editcomment&amp;c={$comment->comment_ID}' aria-label='" . esc_attr__( 'Edit this comment' ) . "'>" . __( 'Edit' ) . '</a>';
     703            $actions['edit'] = sprintf(
     704                '<a href="%s" aria-label="%s">%s</a>',
     705                "comment.php?action=editcomment&amp;c={$comment->comment_ID}",
     706                esc_attr__( 'Edit this comment' ),
     707                __( 'Edit' )
     708            );
    648709
    649710            $format = '<button type="button" data-comment-id="%d" data-post-id="%d" data-action="%s" class="%s button-link" aria-expanded="false" aria-label="%s">%s</button>';
    650711
    651             $actions['quickedit'] = sprintf( $format, $comment->comment_ID, $comment->comment_post_ID, 'edit', 'vim-q comment-inline', esc_attr__( 'Quick edit this comment inline' ), __( 'Quick&nbsp;Edit' ) );
    652 
    653             $actions['reply'] = sprintf( $format, $comment->comment_ID, $comment->comment_post_ID, 'replyto', 'vim-r comment-inline', esc_attr__( 'Reply to this comment' ), __( 'Reply' ) );
     712            $actions['quickedit'] = sprintf(
     713                $format,
     714                $comment->comment_ID,
     715                $comment->comment_post_ID,
     716                'edit',
     717                'vim-q comment-inline',
     718                esc_attr__( 'Quick edit this comment inline' ),
     719                __( 'Quick&nbsp;Edit' )
     720            );
     721
     722            $actions['reply'] = sprintf(
     723                $format,
     724                $comment->comment_ID,
     725                $comment->comment_post_ID,
     726                'replyto',
     727                'vim-r comment-inline',
     728                esc_attr__( 'Reply to this comment' ),
     729                __( 'Reply' )
     730            );
    654731        }
    655732
     
    709786                $name        = get_comment_author( $parent );
    710787                printf(
    711                     /* translators: %s: comment link */
     788                    /* translators: %s: Comment link. */
    712789                    __( 'In reply to %s.' ),
    713790                    '<a href="' . $parent_link . '">' . $name . '</a>'
     
    787864    public function column_date( $comment ) {
    788865        $submitted = sprintf(
    789             /* translators: 1: comment date, 2: comment time */
     866            /* translators: 1: Comment date, 2: Comment time. */
    790867            __( '%1$s at %2$s' ),
    791             /* translators: comment date format. See https://secure.php.net/date */
     868            /* translators: Comment date format. See https://secure.php.net/date */
    792869            get_comment_date( __( 'Y/m/d' ), $comment ),
    793870            get_comment_date( __( 'g:i a' ), $comment )
Note: See TracChangeset for help on using the changeset viewer.