WordPress.org

Make WordPress Core

Ticket #3997: atom-i18n.diff

File atom-i18n.diff, 4.0 KB (added by nbachiyski, 11 years ago)

Atom publishing protocol i18n fixes

  • app.php

     
    114114
    115115                        if(!xml_parse($parser, $line)) {
    116116                                log_app("xml_parse_error", "line: $line");
    117                                 $this->error = sprintf("XML error: %s at line %d\n",
     117                                $this->error = sprintf(__('XML error: %s at line %d')."\n",
    118118                                        xml_error_string(xml_get_error_code($xml_parser)),
    119119                                        xml_get_current_line_number($xml_parser));
    120120                                log_app("xml_parse_error", $this->error);
     
    585585                $postID = wp_insert_attachment($attachment, $file, $post);
    586586
    587587                if (!$postID) {
    588                         $this->internal_error('Sorry, your entry could not be posted. Something wrong happened.');
     588                        $this->internal_error(__('Sorry, your entry could not be posted. Something wrong happened.'));
    589589                }
    590590
    591591                $output = $this->get_entry($postID, 'attachment');
     
    613613                $this->escape($entry);
    614614
    615615                if(!current_user_can('edit_post', $entry['ID']))
    616                         $this->auth_required('Sorry, you do not have the right to edit this post.');
     616                        $this->auth_required(__('Sorry, you do not have the right to edit this post.'));
    617617
    618618                $publish = (isset($parsed->draft) && trim($parsed->draft) == 'yes') ? false : true;
    619619
     
    627627                $result = wp_update_post($postdata);
    628628
    629629                if (!$result) {
    630                         $this->internal_error('For some strange yet very annoying reason, this post could not be edited.');
     630                        $this->internal_error(__('For some strange yet very annoying reason, this post could not be edited.'));
    631631                }
    632632
    633633                log_app('function',"put_attachment($postID)");
     
    642642                $this->set_current_entry($postID);
    643643
    644644                if(!current_user_can('edit_post', $postID)) {
    645                         $this->auth_required('Sorry, you do not have the right to delete this post.');
     645                        $this->auth_required(__('Sorry, you do not have the right to delete this post.'));
    646646                }
    647647
    648648                $location = get_post_meta($entry['ID'], '_wp_attached_file', true);
     
    654654                $result = wp_delete_post($postID);
    655655
    656656                if (!$result) {
    657                         $this->internal_error('For some strange yet very annoying reason, this post could not be deleted.');
     657                        $this->internal_error(__('For some strange yet very annoying reason, this post could not be deleted.'));
    658658                }
    659659
    660660                log_app('function',"delete_attachment($postID). File '$location' deleted.");
     
    669669
    670670                // then whether user can edit the specific post
    671671                if(!current_user_can('edit_post', $postID)) {
    672                         $this->auth_required('Sorry, you do not have the right to edit this post.');
     672                        $this->auth_required(__('Sorry, you do not have the right to edit this post.'));
    673673                }
    674674
    675675                $location = get_post_meta($entry['ID'], '_wp_attached_file', true);
    676676
    677677                if(!isset($location))
    678                         $this->internal_error('Error ocurred while accessing post metadata for file location.');
     678                        $this->internal_error(__('Error ocurred while accessing post metadata for file location.'));
    679679
    680680                header('Content-Type: ' . $entry['post_mime_type']);
    681681
     
    695695
    696696                // first check if user can upload
    697697                if(!current_user_can('upload_files'))
    698                         $this->auth_required('You do not have permission to upload files.');
     698                        $this->auth_required(__('You do not have permission to upload files.'));
    699699
    700700                // check for not found
    701701                global $entry;
     
    703703
    704704                // then whether user can edit the specific post
    705705                if(!current_user_can('edit_post', $postID)) {
    706                         $this->auth_required('Sorry, you do not have the right to edit this post.');
     706                        $this->auth_required(__('Sorry, you do not have the right to edit this post.'));
    707707                }
    708708
    709709                $location = get_post_meta($entry['ID'], '_wp_attached_file', true);
    710710
    711711                if(!isset($location))
    712                         $this->internal_error('Error ocurred while accessing post metadata for file location.');
     712                        $this->internal_error(__('Error ocurred while accessing post metadata for file location.'));
    713713
    714714                $fp = fopen("php://input", "rb");
    715715                $localfp = fopen($location, "w+");
     
    10041004                break;
    10051005                endwhile;
    10061006                else:
    1007                         $this->auth_required("Access Denied.");
     1007                        $this->auth_required(__("Access Denied."));
    10081008                endif;
    10091009                ob_end_clean();
    10101010