From acc30b09d7daa44b6efb88c955c7949551fbe7b7 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Thu, 17 Nov 2016 15:53:33 +0000 Subject: [PATCH] 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. Built from https://develop.svn.wordpress.org/trunk@39278 git-svn-id: http://core.svn.wordpress.org/trunk@39218 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/post.php | 2 +- wp-includes/class-wp-xmlrpc-server.php | 6 +++--- wp-includes/post.php | 4 ++-- wp-includes/rest-api.php | 4 ++-- wp-includes/rest-api/class-wp-rest-server.php | 2 +- .../endpoints/class-wp-rest-comments-controller.php | 4 ++-- .../rest-api/endpoints/class-wp-rest-posts-controller.php | 6 +++--- .../rest-api/endpoints/class-wp-rest-terms-controller.php | 4 ++-- .../rest-api/endpoints/class-wp-rest-users-controller.php | 8 ++++---- wp-includes/script-loader.php | 2 +- wp-includes/version.php | 2 +- 11 files changed, 22 insertions(+), 22 deletions(-) diff --git a/wp-admin/includes/post.php b/wp-admin/includes/post.php index d614450ed6..9505227fb5 100644 --- a/wp-admin/includes/post.php +++ b/wp-admin/includes/post.php @@ -160,7 +160,7 @@ function _wp_translate_postdata( $update = false, $post_data = null ) { $post_data['post_date'] = sprintf( "%04d-%02d-%02d %02d:%02d:%02d", $aa, $mm, $jj, $hh, $mn, $ss ); $valid_date = wp_checkdate( $mm, $jj, $aa, $post_data['post_date'] ); if ( !$valid_date ) { - return new WP_Error( 'invalid_date', __( 'Whoops, the provided date is invalid.' ) ); + return new WP_Error( 'invalid_date', __( 'Invalid date.' ) ); } $post_data['post_date_gmt'] = get_gmt_from_date( $post_data['post_date'] ); } diff --git a/wp-includes/class-wp-xmlrpc-server.php b/wp-includes/class-wp-xmlrpc-server.php index 7bc370e31a..cf676c1c6d 100644 --- a/wp-includes/class-wp-xmlrpc-server.php +++ b/wp-includes/class-wp-xmlrpc-server.php @@ -1270,7 +1270,7 @@ class wp_xmlrpc_server extends IXR_Server { } } elseif ( isset( $post_data['sticky'] ) ) { if ( ! current_user_can( $post_type->cap->edit_others_posts ) ) { - return new IXR_Error( 401, __( 'Sorry, you are not allowed to stick this post.' ) ); + return new IXR_Error( 401, __( 'Sorry, you are not allowed to make posts sticky.' ) ); } $sticky = wp_validate_boolean( $post_data['sticky'] ); @@ -1795,7 +1795,7 @@ class wp_xmlrpc_server extends IXR_Server { } if ( ! current_user_can( $post_type->cap->edit_posts ) ) - return new IXR_Error( 401, __( 'Sorry, you are not allowed to edit posts in this post type.' )); + return new IXR_Error( 401, __( 'Sorry, you are not allowed to edit posts in this post type.' ) ); $query['post_type'] = $post_type->name; @@ -4117,7 +4117,7 @@ class wp_xmlrpc_server extends IXR_Server { $post_type = get_post_type_object( $post_type_name ); if ( ! current_user_can( $post_type->cap->edit_posts ) ) - return new IXR_Error( 401, __( 'Sorry, you are not allowed to edit this post type.' ) ); + return new IXR_Error( 401, __( 'Sorry, you are not allowed to edit posts in this post type.' ) ); return $this->_prepare_post_type( $post_type, $fields ); } diff --git a/wp-includes/post.php b/wp-includes/post.php index 9e20aa0612..d3c68ca89b 100644 --- a/wp-includes/post.php +++ b/wp-includes/post.php @@ -3123,7 +3123,7 @@ function wp_insert_post( $postarr, $wp_error = false ) { $valid_date = wp_checkdate( $mm, $jj, $aa, $post_date ); if ( ! $valid_date ) { if ( $wp_error ) { - return new WP_Error( 'invalid_date', __( 'Whoops, the provided date is invalid.' ) ); + return new WP_Error( 'invalid_date', __( 'Invalid date.' ) ); } else { return 0; } @@ -3403,7 +3403,7 @@ function wp_insert_post( $postarr, $wp_error = false ) { $page_templates = wp_get_theme()->get_page_templates( $post ); if ( 'default' != $postarr['page_template'] && ! isset( $page_templates[ $postarr['page_template'] ] ) ) { if ( $wp_error ) { - return new WP_Error('invalid_page_template', __('The page template is invalid.')); + return new WP_Error( 'invalid_page_template', __( 'Invalid page template.' ) ); } update_post_meta( $post_ID, '_wp_page_template', 'default' ); } else { diff --git a/wp-includes/rest-api.php b/wp-includes/rest-api.php index 255b8dc596..741e76837f 100644 --- a/wp-includes/rest-api.php +++ b/wp-includes/rest-api.php @@ -1040,7 +1040,7 @@ function rest_validate_value_from_schema( $value, $args, $param = '' ) { switch ( $args['format'] ) { case 'date-time' : if ( ! rest_parse_date( $value ) ) { - return new WP_Error( 'rest_invalid_date', __( 'The date you provided is invalid.' ) ); + return new WP_Error( 'rest_invalid_date', __( 'Invalid date.' ) ); } break; @@ -1050,7 +1050,7 @@ function rest_validate_value_from_schema( $value, $args, $param = '' ) { // // https://core.trac.wordpress.org/ticket/38506 if ( ! is_email( $value ) || strlen( $value ) < 6 ) { - return new WP_Error( 'rest_invalid_email', __( 'The email address you provided is invalid.' ) ); + return new WP_Error( 'rest_invalid_email', __( 'Invalid email address.' ) ); } break; case 'ipv4' : diff --git a/wp-includes/rest-api/class-wp-rest-server.php b/wp-includes/rest-api/class-wp-rest-server.php index 76f8b3fe02..ec8d2a0baf 100644 --- a/wp-includes/rest-api/class-wp-rest-server.php +++ b/wp-includes/rest-api/class-wp-rest-server.php @@ -285,7 +285,7 @@ class WP_REST_Server { $jsonp_callback = $_GET['_jsonp']; if ( ! wp_check_jsonp_callback( $jsonp_callback ) ) { - echo $this->json_error( 'rest_callback_invalid', __( 'The JSONP callback function is invalid.' ), 400 ); + echo $this->json_error( 'rest_callback_invalid', __( 'Invalid JSONP callback function.' ), 400 ); return false; } } diff --git a/wp-includes/rest-api/endpoints/class-wp-rest-comments-controller.php b/wp-includes/rest-api/endpoints/class-wp-rest-comments-controller.php index 15e18f7494..3ec49867ce 100644 --- a/wp-includes/rest-api/endpoints/class-wp-rest-comments-controller.php +++ b/wp-includes/rest-api/endpoints/class-wp-rest-comments-controller.php @@ -435,7 +435,7 @@ class WP_REST_Comments_Controller extends WP_REST_Controller { * comment_content. See wp_handle_comment_submission(). */ if ( empty( $prepared_comment['comment_content'] ) ) { - return new WP_Error( 'rest_comment_content_invalid', __( 'Comment content is invalid.' ), array( 'status' => 400 ) ); + return new WP_Error( 'rest_comment_content_invalid', __( 'Invalid comment content.' ), array( 'status' => 400 ) ); } // Setting remaining values before wp_insert_comment so we can use wp_allow_comment(). @@ -637,7 +637,7 @@ class WP_REST_Comments_Controller extends WP_REST_Controller { } if ( isset( $prepared_args['comment_content'] ) && empty( $prepared_args['comment_content'] ) ) { - return new WP_Error( 'rest_comment_content_invalid', __( 'Comment content is invalid.' ), array( 'status' => 400 ) ); + return new WP_Error( 'rest_comment_content_invalid', __( 'Invalid comment content.' ), array( 'status' => 400 ) ); } $prepared_args['comment_ID'] = $id; diff --git a/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php b/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php index 9be46ca80d..f4c4cc7879 100644 --- a/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php +++ b/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php @@ -126,7 +126,7 @@ class WP_REST_Posts_Controller extends WP_REST_Controller { $post_type = get_post_type_object( $this->post_type ); if ( 'edit' === $request['context'] && ! current_user_can( $post_type->cap->edit_posts ) ) { - 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() ) ); + 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() ) ); } return true; @@ -458,7 +458,7 @@ class WP_REST_Posts_Controller extends WP_REST_Controller { } if ( ! current_user_can( $post_type->cap->create_posts ) ) { - return new WP_Error( 'rest_cannot_create', __( 'Sorry, you are not allowed to create new posts.' ), array( 'status' => rest_authorization_required_code() ) ); + return new WP_Error( 'rest_cannot_create', __( 'Sorry, you are not allowed to create posts as this user.' ), array( 'status' => rest_authorization_required_code() ) ); } if ( ! $this->check_assign_terms_permission( $request ) ) { @@ -708,7 +708,7 @@ class WP_REST_Posts_Controller extends WP_REST_Controller { $post = get_post( $request['id'] ); if ( $post && ! $this->check_delete_permission( $post ) ) { - return new WP_Error( 'rest_cannot_delete', __( 'Sorry, you are not allowed to delete posts.' ), array( 'status' => rest_authorization_required_code() ) ); + return new WP_Error( 'rest_cannot_delete', __( 'Sorry, you are not allowed to delete this post.' ), array( 'status' => rest_authorization_required_code() ) ); } return true; diff --git a/wp-includes/rest-api/endpoints/class-wp-rest-terms-controller.php b/wp-includes/rest-api/endpoints/class-wp-rest-terms-controller.php index 09fbab5b12..4c25ab68b8 100644 --- a/wp-includes/rest-api/endpoints/class-wp-rest-terms-controller.php +++ b/wp-includes/rest-api/endpoints/class-wp-rest-terms-controller.php @@ -546,7 +546,7 @@ class WP_REST_Terms_Controller extends WP_REST_Controller { } if ( ! current_user_can( 'delete_term', $term->term_id ) ) { - return new WP_Error( 'rest_cannot_delete', __( 'Sorry, you are not allowed to delete resource.' ), array( 'status' => rest_authorization_required_code() ) ); + return new WP_Error( 'rest_cannot_delete', __( 'Sorry, you are not allowed to delete this resource.' ), array( 'status' => rest_authorization_required_code() ) ); } return true; @@ -823,7 +823,7 @@ class WP_REST_Terms_Controller extends WP_REST_Controller { 'context' => array( 'view', 'edit' ), ), 'link' => array( - 'description' => __( 'URL to the resource.' ), + 'description' => __( 'URL of the resource.' ), 'type' => 'string', 'format' => 'uri', 'context' => array( 'view', 'embed', 'edit' ), diff --git a/wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php b/wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php index 3d0fc2c0a7..9fdfeaf6a7 100644 --- a/wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php +++ b/wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php @@ -387,7 +387,7 @@ class WP_REST_Users_Controller extends WP_REST_Controller { public function create_item_permissions_check( $request ) { if ( ! current_user_can( 'create_users' ) ) { - return new WP_Error( 'rest_cannot_create_user', __( 'Sorry, you are not allowed to create resource.' ), array( 'status' => rest_authorization_required_code() ) ); + return new WP_Error( 'rest_cannot_create_user', __( 'Sorry, you are not allowed to create new resource.' ), array( 'status' => rest_authorization_required_code() ) ); } return true; @@ -543,7 +543,7 @@ class WP_REST_Users_Controller extends WP_REST_Controller { } if ( email_exists( $request['email'] ) && $request['email'] !== $user->user_email ) { - return new WP_Error( 'rest_user_invalid_email', __( 'Email address is invalid.' ), array( 'status' => 400 ) ); + return new WP_Error( 'rest_user_invalid_email', __( 'Invalid email address.' ), array( 'status' => 400 ) ); } if ( ! empty( $request['username'] ) && $request['username'] !== $user->user_login ) { @@ -551,7 +551,7 @@ class WP_REST_Users_Controller extends WP_REST_Controller { } if ( ! empty( $request['slug'] ) && $request['slug'] !== $user->user_nicename && get_user_by( 'slug', $request['slug'] ) ) { - return new WP_Error( 'rest_user_invalid_slug', __( 'Slug is invalid.' ), array( 'status' => 400 ) ); + return new WP_Error( 'rest_user_invalid_slug', __( 'Invalid slug.' ), array( 'status' => 400 ) ); } if ( ! empty( $request['roles'] ) ) { @@ -1139,7 +1139,7 @@ class WP_REST_Users_Controller extends WP_REST_Controller { 'context' => array( 'embed', 'view', 'edit' ), ), 'link' => array( - 'description' => __( 'Author URL to the resource.' ), + 'description' => __( 'Author URL of the resource.' ), 'type' => 'string', 'format' => 'uri', 'context' => array( 'embed', 'view', 'edit' ), diff --git a/wp-includes/script-loader.php b/wp-includes/script-loader.php index e405b13134..cda14254aa 100644 --- a/wp-includes/script-loader.php +++ b/wp-includes/script-loader.php @@ -231,7 +231,7 @@ function wp_default_scripts( &$scripts ) { // Strings for 'jquery-ui-autocomplete' live region messages did_action( 'init' ) && $scripts->localize( 'jquery-ui-autocomplete', 'uiAutocompleteL10n', array( - 'noResults' => __( 'No search results.' ), + 'noResults' => __( 'No results found.' ), /* translators: Number of results found when using jQuery UI Autocomplete */ 'oneResult' => __( '1 result found. Use up and down arrow keys to navigate.' ), /* translators: %d: Number of results found when using jQuery UI Autocomplete */ diff --git a/wp-includes/version.php b/wp-includes/version.php index e8461bbbc0..a28708d5de 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.7-beta4-39277'; +$wp_version = '4.7-beta4-39278'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.