gtranslator r3675 - trunk/src
- From: icq svn gnome org
- To: svn-commits-list gnome org
- Subject: gtranslator r3675 - trunk/src
- Date: Mon, 22 Sep 2008 09:42:22 +0000 (UTC)
Author: icq
Date: Mon Sep 22 09:42:22 2008
New Revision: 3675
URL: http://svn.gnome.org/viewvc/gtranslator?rev=3675&view=rev
Log:
* tab.c:
Added function gtranslator_tab_edition_finished to manage
the "edition_message_finished" signal.
Now when a message is edited the result is stored in the
translation memory.
Modified:
trunk/src/ChangeLog
trunk/src/tab.c
Modified: trunk/src/tab.c
==============================================================================
--- trunk/src/tab.c (original)
+++ trunk/src/tab.c Mon Sep 22 09:42:22 2008
@@ -34,6 +34,7 @@
#include "po.h"
#include "prefs-manager.h"
#include "view.h"
+#include "translation-memory.h"
#include "translation-memory-ui.h"
#include "window.h"
@@ -183,6 +184,19 @@
else gtk_widget_hide (tab->priv->comment_button);
}
+static void
+gtranslator_tab_edition_finished (GtranslatorTab *tab,
+ GtranslatorMsg *msg)
+{
+ GtranslatorTranslationMemory *tm;
+
+ tm = GTR_TRANSLATION_MEMORY (gtranslator_application_get_translation_memory (GTR_APP));
+
+ gtranslator_translation_memory_store (tm,
+ gtranslator_msg_get_msgid (msg),
+ gtranslator_msg_get_msgstr (msg));
+}
+
/*
* Write the change back to the gettext PO instance in memory and
* mark the page dirty
@@ -801,7 +815,8 @@
object_class->set_property = gtranslator_tab_set_property;
object_class->get_property = gtranslator_tab_get_property;
klass->showed_message = gtranslator_tab_showed_message;
-
+ klass->message_edition_finished = gtranslator_tab_edition_finished;
+
/* Signals */
signals[SHOWED_MESSAGE] =
g_signal_new("showed-message",
@@ -1090,7 +1105,6 @@
if (!searching)
g_signal_emit (G_OBJECT (tab), signals[SHOWED_MESSAGE], 0,
GTR_MSG (to_go->data));
-
}
/**
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]