[evolution-kolab/ek-wip-porting] libekolabutil: added translatable strings



commit d8f87135b88edb731b38b69837aac27edad4aca8
Author: Christian Hilberg <hilberg kernelconcepts de>
Date:   Mon Mar 5 14:17:17 2012 +0100

    libekolabutil: added translatable strings
    
    * marked GError messages as translatable strings
    * added new files to POTFILES.in

 po/POTFILES.in                        |    4 +++
 src/libekolabutil/kolab-util-camel.c  |   11 +++++----
 src/libekolabutil/kolab-util-http.c   |   11 +++++++--
 src/libekolabutil/kolab-util-sqlite.c |   35 +++++++++++++++++---------------
 4 files changed, 37 insertions(+), 24 deletions(-)
---
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 49f17be..fd89003 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -35,3 +35,7 @@ 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
+src/camel/camel-kolab-imapx-metadata-db.c
+src/libekolabutil/kolab-util-camel.c
+src/libekolabutil/kolab-util-http.c
+src/libekolabutil/kolab-util-sqlite.c
diff --git a/src/libekolabutil/kolab-util-camel.c b/src/libekolabutil/kolab-util-camel.c
index 8a5db8e..f085478 100644
--- a/src/libekolabutil/kolab-util-camel.c
+++ b/src/libekolabutil/kolab-util-camel.c
@@ -25,6 +25,10 @@
 
 /*----------------------------------------------------------------------------*/
 
+#include <config.h>
+
+#include <glib/gi18n-lib.h>
+
 #include <e-util/e-util.h>
 
 #include "camel-system-headers.h"
@@ -53,8 +57,7 @@ kolab_util_camel_init (GError **err)
 		g_set_error (err,
 			     KOLAB_CAMEL_ERROR,
 			     KOLAB_CAMEL_ERROR_GENERIC,
-			     "%s: failed to init camel subsystem",
-			     __func__);
+		             _("Failed to init Camel subsystem"));
 		return FALSE;
 	}
 
@@ -125,9 +128,7 @@ kolab_util_camel_get_storage_path (CamelService *service,
 		g_set_error (err,
 			     KOLAB_CAMEL_KOLAB_ERROR,
 			     KOLAB_CAMEL_KOLAB_ERROR_DB,
-			     "%s: could get Camel storage path",
-			     __func__);
-
+		             _("Could get Camel storage path"));
 	}
 #endif
 
diff --git a/src/libekolabutil/kolab-util-http.c b/src/libekolabutil/kolab-util-http.c
index 6c92df6..e38e047 100644
--- a/src/libekolabutil/kolab-util-http.c
+++ b/src/libekolabutil/kolab-util-http.c
@@ -50,7 +50,10 @@
 
 /*----------------------------------------------------------------------------*/
 
+#include <config.h>
+
 #include <glib.h>
+#include <glib/gi18n-lib.h>
 
 #include <camel/camel-kolab-stream.h>
 
@@ -214,7 +217,8 @@ kolab_util_http_soup_get (const KolabUtilHttpJob *job, GError **error)
 		g_set_error (error,
 		             KOLAB_UTIL_HTTP_ERROR,
 		             error_code,
-		             "libsoup failed with status %u", status);
+		             _("Libsoup failed with status %u"),
+		             status);
 	}
 
 	return nbytes;
@@ -374,7 +378,8 @@ kolab_util_http_curl_get (KolabUtilHttpJob *job, GError **error)
 		g_set_error (error,
 		             KOLAB_UTIL_HTTP_ERROR,
 		             KOLAB_UTIL_HTTP_ERROR_CONFIGURATION_ERROR,
-		             "Configuring libcurl failed with CURLcode: %u.", curlcode);
+		             _("Configuring libcurl failed with CURLcode: %u"),
+		             curlcode);
 		return -1;
 	}
 
@@ -395,7 +400,7 @@ kolab_util_http_curl_get (KolabUtilHttpJob *job, GError **error)
 		g_set_error (error,
 		             KOLAB_UTIL_HTTP_ERROR,
 		             error_code,
-		             "Access to %s failed in libcurl with CURLcode: %u",
+		             _("Access to URL '%s' failed in libcurl with CURLcode: %u"),
 		             camel_url_to_string (job->url, CAMEL_URL_HIDE_AUTH), curlcode);
 	}
 	else {
diff --git a/src/libekolabutil/kolab-util-sqlite.c b/src/libekolabutil/kolab-util-sqlite.c
index 696de58..e30504d 100644
--- a/src/libekolabutil/kolab-util-sqlite.c
+++ b/src/libekolabutil/kolab-util-sqlite.c
@@ -25,6 +25,10 @@
 
 /*----------------------------------------------------------------------------*/
 
+#include <config.h>
+
+#include <glib/gi18n-lib.h>
+
 #include "kolab-util-error.h"
 #include "kolab-util-sqlite.h"
 
@@ -70,8 +74,7 @@ kolab_util_sqlite_open_trycreate (const gchar *path,
 		g_set_error (err,
 		             KOLAB_UTIL_ERROR,
 		             KOLAB_UTIL_ERROR_SQLITE_DB,
-		             "%s: %s",
-		             __func__,
+		             _("SQLite Error: %s"),
 		             sqlite3_errmsg (db));
 		(void)sqlite3_close (db);
 		return NULL;
@@ -113,8 +116,8 @@ kolab_util_sqlite_exec_str_full (KolabUtilSqliteDb *kdb,
 		g_set_error (err,
 		             KOLAB_UTIL_ERROR,
 		             KOLAB_UTIL_ERROR_SQLITE_DB,
-			     "%s: %s",
-		             __func__, sqlite3_errmsg (kdb->db));
+		             _("SQLite Error: %s"),
+		             sqlite3_errmsg (kdb->db));
 		return FALSE;
 	}
 	return TRUE;
@@ -185,8 +188,8 @@ kolab_util_sqlite_db_open (KolabUtilSqliteDb *kdb,
 		g_set_error (err,
 		             KOLAB_UTIL_ERROR,
 		             KOLAB_UTIL_ERROR_SQLITE_DB,
-		             "%s: could not create full DB path for (%s) filename (%s)",
-		             __func__, dbpath, filename);
+		             _("Could not create full DB path for database '%s' filename '%s'"),
+		             dbpath, filename);
 		return FALSE;
 	}
 
@@ -236,8 +239,8 @@ kolab_util_sqlite_db_close (KolabUtilSqliteDb *kdb,
 			g_set_error (err,
 			             KOLAB_UTIL_ERROR,
 			             KOLAB_UTIL_ERROR_SQLITE_DB,
-				     "%s: %s",
-				     __func__, sqlite3_errmsg (kdb->db));
+			             _("SQLite Error: %s"),
+				     sqlite3_errmsg (kdb->db));
 			return FALSE;
 		}
 		kdb->db = NULL;
@@ -281,8 +284,8 @@ kolab_util_sqlite_table_exists (KolabUtilSqliteDb *kdb,
 		g_set_error (err,
 		             KOLAB_UTIL_ERROR,
 		             KOLAB_UTIL_ERROR_SQLITE_DB,
-			     "%s: multiple table [%s], corrupted [%s]",
-		             __func__, name, kdb->path);
+		             _("SQLite Error: Multiple tables named '%s', corrupted database '%s'"),
+		             name, kdb->path);
 		return FALSE;
 	}
 
@@ -352,8 +355,8 @@ kolab_util_sqlite_table_get_rowcount (KolabUtilSqliteDb *kdb,
 		g_set_error (err,
 		             KOLAB_UTIL_ERROR,
 		             KOLAB_UTIL_ERROR_SQLITE_DB,
-			     "%s: %s",
-			     __func__, sqlite3_errmsg (kdb->db));
+		             _("SQLite Error: %s"),
+			     sqlite3_errmsg (kdb->db));
 		(void)kolab_util_sqlite_fnlz_stmt (kdb, sql_stmt, NULL);
 		return -1;
 	}
@@ -398,8 +401,8 @@ kolab_util_sqlite_prep_stmt (KolabUtilSqliteDb *kdb,
 		g_set_error (err,
 		             KOLAB_UTIL_ERROR,
 		             KOLAB_UTIL_ERROR_SQLITE_DB,
-			     "%s: %s",
-		             __func__, sqlite3_errmsg (kdb->db));
+		             _("SQLite Error: %s"),
+		             sqlite3_errmsg (kdb->db));
 		return FALSE;
 	}
 	return TRUE;
@@ -423,8 +426,8 @@ kolab_util_sqlite_fnlz_stmt (KolabUtilSqliteDb *kdb,
 		g_set_error (err,
 		             KOLAB_UTIL_ERROR,
 		             KOLAB_UTIL_ERROR_SQLITE_DB,
-			     "%s: %s",
-		             __func__, sqlite3_errmsg (kdb->db));
+		             _("SQLite Error: %s"),
+		             sqlite3_errmsg (kdb->db));
 		return FALSE;
 	}
 	return TRUE;



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