Make WordPress Core


Ignore:
Timestamp:
09/01/2019 05:12:43 PM (5 years 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-form-advanced.php

    r45742 r45926  
    181181    7  => __( 'Post saved.' ),
    182182    8  => __( 'Post submitted.' ) . $preview_post_link_html,
     183    /* translators: %s: scheduled date for the post */
    183184    9  => sprintf( __( 'Post scheduled for: %s.' ), '<strong>' . $scheduled_date . '</strong>' ) . $scheduled_post_link_html,
    184185    10 => __( 'Post draft updated.' ) . $preview_post_link_html,
     
    195196    7  => __( 'Page saved.' ),
    196197    8  => __( 'Page submitted.' ) . $preview_page_link_html,
     198    /* translators: %s: scheduled date for the page */
    197199    9  => sprintf( __( 'Page scheduled for: %s.' ), '<strong>' . $scheduled_date . '</strong>' ) . $scheduled_page_link_html,
    198200    10 => __( 'Page draft updated.' ) . $preview_page_link_html,
     
    239241    foreach ( _wp_post_revision_fields( $post ) as $autosave_field => $_autosave_field ) {
    240242        if ( normalize_whitespace( $autosave->$autosave_field ) != normalize_whitespace( $post->$autosave_field ) ) {
    241             $notice = sprintf( __( 'There is an autosave of this post that is more recent than the version below. <a href="%s">View the autosave</a>' ), get_edit_post_link( $autosave->ID ) );
     243            $notice = sprintf(
     244                /* translators: %s: URL to view the autosave */
     245                __( 'There is an autosave of this post that is more recent than the version below. <a href="%s">View the autosave</a>' ),
     246                get_edit_post_link( $autosave->ID )
     247            );
    242248            break;
    243249        }
     
    293299
    294300    get_current_screen()->set_help_sidebar(
    295         '<p>' . sprintf( __( 'You can also create posts with the <a href="%s">Press This bookmarklet</a>.' ), 'tools.php' ) . '</p>' .
     301        '<p>' . sprintf(
     302            /* translators: %s: URL to Press This bookmarklet */
     303            __( 'You can also create posts with the <a href="%s">Press This bookmarklet</a>.' ),
     304            'tools.php'
     305        ) . '</p>' .
    296306            '<p><strong>' . __( 'For more information:' ) . '</strong></p>' .
    297307            '<p>' . __( '<a href="https://wordpress.org/support/article/wordpress-editor/">Documentation on Writing and Editing Posts</a>' ) . '</p>' .
     
    360370
    361371    if ( current_theme_supports( 'post-thumbnails' ) && post_type_supports( 'post', 'thumbnail' ) ) {
    362         /* translators: %s: Featured Image */
    363         $publish_box .= '<li>' . sprintf( __( '<strong>%s</strong> &mdash; This allows you to associate an image with your post without inserting it. This is usually useful only if your theme makes use of the image as a post thumbnail on the home page, a custom header, etc.' ), esc_html( $post_type_object->labels->featured_image ) ) . '</li>';
     372        $publish_box .= '<li>' . sprintf(
     373            /* translators: %s: Featured Image */
     374            __( '<strong>%s</strong> &mdash; This allows you to associate an image with your post without inserting it. This is usually useful only if your theme makes use of the image as a post thumbnail on the home page, a custom header, etc.' ),
     375            esc_html( $post_type_object->labels->featured_image )
     376        ) . '</li>';
    364377    }
    365378
     
    578591    ?>
    579592<table id="post-status-info"><tbody><tr>
    580     <td id="wp-word-count" class="hide-if-no-js"><?php printf( __( 'Word count: %s' ), '<span class="word-count">0</span>' ); ?></td>
     593    <td id="wp-word-count" class="hide-if-no-js">
     594    <?php
     595    printf(
     596        /* translators: %s: Number of words */
     597        __( 'Word count: %s' ),
     598        '<span class="word-count">0</span>'
     599    );
     600    ?>
     601    </td>
    581602    <td class="autosave-info">
    582603    <span class="autosave-message">&nbsp;</span>
Note: See TracChangeset for help on using the changeset viewer.