Make WordPress Core


Ignore:
Timestamp:
03/25/2005 09:41:45 PM (19 years ago)
Author:
ryan
Message:

Localize email messages. http://mosquito.wordpress.org/view.php?id=1168 Props: slebog

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/comment-functions.php

    r2414 r2477  
    632632   
    633633    if ('comment' == $comment_type) {
    634         $notify_message  = "New comment on your post #$comment->comment_post_ID \"".$post->post_title."\"\r\n\r\n";
    635         $notify_message .= "Author : $comment->comment_author (IP: $comment->comment_author_IP , $comment_author_domain)\r\n";
    636         $notify_message .= "E-mail : $comment->comment_author_email\r\n";
    637         $notify_message .= "URI    : $comment->comment_author_url\r\n";
    638         $notify_message .= "Whois  : http://ws.arin.net/cgi-bin/whois.pl?queryinput=$comment->comment_author_IP\r\n";
    639         $notify_message .= "Comment:\r\n $comment->comment_content \r\n\r\n";
    640         $notify_message .= "You can see all comments on this post here: \r\n";
    641         $subject = '[' . $blogname . '] Comment: "' .$post->post_title.'"';
     634        $notify_message  = sprintf( __('New comment on your post #%1$s "%2$s"'), $comment->comment_post_ID, $post->post_title ) . "\r\n";
     635        $notify_message .= sprintf( __('Author : %1$s (IP: %2$s , %3$s)'), $comment->comment_author, $comment->comment_author_IP, $comment_author_domain ) . "\r\n";
     636        $notify_message .= sprintf( __('E-mail : %s'), $comment->comment_author_email ) . "\r\n";
     637        $notify_message .= sprintf( __('URI    : %s'), $comment->comment_author_url ) . "\r\n";
     638        $notify_message .= sprintf( __('Whois  : http://ws.arin.net/cgi-bin/whois.pl?queryinput=%s'), $comment->comment_author_IP ) . "\r\n";
     639        $notify_message .= __('Comment: ') . "\r\n" . $comment->comment_content . "\r\n\r\n";
     640        $notify_message .= __('You can see all comments on this post here: ') . "\r\n";
     641        $subject = sprintf( __('[%1$s] Comment: "%2$s"'), $blogname, $post->post_title );
    642642    } elseif ('trackback' == $comment_type) {
    643         $notify_message  = "New trackback on your post #$comment_post_ID \"".$post->post_title."\"\r\n\r\n";
    644         $notify_message .= "Website: $comment->comment_author (IP: $comment->comment_author_IP , $comment_author_domain)\r\n";
    645         $notify_message .= "URI    : $comment->comment_author_url\r\n";
    646         $notify_message .= "Excerpt: \n $comment->comment_content \r\n\r\n";
    647         $notify_message .= "You can see all trackbacks on this post here: \r\n";
    648         $subject = '[' . $blogname . '] Trackback: "' .$post->post_title.'"';
     643        $notify_message  = sprintf( __('New trackback on your post #%1$s "%2$s"'), $comment->comment_post_ID, $post->post_title ) . "\r\n";
     644        $notify_message .= sprintf( __('Website: %1$s (IP: %2$s , %3$s)'), $comment->comment_author, $comment->comment_author_IP, $comment_author_domain ) . "\r\n";
     645        $notify_message .= sprintf( __('URI    : %s'), $comment->comment_author_url ) . "\r\n";
     646        $notify_message .= __('Excerpt: ') . "\r\n" . $comment->comment_content . "\r\n\r\n";
     647        $notify_message .= __('You can see all trackbacks on this post here: ') . "\r\n";
     648        $subject = sprintf( __('[%1$s] Trackback: "%2$s"'), $blogname, $post->post_title );
    649649    } elseif ('pingback' == $comment_type) {
    650         $notify_message  = "New pingback on your post #$comment_post_ID \"".$post->post_title."\"\r\n\r\n";
    651         $notify_message .= "Website: $comment->comment_author\r\n";
    652         $notify_message .= "URI    : $comment->comment_author_url\r\n";
    653         $notify_message .= "Excerpt: \n[...] $comment->comment_content [...]\r\n\r\n";
    654         $notify_message .= "You can see all pingbacks on this post here: \r\n";
    655         $subject = '[' . $blogname . '] Pingback: "' .$post->post_title.'"';
    656     }
    657     $notify_message .= get_permalink($comment->comment_post_ID) . '#comments';
    658     $notify_message .= "\r\n\r\nTo delete this comment:\r\n" . get_settings('siteurl') . "/wp-admin/post.php?action=confirmdeletecomment&p=".$comment->comment_post_ID."&comment=$comment_id";
     650        $notify_message  = sprintf( __('New pingback on your post #%1$s "%2$s"'), $comment->comment_post_ID, $post->post_title ) . "\r\n";
     651        $notify_message .= sprintf( __('Website: %1$s (IP: %2$s , %3$s)'), $comment->comment_author, $comment->comment_author_IP, $comment_author_domain ) . "\r\n";
     652        $notify_message .= sprintf( __('URI    : %s'), $comment->comment_author_url ) . "\r\n";
     653        $notify_message .= __('Excerpt: ') . "\r\n" . sprintf( __('[...] %s [...]'), $comment->comment_content ) . "\r\n\r\n";
     654        $notify_message .= __('You can see all pingbacks on this post here: ') . "\r\n";
     655        $subject = sprintf( __('[%1$s] Pingback: "%2$s"'), $blogname, $post->post_title );
     656    }
     657    $notify_message .= get_permalink($comment->comment_post_ID) . "#comments\r\n\r\n";
     658    $notify_message .= sprintf( __('To delete this comment, visit: %s'), get_settings('siteurl').'/wp-admin/post.php?action=confirmdeletecomment&p='.$comment->comment_post_ID."&comment=$comment_id" ) . "\r\n";
    659659
    660660    if ('' == $comment->comment_author_email || '' == $comment->comment_author) {
     
    664664    }
    665665
    666     $message_headers = "MIME-Version: 1.0\n"
    667         . "$from\n"
    668         . "Content-Type: text/plain; charset=\"" . get_settings('blog_charset') . "\"\n";
     666    $message_headers = "MIME-Version: 1.0\r\n"
     667        . "$from\r\n"
     668        . "Content-Type: text/plain; charset=\"" . get_settings('blog_charset') . "\"\r\n";
    669669
    670670    @wp_mail($user->user_email, $subject, $notify_message, $message_headers);
     
    693693    $comments_waiting = $wpdb->get_var("SELECT count(comment_ID) FROM $wpdb->comments WHERE comment_approved = '0'");
    694694
    695     $notify_message  = "A new comment on the post #$post->ID \"$post->post_title\" is waiting for your approval\r\n";
    696     $notify_message .= get_permalink($comment->comment_post_ID);
    697     $notify_message .= "\n\nAuthor : $comment->comment_author (IP: $comment->comment_author_IP , $comment_author_domain)\r\n";
    698     $notify_message .= "E-mail : $comment->comment_author_email\r\n";
    699     $notify_message .= "URL    : $comment->comment_author_url\r\n";
    700     $notify_message .= "Whois  : http://ws.arin.net/cgi-bin/whois.pl?queryinput=$comment->comment_author_IP\r\n";
    701     $notify_message .= "Comment:\r\n".$comment->comment_content."\r\n\r\n";
    702     $notify_message .= "To approve this comment, visit: " . get_settings('siteurl') . "/wp-admin/post.php?action=mailapprovecomment&p=".$comment->comment_post_ID."&comment=$comment_id\r\n";
    703     $notify_message .= "To delete this comment, visit: " . get_settings('siteurl') . "/wp-admin/post.php?action=confirmdeletecomment&p=".$comment->comment_post_ID."&comment=$comment_id\r\n";
    704     $notify_message .= "Currently $comments_waiting comments are waiting for approval. Please visit the moderation panel:\r\n";
    705     $notify_message .= get_settings('siteurl') . "/wp-admin/moderation.php\r\n";
    706 
    707     $subject = '[' . get_settings('blogname') . '] Please moderate: "' .$post->post_title.'"';
    708     $admin_email = get_settings("admin_email");
    709     $from  = "From: $admin_email";
    710 
    711     $message_headers = "MIME-Version: 1.0\n"
    712         . "$from\n"
    713         . "Content-Type: text/plain; charset=\"" . get_settings('blog_charset') . "\"\n";
    714 
    715     @wp_mail($admin_email, $subject, $notify_message, $message_headers);
     695        $notify_message  = sprintf( __('A new comment on the post #%1$s "%2$s" is waiting for your approval'), $post->ID, $post->post_title ) . "\r\n";
     696        $notify_message .= get_permalink($comment->comment_post_ID) . "\r\n\r\n";
     697        $notify_message .= sprintf( __('Author : %1$s (IP: %2$s , %3$s)'), $comment->comment_author, $comment->comment_author_IP, $comment_author_domain ) . "\r\n";
     698        $notify_message .= sprintf( __('E-mail : %s'), $comment->comment_author_email ) . "\r\n";
     699        $notify_message .= sprintf( __('URI    : %s'), $comment->comment_author_url ) . "\r\n";
     700        $notify_message .= sprintf( __('Whois  : http://ws.arin.net/cgi-bin/whois.pl?queryinput=%s'), $comment->comment_author_IP ) . "\r\n";
     701        $notify_message .= __('Comment: ') . "\r\n" . $comment->comment_content . "\r\n\r\n";
     702        $notify_message .= sprintf( __('To approve this comment, visit: %s'),  get_settings('siteurl').'/wp-admin/post.php?action=mailapprovecomment&p='.$comment->comment_post_ID."&comment=$comment_id" ) . "\r\n";
     703        $notify_message .= sprintf( __('To delete this comment, visit: %s'), get_settings('siteurl').'/wp-admin/post.php?action=confirmdeletecomment&p='.$comment->comment_post_ID."&comment=$comment_id" ) . "\r\n";
     704        $notify_message .= sprintf( __('Currently %s comments are waiting for approval. Please visit the moderation panel:'), $comments_waiting ) . "\r\n";
     705        $notify_message .= get_settings('siteurl') . "/wp-admin/moderation.php\r\n";
     706
     707        $subject = sprintf( __('[%1$s] Please moderate: "%2$s"'), get_settings('blogname'), $post->post_title );
     708
     709    @wp_mail($admin_email, $subject, $notify_message);
    716710   
    717711    return true;
Note: See TracChangeset for help on using the changeset viewer.