WordPress.org

Make WordPress Core

Changeset 5547


Ignore:
Timestamp:
05/25/2007 03:33:47 PM (11 years ago)
Author:
rob1n
Message:

More xmlrpc.php i18n fixes from nbachiyski. fixes #3997

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-app.php

    r5286 r5547  
    416416
    417417        if(!current_user_can($cap))
    418             $this->auth_required('Sorry, you do not have the right to edit/publish new posts.');
     418            $this->auth_required(__('Sorry, you do not have the right to edit/publish new posts.'));
    419419
    420420        $blog_ID = (int ) $blog_id;
     
    434434
    435435        if (!$postID) {
    436             $this->internal_error('Sorry, your entry could not be posted. Something wrong happened.');
     436            $this->internal_error(__('Sorry, your entry could not be posted. Something wrong happened.'));
    437437        }
    438438
     
    473473
    474474        if(!current_user_can('edit_post', $entry['ID']))
    475             $this->auth_required('Sorry, you do not have the right to edit this post.');
     475            $this->auth_required(__('Sorry, you do not have the right to edit this post.'));
    476476
    477477        $publish = (isset($parsed->draft) && trim($parsed->draft) == 'yes') ? false : true;
     
    493493
    494494        if (!$result) {
    495             $this->internal_error('For some strange yet very annoying reason, this post could not be edited.');
     495            $this->internal_error(__('For some strange yet very annoying reason, this post could not be edited.'));
    496496        }
    497497
     
    507507
    508508        if(!current_user_can('edit_post', $postID)) {
    509             $this->auth_required('Sorry, you do not have the right to delete this post.');
     509            $this->auth_required(__('Sorry, you do not have the right to delete this post.'));
    510510        }
    511511
     
    516516
    517517            if (!$result) {
    518                 $this->internal_error('For some strange yet very annoying reason, this post could not be deleted.');
     518                $this->internal_error(__('For some strange yet very annoying reason, this post could not be deleted.'));
    519519            }
    520520
     
    544544
    545545        if(!current_user_can('upload_files'))
    546             $this->auth_required('You do not have permission to upload files.');
     546            $this->auth_required(__('You do not have permission to upload files.'));
    547547
    548548        $fp = fopen("php://input", "rb");
  • trunk/xmlrpc.php

    r5542 r5547  
    971971                case "post":
    972972                    if(!current_user_can("edit_others_posts")) {
    973                         return(new IXR_Error(401, "You are not allowed to " .
    974                             "post as this user"));
     973                        return(new IXR_Error(401, __("You are not allowed to post as this user")));
    975974                    }
    976975                    break;
    977976                case "page":
    978977                    if(!current_user_can("edit_others_pages")) {
    979                         return(new IXR_Error(401, "You are not allowed to " .
    980                             "create pages as this user"));
     978                        return(new IXR_Error(401, __("You are not allowed to create pages as this user")));
    981979                    }
    982980                    break;
     
    11571155                case "post":
    11581156                    if(!current_user_can("edit_others_posts")) {
    1159                         return(new IXR_Error(401, "You are not allowed to " .
    1160                             "change the post author as this user."));
     1157                        return(new IXR_Error(401, __("You are not allowed to change the post author as this user.")));
    11611158                    }
    11621159                    break;
    11631160                case "page":
    11641161                    if(!current_user_can("edit_others_pages")) {
    1165                         return(new IXR_Error(401, "You are not allowed to " .
    1166                             "change the page author as this user."));
     1162                        return(new IXR_Error(401, __("You are not allowed to change the page author as this user.")));
    11671163                    }
    11681164                    break;
     
    14681464        $upload = wp_upload_bits($name, $type, $bits, $overwrite);
    14691465        if ( ! empty($upload['error']) ) {
    1470             $errorString = 'Could not write file ' . $name . ' (' . $upload['error'] . ')';
     1466            $errorString = sprintf(__('Could not write file %1$s (%2$s)'), $name, $upload['error']);
    14711467            logIO('O', '(MW) ' . $errorString);
    14721468            return new IXR_Error(500, $errorString);
     
    17791775        } else {
    17801776            // TODO: Attempt to extract a post ID from the given URL
    1781             return new IXR_Error(33, 'The specified target URL cannot be used as a target. It either doesn\'t exist, or it is not a pingback-enabled resource.');
     1777            return new IXR_Error(33, __('The specified target URL cannot be used as a target. It either doesn\'t exist, or it is not a pingback-enabled resource.'));
    17821778        }
    17831779        $post_ID = (int) $post_ID;
     
    17891785
    17901786        if ( !$post ) // Post_ID not found
    1791             return new IXR_Error(33, 'The specified target URL cannot be used as a target. It either doesn\'t exist, or it is not a pingback-enabled resource.');
     1787            return new IXR_Error(33, __('The specified target URL cannot be used as a target. It either doesn\'t exist, or it is not a pingback-enabled resource.'));
    17921788
    17931789        if ( $post_ID == url_to_postid($pagelinkedfrom) )
     
    17961792        // Check if pings are on
    17971793        if ( 'closed' == $post->ping_status )
    1798             return new IXR_Error(33, 'The specified target URL cannot be used as a target. It either doesn\'t exist, or it is not a pingback-enabled resource.');
     1794            return new IXR_Error(33, __('The specified target URL cannot be used as a target. It either doesn\'t exist, or it is not a pingback-enabled resource.'));
    17991795
    18001796        // Let's check that the remote site didn't already pingback this entry
     
    18781874        do_action('pingback_post', $comment_ID);
    18791875
    1880         return "Pingback from $pagelinkedfrom to $pagelinkedto registered. Keep the web talking! :-)";
     1876        return sprintf(__('Pingback from %1$s to %2$s registered. Keep the web talking! :-)'), $pagelinkedfrom, $pagelinkedto);
    18811877    }
    18821878
     
    18961892        if (!$post_ID) {
    18971893            // We aren't sure that the resource is available and/or pingback enabled
    1898             return new IXR_Error(33, 'The specified target URL cannot be used as a target. It either doesn\'t exist, or it is not a pingback-enabled resource.');
     1894            return new IXR_Error(33, __('The specified target URL cannot be used as a target. It either doesn\'t exist, or it is not a pingback-enabled resource.'));
    18991895        }
    19001896
Note: See TracChangeset for help on using the changeset viewer.