Index: modules/comment/comment.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/comment/comment.module,v
retrieving revision 1.787
diff -u -p -r1.787 comment.module
--- modules/comment/comment.module	15 Oct 2009 16:18:45 -0000	1.787
+++ modules/comment/comment.module	16 Oct 2009 23:02:59 -0000
@@ -720,6 +720,13 @@ function comment_get_thread($node, $mode
   }
 
   $query->setCountQuery($count_query);
+  $filters = variable_get('comment_filters_' . $node->type, array());
+  foreach ($filters as $module) {
+  	$function = $module . '_comment_filter';
+  	if (function_exists($function)) {
+  	  $function($query);
+  	}
+  }
   $cids = $query->execute()->fetchCol();
 
   return $cids;
@@ -1011,6 +1018,15 @@ function comment_form_node_type_form_alt
       '#title' => t('Require preview'),
       '#default_value' => variable_get('comment_preview_' . $form['#node_type']->type, COMMENT_PREVIEW_OPTIONAL),
     );
+    // Get all defined filters.
+    $filters = module_invoke_all('comment_filter_info', $form['#node_type']->type);
+    $form['comment']['comment_filters'] = array(
+      '#type' => 'checkboxes',
+      '#title' => t('Comment filters'),
+      '#options' => $filters,
+      '#default_value' => variable_get('comment_filters_' . $form['#node_type']->type, array()),
+      '#access' => (count($filters) > 0)
+    );
   }
 }
 
Index: modules/locale/locale.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/locale/locale.module,v
retrieving revision 1.263
diff -u -p -r1.263 locale.module
--- modules/locale/locale.module	13 Oct 2009 21:34:14 -0000	1.263
+++ modules/locale/locale.module	16 Oct 2009 22:35:05 -0000
@@ -1015,3 +1015,11 @@ function locale_date_format_reset_form_s
   $form_state['redirect'] = 'admin/config/regional/date-time/locale';
 }
 
+function locale_comment_filter_info($node_type) {
+  return array('locale' => t('Filter by content language')); 
+}
+
+function locale_comment_filter(&$query) {
+  global $language;
+  $query->where("language = :name", array(':name' => $language->language));
+}
