Index: modules/comment/comment.admin.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/comment/comment.admin.inc,v
retrieving revision 1.35
diff -u -p -r1.35 comment.admin.inc
--- modules/comment/comment.admin.inc	16 Oct 2009 20:40:05 -0000	1.35
+++ modules/comment/comment.admin.inc	24 Oct 2009 10:13:01 -0000
@@ -63,8 +63,15 @@ function comment_admin_overview($form, &
     'author' => array('data' => t('Author'), 'field' => 'name'),
     'posted_in' => array('data' => t('Posted in'), 'field' => 'node_title'),
     'changed' => array('data' => t('Updated'), 'field' => 'changed', 'sort' => 'desc'),
-    'operations' => array('data' => t('Operations')),
   );
+  
+  // Enable language column if translation module is enabled
+  // or if we have any node with language.
+  $multilanguage = (module_exists('locale'));
+  if ($multilanguage) {
+    $header['language'] = array('data' => t('Language'), 'field' => 'c.language');
+  }
+  $header['operations'] = array('data' => t('Operations'));
 
   $query = db_select('comment', 'c')->extend('PagerDefault')->extend('TableSort');
   $query->join('users', 'u', 'u.uid = c.uid');
@@ -72,7 +79,7 @@ function comment_admin_overview($form, &
   $query->addField('u', 'name', 'registered_name');
   $query->addField('n', 'title', 'node_title');
   $result = $query
-    ->fields('c', array('subject', 'nid', 'cid', 'comment', 'changed', 'status', 'name', 'homepage'))
+    ->fields('c', array('subject', 'nid', 'cid', 'comment', 'changed', 'status', 'name', 'homepage', 'language'))
     ->fields('u', array('uid'))
     ->condition('c.status', $status)
     ->limit(50)
@@ -83,6 +90,7 @@ function comment_admin_overview($form, &
   // Build a table listing the appropriate comments.
   $options = array();
   $destination = drupal_get_destination();
+  $languages = language_list();
 
   foreach ($result as $comment) {
     $options[$comment->cid] = array(
@@ -90,8 +98,11 @@ function comment_admin_overview($form, &
       'author' => theme('username', array('account' => $comment)),
       'posted_in' => l($comment->node_title, 'node/' . $comment->nid),
       'changed' => format_date($comment->changed, 'short'),
-      'operations' => l(t('edit'), 'comment/' . $comment->cid .'/edit', array('query' => $destination)),
     );
+    if ($multilanguage) {
+       $options[$comment->cid]['language'] = empty($comment->language) ? t('Language neutral') : t($languages[$comment->language]->name);
+    }
+    $options[$comment->cid]['operations'] = l(t('edit'), 'comment/' . $comment->cid .'/edit', array('query' => $destination));
   }
 
   $form['comments'] = array(
Index: modules/comment/comment.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/comment/comment.module,v
retrieving revision 1.796
diff -u -p -r1.796 comment.module
--- modules/comment/comment.module	23 Oct 2009 22:24:12 -0000	1.796
+++ modules/comment/comment.module	24 Oct 2009 10:57:23 -0000
@@ -287,6 +287,10 @@ function comment_permission() {
       'title' => t('Post comments without approval'),
       'description' => t('Add comments to content (no approval required).'),
     ),
+    'change comments language' => array(
+      'title' => t('Change comments language'),
+      'description' => t('Change comments language on post and edit.'),
+    )
   );
 }
 
@@ -706,6 +710,15 @@ function comment_get_thread($node, $mode
   $count_query
     ->condition('c.nid', $node->nid)
     ->addTag('node_access');
+    
+  // Pass all comment filters allowed for this node type.
+  $comment_filters = variable_get('comment_filters_' . $node->type, array());
+  if (!empty($comment_filters)) {
+    $query->addTag('comment_filter');
+    $query->addMetaData('comment_filters', $comment_filters);
+    $count_query->addTag('comment_filter');
+    $count_query->addMetaData('comment_filters', $comment_filters);
+  }
 
   if (!user_access('administer comments')) {
     $query->condition('c.status', COMMENT_PUBLISHED);
@@ -1023,6 +1036,16 @@ function comment_form_node_type_form_alt
         DRUPAL_REQUIRED => t('Required'),
       ),
     );
+    // Collect all modules that define comment filters.
+    $filters = module_implements('query_comment_filter_alter');
+    $filters = array_intersect(module_list(), $filters);
+    $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),
+    );
   }
 }
 
@@ -1878,6 +1901,16 @@ function comment_form($form, &$form_stat
     '#type' => 'value',
     '#value' => 'comment_node_' . $node->type,
   );
+  
+  if (module_exists('locale')) {
+    $form['language'] = array(
+      '#type' => 'select',
+      '#title' => t('Language'),
+      '#default_value' => (isset($comment->language) ? $comment->language : ''),
+      '#options' => array('' => t('Language neutral')) + locale_language_list('name'),
+      '#access' => user_access('change comments language') 
+    );
+  }
 
   // Only show the save button if comment previews are optional or if we are
   // already previewing the submission. However, if there are form errors,
Index: modules/locale/locale.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/locale/locale.module,v
retrieving revision 1.267
diff -u -p -r1.267 locale.module
--- modules/locale/locale.module	24 Oct 2009 05:13:44 -0000	1.267
+++ modules/locale/locale.module	24 Oct 2009 09:52:40 -0000
@@ -1068,6 +1068,18 @@ function locale_date_format_reset_form_s
 }
 
 /**
+ * Implement hook_query_TAG_alter().
+ *
+ * Adds a filter by language for comments.
+ */
+function locale_query_comment_filter_alter(QueryAlterableInterface $query) {
+  global $language;
+  $filters = $query->getMetaData('comment_filters');
+  if (in_array('locale', $filters)) {
+    $query->where("language = :name", array(':name' => $language->language));
+  }
+}
+/**
  * Implement hook_url_outbound_alter().
  *
  * Rewrite outbound URLs with language based prefixes.
