WordPress.org

Make WordPress Core


Ignore:
Timestamp:
09/01/2019 05:12:43 PM (3 months 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/includes/ajax-actions.php

    r45742 r45926  
    315315    foreach ( $users as $user ) {
    316316        $return[] = array(
    317             /* translators: 1: user_login, 2: user_email */
     317            /* translators: 1: user login, 2: user email address */
    318318            'label' => sprintf( _x( '%1$s (%2$s)', 'user autocomplete result' ), $user->user_login, $user->user_email ),
    319319            'value' => $user->$field,
     
    455455                    'in_moderation'        => $counts->moderated,
    456456                    'i18n_comments_text'   => sprintf(
    457                         /* translators: %s: number of comments approved */
     457                        /* translators: %s: number of comments */
    458458                        _n( '%s Comment', '%s Comments', $counts->approved ),
    459459                        number_format_i18n( $counts->approved )
    460460                    ),
    461461                    'i18n_moderation_text' => sprintf(
    462                         /* translators: %s: number of comments in moderation */
     462                        /* translators: %s: number of comments */
    463463                        _n( '%s Comment in moderation', '%s Comments in moderation', $counts->moderated ),
    464464                        number_format_i18n( $counts->moderated )
     
    527527                'in_moderation'        => $counts->moderated,
    528528                'i18n_moderation_text' => sprintf(
    529                     /* translators: %s: number of comments in moderation */
     529                    /* translators: %s: number of comments */
    530530                    _n( '%s Comment in moderation', '%s Comments in moderation', $counts->moderated ),
    531531                    number_format_i18n( $counts->moderated )
     
    914914            array(
    915915                'what' => 'comment',
    916                 /* translators: %d: comment ID */
    917                 'id'   => new WP_Error( 'invalid_comment', sprintf( __( 'Comment %d does not exist' ), $id ) ),
     916                'id'   => new WP_Error(
     917                    'invalid_comment',
     918                    /* translators: %d: comment ID */
     919                    sprintf( __( 'Comment %d does not exist' ), $id )
     920                ),
    918921            )
    919922        );
     
    13021305        'in_moderation'        => $counts->moderated,
    13031306        'i18n_comments_text'   => sprintf(
    1304             /* translators: %s: number of comments approved */
     1307            /* translators: %s: number of comments */
    13051308            _n( '%s Comment', '%s Comments', $counts->approved ),
    13061309            number_format_i18n( $counts->approved )
    13071310        ),
    13081311        'i18n_moderation_text' => sprintf(
    1309             /* translators: %s: number of comments in moderation */
     1312            /* translators: %s: number of comments */
    13101313            _n( '%s Comment in moderation', '%s Comments in moderation', $counts->moderated ),
    13111314            number_format_i18n( $counts->moderated )
     
    19151918        $last_user_name = $last_user ? $last_user->display_name : __( 'Someone' );
    19161919
    1917         /* translators: %s: user who is currently editing the post */
     1920        /* translators: %s: user's display name */
    19181921        $msg_template = __( 'Saving is disabled: %s is currently editing this post.' );
     1922
    19191923        if ( $_POST['post_type'] == 'page' ) {
    1920             /* translators: %s: user who is currently editing the page */
     1924            /* translators: %s: user's display name */
    19211925            $msg_template = __( 'Saving is disabled: %s is currently editing this page.' );
    19221926        }
     
    26272631    if ( $last_id ) {
    26282632        $last_user = get_userdata( $last_id );
    2629         /* translators: 1: display_name of last user, 2: date of last edit, 3: time of last edit. */
     2633        /* translators: 1: user's display name, 2: date of last edit, 3: time of last edit. */
    26302634        $last_edited = sprintf( __( 'Last edited by %1$s on %2$s at %3$s' ), esc_html( $last_user->display_name ), $last_date, $last_time );
    26312635    } else {
     
    34813485            array(
    34823486                'type'    => 'not-embeddable',
    3483                 /* translators: %s: URL which cannot be embedded, between code tags */
     3487                /* translators: %s: URL that could not be embedded */
    34843488                'message' => sprintf( __( '%s failed to embed.' ), '<code>' . esc_html( $url ) . '</code>' ),
    34853489            )
Note: See TracChangeset for help on using the changeset viewer.