--- i18n_ato.module	2010-01-18 15:42:23.000000000 +0200
+++ i18n_auto.module	2011-02-07 23:49:31.000000000 +0200
@@ -57,6 +57,27 @@ function i18n_auto_action_node_translate
       $new_node->language = $langcode;
       $new_node->tnid = $node->nid;
       
+	  // If content type is "reply", link the comment to the translated parent
+	  
+ 	  if ($node->type == 'reply' || $node->type == 'comment') {
+
+	  if ($node->language == 'en') {
+	  $t_lang = 'fr';
+	  }
+	  else {
+	  $t_lang = 'en';
+	  }
+	  
+	  $parent = db_result(db_query("SELECT nid FROM `node_comments` WHERE cid = '$node->nid'"));
+
+  	  $translation_set = db_result(db_query("SELECT tnid FROM `node` WHERE nid = '$parent'"));
+  
+	  $translated_parent = db_result(db_query("SELECT nid FROM `node` WHERE language = '$t_lang' AND tnid = '$translation_set'"));
+
+	  $new_node->comment_target_nid = $translated_parent;
+	  } 
+	  
+	  
       // TODO: chunks of this next bit should probably be separate functions
       
       // set our flag
