Make WordPress Core

Ticket #1168: gettext-emails-2.diff

File gettext-emails-2.diff, 15.0 KB (added by slebog, 19 years ago)
  • trunk/wp-admin/users.php

    diff -r -u wordpress/trunk/wp-admin/users.php wordpress-work/trunk/wp-admin/users.php
    old new  
    8181                $stars .= '*';
    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";
     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";
    8687
    87         @wp_mail(get_settings('admin_email'), '[' . get_settings('blogname') . '] New User Registration', $message);
     88        @wp_mail(get_settings('admin_email'), sprintf(__('[%s] New User Registration'), get_settings('blogname')), $message);
    8889        header('Location: users.php');
    8990break;
    9091
  • trunk/wp-includes/comment-functions.php

    diff -r -u wordpress/trunk/wp-includes/comment-functions.php wordpress-work/trunk/wp-includes/comment-functions.php
    old new  
    631631        if ( empty( $comment_type ) ) $comment_type = 'comment';
    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.'"';
     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 );
    656656        }
    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";
     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) {
    661661                $from = "From: \"$blogname\" <wordpress@" . $_SERVER['SERVER_NAME'] . '>';
     
    663663                $from = 'From: "' . $comment->comment_author . "\" <$comment->comment_author_email>";
    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);
    671671   
     
    692692    $comment_author_domain = gethostbyaddr($comment->comment_author_IP);
    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";
     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";
    714706
    715     @wp_mail($admin_email, $subject, $notify_message, $message_headers);
     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;
    718712}
  • trunk/wp-includes/functions.php

    diff -r -u wordpress/trunk/wp-includes/functions.php wordpress-work/trunk/wp-includes/functions.php
    old new  
    16531653
    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
    16611661        return @mail($to, $subject, $message, $headers);
  • trunk/wp-login.php

    diff -r -u wordpress/trunk/wp-login.php wordpress-work/trunk/wp-login.php
    old new  
    102102        $key = substr( md5( uniqid( microtime() ) ), 0, 50);
    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";
     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";
    110110
    111         $m = wp_mail($user_email, sprintf(__("[%s] Password Reset"), get_settings('blogname')), $message);
     111        $m = wp_mail($user_email, sprintf(__('[%s] Password Reset'), get_settings('blogname')), $message);
    112112
    113113        if ($m == false) {
    114114                 echo '<p>' . __('The e-mail could not be sent.') . "<br />\n";
     
    138138        $wpdb->query("UPDATE $wpdb->users SET user_pass = MD5('$new_pass'), user_activation_key = '' WHERE user_login = '$user->user_login'");
    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';
     141        $message .= get_settings('siteurl') . "/wp-login.php\r\n";
    142142
    143         $m = wp_mail($user->user_email, sprintf(__("[%s] Your new password"), get_settings('blogname')), $message);
     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        }
    156157break;
  • trunk/wp-register.php

    diff -r -u wordpress/trunk/wp-register.php wordpress-work/trunk/wp-register.php
    old new  
    7575       
    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);
    8587