Make WordPress Core


Ignore:
Timestamp:
09/03/2019 12:39:13 AM (5 years 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/ajax-actions.php

    r45926 r45932  
    315315    foreach ( $users as $user ) {
    316316        $return[] = array(
    317             /* translators: 1: user login, 2: user email address */
     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 */
     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 */
     462                        /* translators: %s: Number of comments. */
    463463                        _n( '%s Comment in moderation', '%s Comments in moderation', $counts->moderated ),
    464464                        number_format_i18n( $counts->moderated )
     
    519519                'status'               => $comment ? $comment->comment_approved : '',
    520520                'postId'               => $comment ? $comment->comment_post_ID : '',
    521                 /* translators: %s: number of comments */
     521                /* translators: %s: Number of comments. */
    522522                'total_items_i18n'     => sprintf( _n( '%s item', '%s items', $total ), number_format_i18n( $total ) ),
    523523                'total_pages'          => ceil( $total / $per_page ),
     
    527527                'in_moderation'        => $counts->moderated,
    528528                'i18n_moderation_text' => sprintf(
    529                     /* translators: %s: number of comments */
     529                    /* translators: %s: Number of comments. */
    530530                    _n( '%s Comment in moderation', '%s Comments in moderation', $counts->moderated ),
    531531                    number_format_i18n( $counts->moderated )
     
    916916                'id'   => new WP_Error(
    917917                    'invalid_comment',
    918                     /* translators: %d: comment ID */
     918                    /* translators: %d: Comment ID. */
    919919                    sprintf( __( 'Comment %d does not exist' ), $id )
    920920                ),
     
    13051305        'in_moderation'        => $counts->moderated,
    13061306        'i18n_comments_text'   => sprintf(
    1307             /* translators: %s: number of comments */
     1307            /* translators: %s: Number of comments. */
    13081308            _n( '%s Comment', '%s Comments', $counts->approved ),
    13091309            number_format_i18n( $counts->approved )
    13101310        ),
    13111311        'i18n_moderation_text' => sprintf(
    1312             /* translators: %s: number of comments */
     1312            /* translators: %s: Number of comments. */
    13131313            _n( '%s Comment in moderation', '%s Comments in moderation', $counts->moderated ),
    13141314            number_format_i18n( $counts->moderated )
     
    14871487            $post_data['post_status'] = 'draft';
    14881488            $now                      = time();
    1489             /* translators: 1: Post creation date, 2: Post creation time */
     1489            /* translators: 1: Post creation date, 2: Post creation time. */
    14901490            $post_data['post_title'] = sprintf( __( 'Draft created on %1$s at %2$s' ), gmdate( __( 'F j, Y' ), $now ), gmdate( __( 'g:i a' ), $now ) );
    14911491
     
    16131613            'supplemental' => array(
    16141614                'show-link' => sprintf(
    1615                     /* translators: %s: the new user */
     1615                    /* translators: %s: The new user. */
    16161616                    __( 'User %s added' ),
    16171617                    '<a href="#user-' . $user_id . '">' . $user_object->user_login . '</a>'
     
    19181918        $last_user_name = $last_user ? $last_user->display_name : __( 'Someone' );
    19191919
    1920         /* translators: %s: user's display name */
     1920        /* translators: %s: User's display name. */
    19211921        $msg_template = __( 'Saving is disabled: %s is currently editing this post.' );
    19221922
    19231923        if ( $_POST['post_type'] == 'page' ) {
    1924             /* translators: %s: user's display name */
     1924            /* translators: %s: User's display name. */
    19251925            $msg_template = __( 'Saving is disabled: %s is currently editing this page.' );
    19261926        }
     
    21122112            $time = '';
    21132113        } else {
    2114             /* translators: date format in table columns, see https://secure.php.net/date */
     2114            /* translators: Date format in table columns, see https://secure.php.net/date */
    21152115            $time = mysql2date( __( 'Y/m/d' ), $post->post_date );
    21162116        }
     
    26312631    if ( $last_id ) {
    26322632        $last_user = get_userdata( $last_id );
    2633         /* translators: 1: user's display name, 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. */
    26342634        $last_edited = sprintf( __( 'Last edited by %1$s on %2$s at %3$s' ), esc_html( $last_user->display_name ), $last_date, $last_time );
    26352635    } else {
    2636         /* translators: 1: date of last edit, 2: time of last edit. */
     2636        /* translators: 1: Date of last edit, 2: Time of last edit. */
    26372637        $last_edited = sprintf( __( 'Last edited on %1$s at %2$s' ), $last_date, $last_time );
    26382638    }
     
    34853485            array(
    34863486                'type'    => 'not-embeddable',
    3487                 /* translators: %s: URL that could not be embedded */
     3487                /* translators: %s: URL that could not be embedded. */
    34883488                'message' => sprintf( __( '%s failed to embed.' ), '<code>' . esc_html( $url ) . '</code>' ),
    34893489            )
     
    42294229
    42304230    if ( $plugin_data['Version'] ) {
    4231         /* translators: %s: Plugin version */
     4231        /* translators: %s: Plugin version. */
    42324232        $status['oldVersion'] = sprintf( __( 'Version %s' ), $plugin_data['Version'] );
    42334233    }
     
    42724272
    42734273        if ( $plugin_data['Version'] ) {
    4274             /* translators: %s: Plugin version */
     4274            /* translators: %s: Plugin version. */
    42754275            $status['newVersion'] = sprintf( __( 'Version %s' ), $plugin_data['Version'] );
    42764276        }
     
    45924592        if ( ! is_array( $exporter ) ) {
    45934593            wp_send_json_error(
    4594                 /* translators: %s: exporter array index */
     4594                /* translators: %s: Exporter array index. */
    45954595                sprintf( __( 'Expected an array describing the exporter at index %s.' ), $exporter_key )
    45964596            );
     
    45984598        if ( ! array_key_exists( 'exporter_friendly_name', $exporter ) ) {
    45994599            wp_send_json_error(
    4600                 /* translators: %s: exporter array index */
     4600                /* translators: %s: Exporter array index. */
    46014601                sprintf( __( 'Exporter array at index %s does not include a friendly name.' ), $exporter_key )
    46024602            );
     
    46074607        if ( ! array_key_exists( 'callback', $exporter ) ) {
    46084608            wp_send_json_error(
    4609                 /* translators: %s: exporter friendly name */
     4609                /* translators: %s: Exporter friendly name. */
    46104610                sprintf( __( 'Exporter does not include a callback: %s.' ), esc_html( $exporter_friendly_name ) )
    46114611            );
     
    46134613        if ( ! is_callable( $exporter['callback'] ) ) {
    46144614            wp_send_json_error(
    4615                 /* translators: %s: exporter friendly name */
     4615                /* translators: %s: Exporter friendly name. */
    46164616                sprintf( __( 'Exporter callback is not a valid callback: %s.' ), esc_html( $exporter_friendly_name ) )
    46174617            );
     
    46274627        if ( ! is_array( $response ) ) {
    46284628            wp_send_json_error(
    4629                 /* translators: %s: exporter friendly name */
     4629                /* translators: %s: Exporter friendly name. */
    46304630                sprintf( __( 'Expected response as an array from exporter: %s.' ), esc_html( $exporter_friendly_name ) )
    46314631            );
     
    46334633        if ( ! array_key_exists( 'data', $response ) ) {
    46344634            wp_send_json_error(
    4635                 /* translators: %s: exporter friendly name */
     4635                /* translators: %s: Exporter friendly name. */
    46364636                sprintf( __( 'Expected data in response array from exporter: %s.' ), esc_html( $exporter_friendly_name ) )
    46374637            );
     
    46394639        if ( ! is_array( $response['data'] ) ) {
    46404640            wp_send_json_error(
    4641                 /* translators: %s: exporter friendly name */
     4641                /* translators: %s: Exporter friendly name. */
    46424642                sprintf( __( 'Expected data array in response array from exporter: %s.' ), esc_html( $exporter_friendly_name ) )
    46434643            );
     
    46454645        if ( ! array_key_exists( 'done', $response ) ) {
    46464646            wp_send_json_error(
    4647                 /* translators: %s: exporter friendly name */
     4647                /* translators: %s: Exporter friendly name. */
    46484648                sprintf( __( 'Expected done (boolean) in response array from exporter: %s.' ), esc_html( $exporter_friendly_name ) )
    46494649            );
     
    47744774
    47754775        if ( ! is_array( $eraser ) ) {
    4776             /* translators: %d: eraser array index */
     4776            /* translators: %d: Eraser array index. */
    47774777            wp_send_json_error( sprintf( __( 'Expected an array describing the eraser at index %d.' ), $eraser_index ) );
    47784778        }
    47794779
    47804780        if ( ! array_key_exists( 'eraser_friendly_name', $eraser ) ) {
    4781             /* translators: %d: eraser array index */
     4781            /* translators: %d: Eraser array index. */
    47824782            wp_send_json_error( sprintf( __( 'Eraser array at index %d does not include a friendly name.' ), $eraser_index ) );
    47834783        }
     
    47884788            wp_send_json_error(
    47894789                sprintf(
    4790                     /* translators: %s: eraser friendly name */
     4790                    /* translators: %s: Eraser friendly name. */
    47914791                    __( 'Eraser does not include a callback: %s.' ),
    47924792                    esc_html( $eraser_friendly_name )
     
    47984798            wp_send_json_error(
    47994799                sprintf(
    4800                     /* translators: %s: eraser friendly name */
     4800                    /* translators: %s: Eraser friendly name. */
    48014801                    __( 'Eraser callback is not valid: %s.' ),
    48024802                    esc_html( $eraser_friendly_name )
     
    48154815            wp_send_json_error(
    48164816                sprintf(
    4817                     /* translators: 1: eraser friendly name, 2: eraser array index */
     4817                    /* translators: 1: Eraser friendly name, 2: Eraser array index. */
    48184818                    __( 'Did not receive array from %1$s eraser (index %2$d).' ),
    48194819                    esc_html( $eraser_friendly_name ),
     
    48264826            wp_send_json_error(
    48274827                sprintf(
    4828                     /* translators: 1: eraser friendly name, 2: eraser array index */
     4828                    /* translators: 1: Eraser friendly name, 2: Eraser array index. */
    48294829                    __( 'Expected items_removed key in response array from %1$s eraser (index %2$d).' ),
    48304830                    esc_html( $eraser_friendly_name ),
     
    48374837            wp_send_json_error(
    48384838                sprintf(
    4839                     /* translators: 1: eraser friendly name, 2: eraser array index */
     4839                    /* translators: 1: Eraser friendly name, 2: Eraser array index. */
    48404840                    __( 'Expected items_retained key in response array from %1$s eraser (index %2$d).' ),
    48414841                    esc_html( $eraser_friendly_name ),
     
    48484848            wp_send_json_error(
    48494849                sprintf(
    4850                     /* translators: 1: eraser friendly name, 2: eraser array index */
     4850                    /* translators: 1: Eraser friendly name, 2: Eraser array index. */
    48514851                    __( 'Expected messages key in response array from %1$s eraser (index %2$d).' ),
    48524852                    esc_html( $eraser_friendly_name ),
     
    48594859            wp_send_json_error(
    48604860                sprintf(
    4861                     /* translators: 1: eraser friendly name, 2: eraser array index */
     4861                    /* translators: 1: Eraser friendly name, 2: Eraser array index. */
    48624862                    __( 'Expected messages key to reference an array in response array from %1$s eraser (index %2$d).' ),
    48634863                    esc_html( $eraser_friendly_name ),
     
    48704870            wp_send_json_error(
    48714871                sprintf(
    4872                     /* translators: 1: eraser friendly name, 2: eraser array index */
     4872                    /* translators: 1: Eraser friendly name, 2: Eraser array index. */
    48734873                    __( 'Expected done flag in response array from %1$s eraser (index %2$d).' ),
    48744874                    esc_html( $eraser_friendly_name ),
Note: See TracChangeset for help on using the changeset viewer.