Make WordPress Core

Changeset 2477


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

Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/users.php

    r2449 r2477  
    8282
    8383    $user_login = stripslashes($user_login);
    84     $message  = 'New user registration on your blog ' . get_settings('blogname') . ":\r\n\r\n";
    85     $message .= "Username: $user_login\r\n\r\nE-mail: $user_email";
    86 
    87     @wp_mail(get_settings('admin_email'), '[' . get_settings('blogname') . '] New User Registration', $message);
     84    $message  = sprintf(__('New user registration on your blog %s:'), get_settings('blogname')) . "\r\n\r\n";
     85    $message .= sprintf(__('Username: %s'), $user_login) . "\r\n\r\n";
     86    $message .= sprintf(__('E-mail: %s'), $user_email) . "\r\n";
     87
     88    @wp_mail(get_settings('admin_email'), sprintf(__('[%s] New User Registration'), get_settings('blogname')), $message);
    8889    header('Location: users.php');
    8990break;
  • 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;
  • trunk/wp-includes/functions.php

    r2457 r2477  
    16541654function wp_mail($to, $subject, $message, $headers = '') {
    16551655    if( $headers == '' ) {
    1656         $headers = "MIME-Version: 1.0\n" .
    1657         "From: " . get_settings('admin_email') . "\n" .
    1658         "Content-Type: text/plain; charset=\"" . get_settings('blog_charset') . "\"\n";
     1656        $headers = "MIME-Version: 1.0\r\n" .
     1657        "From: " . get_settings('admin_email') . "\r\n" .
     1658        "Content-Type: text/plain; charset=\"" . get_settings('blog_charset') . "\"\r\n";
    16591659    }
    16601660
  • trunk/wp-login.php

    r2465 r2477  
    103103    // now insert the new pass md5'd into the db
    104104    $wpdb->query("UPDATE $wpdb->users SET user_activation_key = '$key' WHERE user_login = '$user_login'");
    105     $message .= __("Someone has asked to reset the password for the following site and username.\n\n");
    106     $message .= get_option('siteurl') . "\n\n";
     105    $message .= __('Someone has asked to reset the password for the following site and username.') . "\r\n\r\n";
     106    $message .= get_option('siteurl') . "\r\n\r\n";
    107107    $message .= sprintf(__('Username: %s'), $user_login) . "\r\n\r\n";
    108     $message .= __("To reset your password visit the following address, otherwise just ignore this email and nothing will happen.\n\n");
    109     $message .= get_settings('siteurl') . "/wp-login.php?action=resetpass&key=$key";
    110 
    111     $m = wp_mail($user_email, sprintf(__("[%s] Password Reset"), get_settings('blogname')), $message);
     108    $message .= __('To reset your password visit the following address, otherwise just ignore this email and nothing will happen.') . "\r\n\r\n";
     109    $message .= get_settings('siteurl') . "/wp-login.php?action=resetpass&key=$key\r\n";
     110
     111    $m = wp_mail($user_email, sprintf(__('[%s] Password Reset'), get_settings('blogname')), $message);
    112112
    113113    if ($m == false) {
     
    139139    $message  = sprintf(__('Username: %s'), $user->user_login) . "\r\n";
    140140    $message .= sprintf(__('Password: %s'), $new_pass) . "\r\n";
    141     $message .= get_settings('siteurl') . '/wp-login.php';
    142 
    143     $m = wp_mail($user->user_email, sprintf(__("[%s] Your new password"), get_settings('blogname')), $message);
     141    $message .= get_settings('siteurl') . "/wp-login.php\r\n";
     142
     143    $m = wp_mail($user->user_email, sprintf(__('[%s] Your new password'), get_settings('blogname')), $message);
    144144
    145145    if ($m == false) {
    146          echo '<p>' . __('The e-mail could not be sent.') . "<br />\n";
    147          echo  __('Possible reason: your host may have disabled the mail() function...') . "</p>";
     146        echo '<p>' . __('The e-mail could not be sent.') . "<br />\n";
     147        echo  __('Possible reason: your host may have disabled the mail() function...') . '</p>';
    148148        die();
    149149    } else {
    150         echo '<p>' .  sprintf(__("Your new password is in the mail."), $user_login) . '<br />';
     150        echo '<p>' .  sprintf(__('Your new password is in the mail.'), $user_login) . '<br />';
    151151        echo  "<a href='wp-login.php' title='" . __('Check your e-mail first, of course') . "'>" . __('Click here to login!') . '</a></p>';
    152152        // send a copy of password change notification to the admin
    153         wp_mail(get_settings('admin_email'), sprintf(__('[%s] Password Lost/Change'), get_settings('blogname')), sprintf(__('Password Lost and Changed for user: %s'), $user->user_login));
     153        $message = sprintf(__('Password Lost and Changed for user: %s'), $user->user_login) . "\r\n";
     154        wp_mail(get_settings('admin_email'), sprintf(__('[%s] Password Lost/Change'), get_settings('blogname')), $message);
    154155        die();
    155156    }
  • trunk/wp-register.php

    r2441 r2477  
    7676    $message  = sprintf(__('Username: %s'), $user_login) . "\r\n";
    7777    $message .= sprintf(__('Password: %s'), $password) . "\r\n";
    78     $message .= get_settings('siteurl') . '/wp-login.php';
     78    $message .= get_settings('siteurl') . "/wp-login.php\r\n";
    7979   
    80     wp_mail($user_email, sprintf(__("[%s] Your username and password"), get_settings('blogname')), $message);
     80    wp_mail($user_email, sprintf(__('[%s] Your username and password'), get_settings('blogname')), $message);
    8181
    82     $message  = sprintf(__("New user registration on your blog %1\$s:\n\nUsername: %2\$s \n\nE-mail: %3\$s"), get_settings('blogname'), $user_login, $user_email);
     82    $message  = sprintf(__('New user registration on your blog %s:'), get_settings('blogname')) . "\r\n\r\n";
     83    $message .= sprintf(__('Username: %s'), $user_login) . "\r\n\r\n";
     84    $message .= sprintf(__('E-mail: %s'), $user_email) . "\r\n";
    8385
    8486    @wp_mail(get_settings('admin_email'), sprintf(__('[%s] New User Registration'), get_settings('blogname')), $message);
Note: See TracChangeset for help on using the changeset viewer.