Index: import.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/l10n_server/l10n_community/Attic/import.inc,v
retrieving revision 1.1.2.5
diff -u -p -r1.1.2.5 import.inc
--- import.inc	23 Dec 2007 22:51:53 -0000	1.1.2.5
+++ import.inc	28 Jul 2008 20:47:21 -0000
@@ -78,7 +78,8 @@ function l10n_community_import_form_subm
       // Get status report on what was done in the process.
       list($inserted, $updated, $unchanged, $suggested) = _l10n_community_import_one_string();
       drupal_set_message(t('The translation was successfully imported.'));
-      l10n_community_update_message($inserted, $updated, $unchanged, $suggested);
+      l10n_community_update_message($inserted, $updated, $unchanged, $suggested, 0);
+
     }
   }
   else {
Index: l10n_community.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/l10n_server/l10n_community/Attic/l10n_community.module,v
retrieving revision 1.1.2.21
diff -u -p -r1.1.2.21 l10n_community.module
--- l10n_community.module	11 Jul 2008 07:47:35 -0000	1.1.2.21
+++ l10n_community.module	28 Jul 2008 20:47:21 -0000
@@ -750,7 +750,7 @@ function l10n_community_trim($translatio
  * 
  * Used by both the save and import process.
  */
-function l10n_community_update_message($inserted, $updated, $unchanged, $suggested) {
+function l10n_community_update_message($inserted, $updated, $unchanged, $suggested, $duplicates) {
   // Inform user about changes made.
   $message = array();
   if ($inserted) {
@@ -765,6 +765,9 @@ function l10n_community_update_message($
   if ($unchanged) {
     $message[] = format_plural($unchanged, '1 translation unchanged', '@count translations unchanged');
   }
+  if ($duplicates) {
+    $message[] = format_plural($duplicates, '1 duplicate translation not saved', '@count duplicate translations not saved');
+  }
   if (count($message)) {
     drupal_set_message(join(', ', $message) .'.');
   }
@@ -939,4 +942,14 @@ function l10n_community_format_text($str
   }
 
   return "<div class='$class'><span class='string'>$string</span><span class='original hidden'>$original</span></div>";
-}
\ No newline at end of file
+}
+
+function l10n_is_duplicate($string, $sid, $langcode) {
+  // Check for duplicate translations.
+  $result = db_query("SELECT s.sid FROM {l10n_community_string} s LEFT JOIN {l10n_community_translation} t ON s.sid = t.sid WHERE t.translation = '%s' AND t.is_active = 1 AND t.language = '%s' AND s.sid = '%d'", $string, $langcode, $sid);
+  if (db_num_rows($result) > 0) {
+    return TRUE;
+  } else {
+    return FALSE;
+  }
+}
Index: translate.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/l10n_server/l10n_community/Attic/translate.inc,v
retrieving revision 1.1.2.6
diff -u -p -r1.1.2.6 translate.inc
--- translate.inc	11 Jul 2008 07:47:35 -0000	1.1.2.6
+++ translate.inc	28 Jul 2008 20:47:21 -0000
@@ -469,7 +469,10 @@ function l10n_community_translate_form($
 function l10n_community_translate_form_submit($form_id, &$form) {
   global $user;
 
-  $inserted = $updated = $unchanged = $suggested = 0;
+  $inserted = $updated = $unchanged = $suggested = $duplicates = 0;
+
+  $langcode = arg(2);
+
   foreach ($form as $sid => $item) {
     if (!is_array($item) || !isset($item['translation'])) {
       // Skip, if we don't have translations in this form item,
@@ -493,7 +496,13 @@ function l10n_community_translate_form_s
       }
     }
       
-    if ($text) {
+    if (!empty($text)) {
+           // Check for duplicate translation or suggestion.
+              if (l10n_is_duplicate($text, $sid, $langcode)) {
+                  $duplicates++;
+                  continue;
+                } 
+
       // We have some string to save.
       l10n_community_target_save(
         $sid, $text, $form['langcode'], $user->uid,
@@ -504,7 +513,7 @@ function l10n_community_translate_form_s
   }
   
   // Inform user about changes made to the database.
-  l10n_community_update_message($inserted, $updated, $unchanged, $suggested);
+  l10n_community_update_message($inserted, $updated, $unchanged, $suggested, $duplicates);
 }
 
 // = Theme functions ===========================================================
