Ticket #3997: atom-i18n.diff
| File atom-i18n.diff, 4.0 KB (added by , 19 years ago) |
|---|
-
app.php
114 114 115 115 if(!xml_parse($parser, $line)) { 116 116 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", 118 118 xml_error_string(xml_get_error_code($xml_parser)), 119 119 xml_get_current_line_number($xml_parser)); 120 120 log_app("xml_parse_error", $this->error); … … 585 585 $postID = wp_insert_attachment($attachment, $file, $post); 586 586 587 587 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.')); 589 589 } 590 590 591 591 $output = $this->get_entry($postID, 'attachment'); … … 613 613 $this->escape($entry); 614 614 615 615 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.')); 617 617 618 618 $publish = (isset($parsed->draft) && trim($parsed->draft) == 'yes') ? false : true; 619 619 … … 627 627 $result = wp_update_post($postdata); 628 628 629 629 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.')); 631 631 } 632 632 633 633 log_app('function',"put_attachment($postID)"); … … 642 642 $this->set_current_entry($postID); 643 643 644 644 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.')); 646 646 } 647 647 648 648 $location = get_post_meta($entry['ID'], '_wp_attached_file', true); … … 654 654 $result = wp_delete_post($postID); 655 655 656 656 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.')); 658 658 } 659 659 660 660 log_app('function',"delete_attachment($postID). File '$location' deleted."); … … 669 669 670 670 // then whether user can edit the specific post 671 671 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.')); 673 673 } 674 674 675 675 $location = get_post_meta($entry['ID'], '_wp_attached_file', true); 676 676 677 677 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.')); 679 679 680 680 header('Content-Type: ' . $entry['post_mime_type']); 681 681 … … 695 695 696 696 // first check if user can upload 697 697 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.')); 699 699 700 700 // check for not found 701 701 global $entry; … … 703 703 704 704 // then whether user can edit the specific post 705 705 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.')); 707 707 } 708 708 709 709 $location = get_post_meta($entry['ID'], '_wp_attached_file', true); 710 710 711 711 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.')); 713 713 714 714 $fp = fopen("php://input", "rb"); 715 715 $localfp = fopen($location, "w+"); … … 1004 1004 break; 1005 1005 endwhile; 1006 1006 else: 1007 $this->auth_required( "Access Denied.");1007 $this->auth_required(__("Access Denied.")); 1008 1008 endif; 1009 1009 ob_end_clean(); 1010 1010