[evolution-kolab/ek-wip-porting] libekolabconv: added translatable strings
- From: Christian Hilberg <chilberg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution-kolab/ek-wip-porting] libekolabconv: added translatable strings
- Date: Mon, 5 Mar 2012 11:46:59 +0000 (UTC)
commit c4181dcb8dfd759a57feea23bd398edde137f29d
Author: Christian Hilberg <hilberg kernelconcepts de>
Date: Mon Mar 5 12:46:03 2012 +0100
libekolabconv: added translatable strings
* marked GError messages as translatable strings
* added new files to POTFILES.in
po/POTFILES.in | 6 +++++
src/libekolabconv/main/src/kolab-conv.c | 12 +++++++---
src/libekolabconv/main/src/kolab/contact-k-to-i.c | 10 ++++++--
src/libekolabconv/main/src/kolab/event-k-to-i.c | 14 ++++++------
src/libekolabconv/main/src/kolab/kolab-util.c | 22 ++++++++++++--------
src/libekolabconv/main/src/kolab/note-k-to-i.c | 10 ++++++--
src/libekolabconv/main/src/kolab/task-k-to-i.c | 10 ++++++--
7 files changed, 55 insertions(+), 29 deletions(-)
---
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 9ec0dc5..49f17be 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -29,3 +29,9 @@ src/libekolab/kolab-mail-side-cache.c
src/libekolab/kolab-mail-synchronizer.c
src/libekolab/kolab-settings-handler.c
src/libekolab/kolab-util-backend.c
+src/libekolabconv/main/src/kolab-conv.c
+src/libekolabconv/main/src/kolab/contact-k-to-i.c
+src/libekolabconv/main/src/kolab/event-k-to-i.c
+src/libekolabconv/main/src/kolab/kolab-util.c
+src/libekolabconv/main/src/kolab/note-k-to-i.c
+src/libekolabconv/main/src/kolab/task-k-to-i.c
diff --git a/src/libekolabconv/main/src/kolab-conv.c b/src/libekolabconv/main/src/kolab-conv.c
index 0daeaf3..1439ef8 100644
--- a/src/libekolabconv/main/src/kolab-conv.c
+++ b/src/libekolabconv/main/src/kolab-conv.c
@@ -23,6 +23,10 @@
* 51 Franklin Street, Fifth Floor Boston, MA 02110-1301, USA
*/
+#include <config.h>
+
+#include <glib/gi18n-lib.h>
+
#include <libecal/e-cal-util.h>
#include "kolab-conv.h"
#include "evolution/evolution.h"
@@ -178,7 +182,7 @@ kolabconv_cal_util_freebusy_ecalcomp_new_from_ics (const gchar *ics_string,
g_set_error (err,
KOLABCONV_ERROR_READ_KOLAB,
KOLABCONV_ERROR_READ_KOLAB_INPUT_IS_NULL, /* appropriate? */
- "empty server response");
+ _("Empty server response"));
goto CLEANUP;
}
@@ -189,7 +193,7 @@ kolabconv_cal_util_freebusy_ecalcomp_new_from_ics (const gchar *ics_string,
g_set_error (err,
KOLABCONV_ERROR_READ_KOLAB,
KOLABCONV_ERROR_READ_KOLAB_MALFORMED_XML, /* appropriate? */
- "cannot parse server response");
+ _("Cannot parse server response"));
goto CLEANUP;
}
@@ -206,7 +210,7 @@ kolabconv_cal_util_freebusy_ecalcomp_new_from_ics (const gchar *ics_string,
g_set_error (err,
KOLABCONV_ERROR_READ_KOLAB,
KOLABCONV_ERROR_READ_KOLAB_INVALID_KOLAB_XML, /* appropriate? */
- "unsupported component type");
+ _("Unsupported component type"));
}
g_object_unref (ecalcomp_tmp);
ecalcomp_tmp = NULL;
@@ -215,7 +219,7 @@ kolabconv_cal_util_freebusy_ecalcomp_new_from_ics (const gchar *ics_string,
g_set_error (err,
KOLABCONV_ERROR_READ_KOLAB,
KOLABCONV_ERROR_READ_KOLAB_MISSING_XML_PART, /* appropriate? */
- "unsupported component type");
+ _("Unsupported component type"));
}
CLEANUP:
diff --git a/src/libekolabconv/main/src/kolab/contact-k-to-i.c b/src/libekolabconv/main/src/kolab/contact-k-to-i.c
index 9463620..9fa86b0 100644
--- a/src/libekolabconv/main/src/kolab/contact-k-to-i.c
+++ b/src/libekolabconv/main/src/kolab/contact-k-to-i.c
@@ -32,6 +32,10 @@
* The related header file is: kolab.h
*/
+#include <config.h>
+
+#include <glib/gi18n-lib.h>
+
#include "priv-kolab.h"
#include "kolab.h" /* public part of this file */
#include "../util.h"
@@ -90,9 +94,9 @@ conv_kolab_conv_mail_to_I_contact (const Kolab_conv_mail* k_contact, GError** er
g_strcmp0((gchar*)n_ptr->name, KLB_CNT) == 0)
node = n_ptr;
if (node == NULL) {
- g_set_error(error, KOLABCONV_ERROR_READ_KOLAB,
- KOLABCONV_ERROR_READ_KOLAB_INVALID_KOLAB_XML,
- "root tag is missing");
+ g_set_error (error, KOLABCONV_ERROR_READ_KOLAB,
+ KOLABCONV_ERROR_READ_KOLAB_INVALID_KOLAB_XML,
+ _("Root tag is missing"));
free_i_contact (&i_contact);
xmlFreeDoc(doc);
return NULL;
diff --git a/src/libekolabconv/main/src/kolab/event-k-to-i.c b/src/libekolabconv/main/src/kolab/event-k-to-i.c
index eff2fcc..c3c4e74 100644
--- a/src/libekolabconv/main/src/kolab/event-k-to-i.c
+++ b/src/libekolabconv/main/src/kolab/event-k-to-i.c
@@ -32,6 +32,10 @@
* The related header file is: kolab.h
*/
+#include <config.h>
+
+#include <glib/gi18n-lib.h>
+
#include "priv-kolab.h"
#include "kolab.h" /* public part of this file */
@@ -83,9 +87,9 @@ conv_kolab_conv_mail_to_I_event (const Kolab_conv_mail *k_event, GError **error)
node = n;
if (node == NULL) {
- g_set_error(error, KOLABCONV_ERROR_READ_KOLAB,
- KOLABCONV_ERROR_READ_KOLAB_INVALID_KOLAB_XML,
- "root tag is missing");
+ g_set_error (error, KOLABCONV_ERROR_READ_KOLAB,
+ KOLABCONV_ERROR_READ_KOLAB_INVALID_KOLAB_XML,
+ _("Root tag is missing"));
free_i_event(&ievent);
xmlFreeDoc(doc);
return NULL;
@@ -190,7 +194,3 @@ handle_element_event(I_event *i_event, xmlNodePtr node, GError **error)
handle_element_show_time_as(i_event, node)
|| handle_element_date_or_datetime(KLB_EVENT_END_DATE, &i_event->end_date, node);
}
-
-
-
-
diff --git a/src/libekolabconv/main/src/kolab/kolab-util.c b/src/libekolabconv/main/src/kolab/kolab-util.c
index c5ae1e6..5a2d27b 100644
--- a/src/libekolabconv/main/src/kolab/kolab-util.c
+++ b/src/libekolabconv/main/src/kolab/kolab-util.c
@@ -25,6 +25,10 @@
#define _XOPEN_SOURCE 600 /* glibc2 needs this */
+#include <config.h>
+
+#include <glib/gi18n-lib.h>
+
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
@@ -140,9 +144,9 @@ util_get_kolab_xml_part(const Kolab_conv_mail *klb_mail, GList **other_parts, GE
/* check input paramters */
if (klb_mail == NULL) {
- g_set_error(error, KOLABCONV_ERROR_READ_KOLAB,
- KOLABCONV_ERROR_READ_KOLAB_INPUT_IS_NULL,
- "kolab mail struct must not be null");
+ g_set_error (error, KOLABCONV_ERROR_READ_KOLAB,
+ KOLABCONV_ERROR_READ_KOLAB_INPUT_IS_NULL,
+ _("Kolab mail struct must not be null"));
return NULL;
}
/* iterate over mail parts, search kolab xml part, parse and return it */
@@ -152,18 +156,18 @@ util_get_kolab_xml_part(const Kolab_conv_mail *klb_mail, GList **other_parts, GE
/* found kolab xml part => parse it in memory */
doc = xmlReadMemory (mail_part->data, (int) mail_part->length, NULL, NULL, 0);
if (doc == NULL) {
- g_set_error(error, KOLABCONV_ERROR_READ_KOLAB,
- KOLABCONV_ERROR_READ_KOLAB_MALFORMED_XML,
- "xml parser returned null for data part %d", i);
+ g_set_error (error, KOLABCONV_ERROR_READ_KOLAB,
+ KOLABCONV_ERROR_READ_KOLAB_MALFORMED_XML,
+ _("XML parser returned null for data part %d"), i);
return NULL;
}
} else /* part must be cloned here because it will be freed when converting from internal */
*other_parts = g_list_append(*other_parts, clone_kolab_conv_mail_part(mail_part));
}
if (doc == NULL) /* no kolab xml part could be found */
- g_set_error(error, KOLABCONV_ERROR_READ_KOLAB,
- KOLABCONV_ERROR_READ_KOLAB_MISSING_XML_PART,
- "kolab mail struct has no kolab xml data part");
+ g_set_error (error, KOLABCONV_ERROR_READ_KOLAB,
+ KOLABCONV_ERROR_READ_KOLAB_MISSING_XML_PART,
+ _("Kolab mail struct has no Kolab XML data part"));
return doc;
}
diff --git a/src/libekolabconv/main/src/kolab/note-k-to-i.c b/src/libekolabconv/main/src/kolab/note-k-to-i.c
index 55e10de..a7d9d53 100644
--- a/src/libekolabconv/main/src/kolab/note-k-to-i.c
+++ b/src/libekolabconv/main/src/kolab/note-k-to-i.c
@@ -31,6 +31,10 @@
* The related header file is: kolab.h
*/
+#include <config.h>
+
+#include <glib/gi18n-lib.h>
+
#include "priv-kolab.h"
#include "kolab.h" /* public part of this file */
@@ -104,9 +108,9 @@ conv_kolab_conv_mail_to_I_note (const Kolab_conv_mail *knote, GError **error)
node = n;
if (node == NULL) {
- g_set_error(error, KOLABCONV_ERROR_READ_KOLAB,
- KOLABCONV_ERROR_READ_KOLAB_INVALID_KOLAB_XML,
- "root tag is missing");
+ g_set_error (error, KOLABCONV_ERROR_READ_KOLAB,
+ KOLABCONV_ERROR_READ_KOLAB_INVALID_KOLAB_XML,
+ _("Root tag is missing"));
free_i_note(&i_note);
xmlFreeDoc(doc);
return NULL;
diff --git a/src/libekolabconv/main/src/kolab/task-k-to-i.c b/src/libekolabconv/main/src/kolab/task-k-to-i.c
index ce8e212..42bf35d 100644
--- a/src/libekolabconv/main/src/kolab/task-k-to-i.c
+++ b/src/libekolabconv/main/src/kolab/task-k-to-i.c
@@ -32,6 +32,10 @@
* The related header file is: kolab.h
*/
+#include <config.h>
+
+#include <glib/gi18n-lib.h>
+
#include <errno.h>
#include "priv-kolab.h"
#include "../util.h"
@@ -70,9 +74,9 @@ conv_kolab_conv_mail_to_I_task (const Kolab_conv_mail *k_task, GError **error)
node = n;
if (node == NULL) {
- g_set_error(error, KOLABCONV_ERROR_READ_KOLAB,
- KOLABCONV_ERROR_READ_KOLAB_INVALID_KOLAB_XML,
- "root tag is missing");
+ g_set_error (error, KOLABCONV_ERROR_READ_KOLAB,
+ KOLABCONV_ERROR_READ_KOLAB_INVALID_KOLAB_XML,
+ _("Root tag is missing"));
free_i_task(&i_task);
xmlFreeDoc(doc);
return NULL;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]