[gtranslator] Do not store the translation if there is no profile



commit 14e8fa89be1bd2d56afeda71abcfbc945d078795
Author: Ignacio Casal Quinteiro <icq gnome org>
Date:   Mon Mar 28 22:06:52 2011 +0200

    Do not store the translation if there is no profile

 src/gtr-tab.c |   13 +++++++++----
 1 files changed, 9 insertions(+), 4 deletions(-)
---
diff --git a/src/gtr-tab.c b/src/gtr-tab.c
index 8b77942..d53037d 100644
--- a/src/gtr-tab.c
+++ b/src/gtr-tab.c
@@ -193,12 +193,17 @@ gtr_tab_edition_finished (GtrTab * tab, GtrMsg * msg)
   GtrTranslationMemory *tm;
   gchar *message_error;
   GtkWidget *infobar;
+  GtrHeader *header;
 
-  tm =
-    GTR_TRANSLATION_MEMORY (gtr_application_get_translation_memory (GTR_APP));
+  header = gtr_po_get_header (tab->priv->po);
 
-  if (gtr_msg_is_translated (msg) && !gtr_msg_is_fuzzy (msg))
-    gtr_translation_memory_store (tm, msg);
+  if (gtr_header_get_profile (header) != NULL)
+    {
+      tm = GTR_TRANSLATION_MEMORY (gtr_application_get_translation_memory (GTR_APP));
+
+      if (gtr_msg_is_translated (msg) && !gtr_msg_is_fuzzy (msg))
+        gtr_translation_memory_store (tm, msg);
+    }
 
   /*
    * Checking message



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]