WordPress.org

Make WordPress Core


Ignore:
Timestamp:
09/01/2019 05:12:43 PM (7 weeks ago)
Author:
SergeyBiryukov
Message:

I18N: Improve translator comments.

  • Add missing translator comments.
  • Fix placement of some translator comments. Translator comments should be on the line directly above the line containing the translation function call for optimal compatibility with various .pot file generation tools. The CS auto-fixing, which changed some inconsistent function calls to multi-line function calls, is part of the reason why this was no longer the case for a select group of translator comments.

Includes minor code layout fixes.

Polyglots, rejoice! All WordPress core files now have translator comments for all strings with placeholders!

Props jrf, subrataemfluence, GaryJ, webdados, Dency, swissspidy, alvarogois, marcomartins, mihaiiceyro, vladwtz, niq1982, flipkeijzer, michielatyoast, chandrapatel, thrijith, joshuanoyce, FesoVik, tessak22, bhaktirajdev, cleancoded, dhavalkasvala, garrett-eclipse, bibliofille, socalchristina, priyankkpatel, 5hel2l2y, adamsilverstein, JeffPaul, pierlo, SergeyBiryukov.
Fixes #44360.

File:
1 edited

Legend:

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

    r45674 r45926  
    153153    $draft_or_post_title = wp_html_excerpt( _draft_or_post_title( $post_id ), 50, '…' );
    154154    if ( $comments_count->moderated > 0 ) {
    155         /* translators: 1: comments count, 2: post title */
    156155        $title = sprintf(
     156            /* translators: 1: comments count, 2: post title */
    157157            __( 'Comments (%1$s) on “%2$s”' ),
    158158            number_format_i18n( $comments_count->moderated ),
     
    160160        );
    161161    } else {
    162         /* translators: %s: post title */
    163162        $title = sprintf(
     163            /* translators: %s: post title */
    164164            __( 'Comments on “%s”' ),
    165165            $draft_or_post_title
     
    169169    $comments_count = wp_count_comments();
    170170    if ( $comments_count->moderated > 0 ) {
    171         /* translators: %s: comments count */
    172171        $title = sprintf(
     172            /* translators: %s: comments count */
    173173            __( 'Comments (%s)' ),
    174174            number_format_i18n( $comments_count->moderated )
     
    226226<?php
    227227if ( $post_id ) {
    228     /* translators: %s: link to post */
    229228    printf(
     229        /* translators: %s: link to post */
    230230        __( 'Comments on &#8220;%s&#8221;' ),
    231231        sprintf(
     
    244244if ( isset( $_REQUEST['s'] ) && strlen( $_REQUEST['s'] ) ) {
    245245    echo '<span class="subtitle">';
    246     /* translators: %s: search keywords */
    247246    printf(
     247        /* translators: %s: search keywords */
    248248        __( 'Search results for &#8220;%s&#8221;' ),
    249249        wp_html_excerpt( esc_html( wp_unslash( $_REQUEST['s'] ) ), 50, '&hellip;' )
     
    283283    if ( $approved > 0 || $deleted > 0 || $trashed > 0 || $untrashed > 0 || $spammed > 0 || $unspammed > 0 || $same > 0 ) {
    284284        if ( $approved > 0 ) {
    285             /* translators: %s: number of comments approved */
     285            /* translators: %s: number of comments */
    286286            $messages[] = sprintf( _n( '%s comment approved', '%s comments approved', $approved ), $approved );
    287287        }
     
    289289        if ( $spammed > 0 ) {
    290290            $ids = isset( $_REQUEST['ids'] ) ? $_REQUEST['ids'] : 0;
    291             /* translators: %s: number of comments marked as spam */
     291            /* translators: %s: number of comments */
    292292            $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 />';
    293293        }
    294294
    295295        if ( $unspammed > 0 ) {
    296             /* translators: %s: number of comments restored from the spam */
     296            /* translators: %s: number of comments */
    297297            $messages[] = sprintf( _n( '%s comment restored from the spam', '%s comments restored from the spam', $unspammed ), $unspammed );
    298298        }
     
    300300        if ( $trashed > 0 ) {
    301301            $ids = isset( $_REQUEST['ids'] ) ? $_REQUEST['ids'] : 0;
    302             /* translators: %s: number of comments moved to the Trash */
     302            /* translators: %s: number of comments */
    303303            $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 />';
    304304        }
    305305
    306306        if ( $untrashed > 0 ) {
    307             /* translators: %s: number of comments restored from the Trash */
     307            /* translators: %s: number of comments */
    308308            $messages[] = sprintf( _n( '%s comment restored from the Trash', '%s comments restored from the Trash', $untrashed ), $untrashed );
    309309        }
    310310
    311311        if ( $deleted > 0 ) {
    312             /* translators: %s: number of comments permanently deleted */
     312            /* translators: %s: number of comments */
    313313            $messages[] = sprintf( _n( '%s comment permanently deleted', '%s comments permanently deleted', $deleted ), $deleted );
    314314        }
Note: See TracChangeset for help on using the changeset viewer.