WordPress.org

Make WordPress Core

Ticket #2509: akismet.diff

File akismet.diff, 9.0 KB (added by Sewar, 8 years ago)

Patch for Akismet plugin.

  • E:/PHP/WordPress/SVN/wp-content/plugins/akismet/akismet.php

     
    88Author URI: http://photomatt.net/ 
    99*/ 
    1010 
     11load_plugin_textdomain('akismet', 'wp-content/plugins/akismet'); 
     12 
    1113add_action('admin_menu', 'ksd_config_page'); 
    1214 
    1315function ksd_config_page() { 
    1416        global $wpdb; 
    1517        if ( function_exists('add_submenu_page') ) 
    16                 add_submenu_page('plugins.php', __('Akismet Configuration'), __('Akismet Configuration'), 1, __FILE__, 'akismet_conf'); 
     18                add_submenu_page('plugins.php', __('Akismet Configuration', 'akismet'), __('Akismet Configuration', 'akismet'), 1, __FILE__, 'akismet_conf'); 
    1719} 
    1820 
    1921function akismet_conf() { 
     
    3032?> 
    3133 
    3234<div class="wrap"> 
    33 <h2><?php _e('Akismet Configuration'); ?></h2> 
    34         <p><?php printf(__('For many people, <a href="%1$s">Akismet</a> will greatly reduce or even completely eliminate the comment and trackback spam you get on your site. If one does happen to get through, simply mark it as "spam" on the moderation screen and Akismet will learn from the mistakes. If you don\'t have a WordPress.com account yet, you can get one at <a href="%2$s">WordPress.com</a>.'), 'http://akismet.com/', 'http://wordpress.com/api-keys/'); ?></p> 
     35<h2><?php _e('Akismet Configuration', 'akismet'); ?></h2> 
     36        <p><?php printf(__('For many people, <a href="%1$s">Akismet</a> will greatly reduce or even completely eliminate the comment and trackback spam you get on your site. If one does happen to get through, simply mark it as "spam" on the moderation screen and Akismet will learn from the mistakes. If you don\'t have a WordPress.com account yet, you can get one at <a href="%2$s">WordPress.com</a>.', 'akismet'), 'http://akismet.com/', 'http://wordpress.com/api-keys/'); ?></p> 
    3537 
    3638<form action="" method="post" id="akismet-conf" style="margin: auto; width: 25em; "> 
    37 <h3><label for="key"><?php _e('WordPress.com API Key'); ?></label></h3> 
     39<h3><label for="key"><?php _e('WordPress.com API Key', 'akismet'); ?></label></h3> 
    3840<?php if ( $invalid_key ) { ?> 
    39         <p style="padding: .5em; background-color: #f33; color: #fff; font-weight: bold;"><?php _e('Your key appears invalid. Double-check it.'); ?></p> 
     41        <p style="padding: .5em; background-color: #f33; color: #fff; font-weight: bold;"><?php _e('Your key appears invalid. Double-check it.', 'akismet'); ?></p> 
    4042<?php } ?> 
    41 <p><input id="key" name="key" type="text" size="15" maxlength="12" value="<?php echo get_option('wordpress_api_key'); ?>" style="font-family: 'Courier New', Courier, mono; font-size: 1.5em;" /> (<?php _e('<a href="http://faq.wordpress.com/2005/10/19/api-key/">What is this?</a>'); ?>)</p> 
    42         <p class="submit"><input type="submit" name="submit" value="<?php _e('Update API Key &raquo;'); ?>" /></p> 
     43<p><input id="key" name="key" type="text" size="15" maxlength="12" value="<?php echo get_option('wordpress_api_key'); ?>" style="font-family: 'Courier New', Courier, mono; font-size: 1.5em;" /> (<?php _e('<a href="http://faq.wordpress.com/2005/10/19/api-key/">What is this?</a>', 'akismet'); ?>)</p> 
     44        <p class="submit"><input type="submit" name="submit" value="<?php _e('Update API Key &raquo;', 'akismet'); ?>" /></p> 
    4345</form> 
    4446</div> 
    4547<?php 
     
    5961        function akismet_warning() { 
    6062        $path = plugin_basename(__FILE__); 
    6163                echo " 
    62                 <div id='akismet-warning' class='updated fade-ff0000'><p><strong>".__('Akismet is not active.')."</strong> ".sprintf(__('You must <a href="%1$s">enter your WordPress.com API key</a> for it to work.'), "plugins.php?page=$path")."</p></div> 
     64                <div id='akismet-warning' class='updated fade-ff0000'><p><strong>".__('Akismet is not active.', 'akismet')."</strong> ".sprintf(__('You must <a href="%1$s">enter your WordPress.com API key</a> for it to work.', 'akismet'), "plugins.php?page=$path")."</p></div> 
    6365                <style type='text/css'> 
    6466                #adminmenu { margin-bottom: 5em; } 
    6567                #akismet-warning { position: absolute; top: 7em; } 
     
    183185 
    184186function ksd_manage_page() { 
    185187        global $wpdb; 
    186         $count = sprintf(__('Akismet Spam (%s)'), ksd_spam_count()); 
     188        $count = sprintf(__('Akismet Spam (%s)', 'akismet'), ksd_spam_count()); 
    187189        if ( function_exists('add_management_page') ) 
    188                 add_management_page(__('Akismet Spam'), $count, 1, __FILE__, 'ksd_caught'); 
     190                add_management_page(__('Akismet Spam', 'akismet'), $count, 1, __FILE__, 'ksd_caught'); 
    189191} 
    190192 
    191193function ksd_caught() { 
     
    201203                        ksd_submit_nonspam_comment($comment); 
    202204                        ++$i; 
    203205                endforeach; 
    204                 echo '<div class="updated"><p>' . sprintf(__('%1$s comments recovered.'), $i) . "</p></div>"; 
     206                echo '<div class="updated"><p>' . sprintf(__('%1$s comments recovered.', 'akismet'), $i) . "</p></div>"; 
    205207        } 
    206208        if ('delete' == $_POST['action']) { 
    207209                $delete_time = addslashes( $_POST['display_time'] ); 
     
    209211                if (isset($nuked)) { 
    210212                        echo '<div class="updated"><p>'; 
    211213                        if ($nuked) { 
    212                                 _e('All spam deleted.'); 
     214                                _e('All spam deleted.', 'akismet'); 
    213215                        } 
    214216                        echo "</p></div>"; 
    215217                } 
    216218        } 
    217219?> 
    218220<div class="wrap"> 
    219 <h2><?php _e('Caught Spam') ?></h2> 
     221<h2><?php _e('Caught Spam', 'akismet') ?></h2> 
    220222<?php 
    221223$count = get_option('akismet_spam_count'); 
    222224if ( $count ) { 
    223225?> 
    224 <p><?php printf(__('Akismet has caught <strong>%1$s</strong> spam for you since you installed it.'), number_format($count) ); ?></p> 
     226<p><?php printf(__('Akismet has caught <strong>%1$s</strong> spam for you since you installed it.', 'akismet'), number_format($count) ); ?></p> 
    225227<?php 
    226228} 
    227229$spam_count = ksd_spam_count(); 
    228230if (0 == $spam_count) { 
    229         echo '<p>'.__('You have no spam currently in the queue. Must be your lucky day. :)').'</p>'; 
     231        echo '<p>'.__('You have no spam currently in the queue. Must be your lucky day. :)', 'akismet').'</p>'; 
    230232        echo '</div>'; 
    231233} else { 
    232         echo '<p>'.__('You can delete all of the spam from your database with a single click. This operation cannot be undone, so you may wish to check to ensure that no legitimate comments got through first. Spam is automatically deleted after 15 days, so don&#8217;t sweat it.').'</p>'; 
     234        echo '<p>'.__('You can delete all of the spam from your database with a single click. This operation cannot be undone, so you may wish to check to ensure that no legitimate comments got through first. Spam is automatically deleted after 15 days, so don&#8217;t sweat it.', 'akismet').'</p>'; 
    233235?> 
    234236<form method="post" action=""> 
    235237<input type="hidden" name="action" value="delete" /> 
    236 <?php printf(__('There are currently %1$s comments identified as spam.'), $spam_count); ?>&nbsp; &nbsp; <input type="submit" name="Submit" value="<?php _e('Delete all'); ?>" /> 
     238<?php printf(__('There are currently %1$s comments identified as spam.', 'akismet'), $spam_count); ?>&nbsp; &nbsp; <input type="submit" name="Submit" value="<?php _e('Delete all', 'akismet'); ?>" /> 
    237239<input type="hidden" name="display_time" value="<?php echo current_time('mysql', 1); ?>" /> 
    238240</form> 
    239241</div> 
    240242<div class="wrap"> 
    241 <h2><?php _e('Last 15 days'); ?></h2> 
    242 <?php echo '<p>'.__('These are the latest comments identified as spam by Akismet. If you see any mistakes, simply mark the comment as "not spam" and Akismet will learn from the submission. If you wish to recover a comment from spam, simply select the comment, and click Not Spam. After 15 days we clean out the junk for you.').'</p>'; ?> 
     243<h2><?php _e('Last 15 days', 'akismet'); ?></h2> 
     244<?php echo '<p>'.__('These are the latest comments identified as spam by Akismet. If you see any mistakes, simply mark the comment as "not spam" and Akismet will learn from the submission. If you wish to recover a comment from spam, simply select the comment, and click Not Spam. After 15 days we clean out the junk for you.', 'akismet').'</p>'; ?> 
    243245<?php 
    244246$comments = $wpdb->get_results("SELECT * FROM $wpdb->comments WHERE comment_approved = 'spam' ORDER BY comment_date DESC LIMIT 150"); 
    245247 
     
    263265<?php comment_text() ?> 
    264266<label for="spam-<?php echo $comment->comment_ID; ?>"> 
    265267<input type="checkbox" id="spam-<?php echo $comment->comment_ID; ?>" name="not_spam[]" value="<?php echo $comment->comment_ID; ?>" /> 
    266 <?php _e('Not Spam') ?></label> 
     268<?php _e('Not Spam', 'akismet') ?></label> 
    267269<?php 
    268270} 
    269271} 
    270272?> 
    271273</ol> 
    272274<p class="submit">  
    273 <input type="submit" name="submit" value="<?php _e('Not Spam &raquo;'); ?>" /> 
     275<input type="submit" name="submit" value="<?php _e('Not Spam &raquo;', 'akismet'); ?>" /> 
    274276</p> 
    275277</form> 
    276278</div> 
     
    285287        if ( !$count ) 
    286288                return; 
    287289        $path = plugin_basename(__FILE__); 
    288         echo '<h3>'.__('Spam').'</h3>'; 
    289         echo '<p>'.sprintf(__('<a href="%1$s">Akismet</a> has protected your site from <a href="%2$s">%3$s spam comments</a>.'), 'http://akismet.com/', "edit.php?page=$path", number_format($count) ).'</p>'; 
     290        echo '<h3>'.__('Spam', 'akismet').'</h3>'; 
     291        echo '<p>'.sprintf(__('<a href="%1$s">Akismet</a> has protected your site from <a href="%2$s">%3$s spam comments</a>.', 'akismet'), 'http://akismet.com/', "edit.php?page=$path", number_format($count) ).'</p>'; 
    290292} 
    291293 
    292294add_action('activity_box_end', 'akismet_stats');