Make WordPress Core

Changeset 39278


Ignore:
Timestamp:
11/17/2016 03:52:18 PM (8 years ago)
Author:
SergeyBiryukov
Message:

Text Changes: Merge some duplicate strings with the same meaning in error messages, adjust some other strings for consistency and accuracy.

Props ramiy, SergeyBiryukov.
Fixes #38808.

Location:
trunk/src
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/post.php

    r39062 r39278  
    161161        $valid_date = wp_checkdate( $mm, $jj, $aa, $post_data['post_date'] );
    162162        if ( !$valid_date ) {
    163             return new WP_Error( 'invalid_date', __( 'Whoops, the provided date is invalid.' ) );
     163            return new WP_Error( 'invalid_date', __( 'Invalid date.' ) );
    164164        }
    165165        $post_data['post_date_gmt'] = get_gmt_from_date( $post_data['post_date'] );
  • trunk/src/wp-includes/class-wp-xmlrpc-server.php

    r39045 r39278  
    12711271        } elseif ( isset( $post_data['sticky'] ) )  {
    12721272            if ( ! current_user_can( $post_type->cap->edit_others_posts ) ) {
    1273                 return new IXR_Error( 401, __( 'Sorry, you are not allowed to stick this post.' ) );
     1273                return new IXR_Error( 401, __( 'Sorry, you are not allowed to make posts sticky.' ) );
    12741274            }
    12751275
     
    17961796
    17971797        if ( ! current_user_can( $post_type->cap->edit_posts ) )
    1798             return new IXR_Error( 401, __( 'Sorry, you are not allowed to edit posts in this post type.' ));
     1798            return new IXR_Error( 401, __( 'Sorry, you are not allowed to edit posts in this post type.' ) );
    17991799
    18001800        $query['post_type'] = $post_type->name;
     
    41184118
    41194119        if ( ! current_user_can( $post_type->cap->edit_posts ) )
    4120             return new IXR_Error( 401, __( 'Sorry, you are not allowed to edit this post type.' ) );
     4120            return new IXR_Error( 401, __( 'Sorry, you are not allowed to edit posts in this post type.' ) );
    41214121
    41224122        return $this->_prepare_post_type( $post_type, $fields );
  • trunk/src/wp-includes/post.php

    r39188 r39278  
    31243124    if ( ! $valid_date ) {
    31253125        if ( $wp_error ) {
    3126             return new WP_Error( 'invalid_date', __( 'Whoops, the provided date is invalid.' ) );
     3126            return new WP_Error( 'invalid_date', __( 'Invalid date.' ) );
    31273127        } else {
    31283128            return 0;
     
    34043404        if ( 'default' != $postarr['page_template'] && ! isset( $page_templates[ $postarr['page_template'] ] ) ) {
    34053405            if ( $wp_error ) {
    3406                 return new WP_Error('invalid_page_template', __('The page template is invalid.'));
     3406                return new WP_Error( 'invalid_page_template', __( 'Invalid page template.' ) );
    34073407            }
    34083408            update_post_meta( $post_ID, '_wp_page_template', 'default' );
  • trunk/src/wp-includes/rest-api.php

    r39239 r39278  
    10411041            case 'date-time' :
    10421042                if ( ! rest_parse_date( $value ) ) {
    1043                     return new WP_Error( 'rest_invalid_date', __( 'The date you provided is invalid.' ) );
     1043                    return new WP_Error( 'rest_invalid_date', __( 'Invalid date.' ) );
    10441044                }
    10451045                break;
     
    10511051                // https://core.trac.wordpress.org/ticket/38506
    10521052                if ( ! is_email( $value ) || strlen( $value ) < 6 ) {
    1053                     return new WP_Error( 'rest_invalid_email', __( 'The email address you provided is invalid.' ) );
     1053                    return new WP_Error( 'rest_invalid_email', __( 'Invalid email address.' ) );
    10541054                }
    10551055                break;
  • trunk/src/wp-includes/rest-api/class-wp-rest-server.php

    r39104 r39278  
    286286            $jsonp_callback = $_GET['_jsonp'];
    287287            if ( ! wp_check_jsonp_callback( $jsonp_callback ) ) {
    288                 echo $this->json_error( 'rest_callback_invalid', __( 'The JSONP callback function is invalid.' ), 400 );
     288                echo $this->json_error( 'rest_callback_invalid', __( 'Invalid JSONP callback function.' ), 400 );
    289289                return false;
    290290            }
  • trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-comments-controller.php

    r39266 r39278  
    436436         */
    437437        if ( empty( $prepared_comment['comment_content'] ) ) {
    438             return new WP_Error( 'rest_comment_content_invalid', __( 'Comment content is invalid.' ), array( 'status' => 400 ) );
     438            return new WP_Error( 'rest_comment_content_invalid', __( 'Invalid comment content.' ), array( 'status' => 400 ) );
    439439        }
    440440
     
    638638
    639639            if ( isset( $prepared_args['comment_content'] ) && empty( $prepared_args['comment_content'] ) ) {
    640                 return new WP_Error( 'rest_comment_content_invalid', __( 'Comment content is invalid.' ), array( 'status' => 400 ) );
     640                return new WP_Error( 'rest_comment_content_invalid', __( 'Invalid comment content.' ), array( 'status' => 400 ) );
    641641            }
    642642
  • trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php

    r39266 r39278  
    127127
    128128        if ( 'edit' === $request['context'] && ! current_user_can( $post_type->cap->edit_posts ) ) {
    129             return new WP_Error( 'rest_forbidden_context', __( 'Sorry, you are not allowed to edit these posts in this post type.' ), array( 'status' => rest_authorization_required_code() ) );
     129            return new WP_Error( 'rest_forbidden_context', __( 'Sorry, you are not allowed to edit posts in this post type.' ), array( 'status' => rest_authorization_required_code() ) );
    130130        }
    131131
     
    459459
    460460        if ( ! current_user_can( $post_type->cap->create_posts ) ) {
    461             return new WP_Error( 'rest_cannot_create', __( 'Sorry, you are not allowed to create new posts.' ), array( 'status' => rest_authorization_required_code() ) );
     461            return new WP_Error( 'rest_cannot_create', __( 'Sorry, you are not allowed to create posts as this user.' ), array( 'status' => rest_authorization_required_code() ) );
    462462        }
    463463
     
    709709
    710710        if ( $post && ! $this->check_delete_permission( $post ) ) {
    711             return new WP_Error( 'rest_cannot_delete', __( 'Sorry, you are not allowed to delete posts.' ), array( 'status' => rest_authorization_required_code() ) );
     711            return new WP_Error( 'rest_cannot_delete', __( 'Sorry, you are not allowed to delete this post.' ), array( 'status' => rest_authorization_required_code() ) );
    712712        }
    713713
  • trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-terms-controller.php

    r39266 r39278  
    547547
    548548        if ( ! current_user_can( 'delete_term', $term->term_id ) ) {
    549             return new WP_Error( 'rest_cannot_delete', __( 'Sorry, you are not allowed to delete resource.' ), array( 'status' => rest_authorization_required_code() ) );
     549            return new WP_Error( 'rest_cannot_delete', __( 'Sorry, you are not allowed to delete this resource.' ), array( 'status' => rest_authorization_required_code() ) );
    550550        }
    551551
     
    824824                ),
    825825                'link'        => array(
    826                     'description'  => __( 'URL to the resource.' ),
     826                    'description'  => __( 'URL of the resource.' ),
    827827                    'type'         => 'string',
    828828                    'format'       => 'uri',
  • trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php

    r39266 r39278  
    388388
    389389        if ( ! current_user_can( 'create_users' ) ) {
    390             return new WP_Error( 'rest_cannot_create_user', __( 'Sorry, you are not allowed to create resource.' ), array( 'status' => rest_authorization_required_code() ) );
     390            return new WP_Error( 'rest_cannot_create_user', __( 'Sorry, you are not allowed to create new resource.' ), array( 'status' => rest_authorization_required_code() ) );
    391391        }
    392392
     
    544544
    545545        if ( email_exists( $request['email'] ) && $request['email'] !== $user->user_email ) {
    546             return new WP_Error( 'rest_user_invalid_email', __( 'Email address is invalid.' ), array( 'status' => 400 ) );
     546            return new WP_Error( 'rest_user_invalid_email', __( 'Invalid email address.' ), array( 'status' => 400 ) );
    547547        }
    548548
     
    552552
    553553        if ( ! empty( $request['slug'] ) && $request['slug'] !== $user->user_nicename && get_user_by( 'slug', $request['slug'] ) ) {
    554             return new WP_Error( 'rest_user_invalid_slug', __( 'Slug is invalid.' ), array( 'status' => 400 ) );
     554            return new WP_Error( 'rest_user_invalid_slug', __( 'Invalid slug.' ), array( 'status' => 400 ) );
    555555        }
    556556
     
    11401140                ),
    11411141                'link'        => array(
    1142                     'description' => __( 'Author URL to the resource.' ),
     1142                    'description' => __( 'Author URL of the resource.' ),
    11431143                    'type'        => 'string',
    11441144                    'format'      => 'uri',
  • trunk/src/wp-includes/script-loader.php

    r39272 r39278  
    232232    // Strings for 'jquery-ui-autocomplete' live region messages
    233233    did_action( 'init' ) && $scripts->localize( 'jquery-ui-autocomplete', 'uiAutocompleteL10n', array(
    234         'noResults' => __( 'No search results.' ),
     234        'noResults' => __( 'No results found.' ),
    235235        /* translators: Number of results found when using jQuery UI Autocomplete */
    236236        'oneResult' => __( '1 result found. Use up and down arrow keys to navigate.' ),
Note: See TracChangeset for help on using the changeset viewer.