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



commit 184845d37fa43fbef6b405efee9554b77c757535
Author: Christian Hilberg <hilberg kernelconcepts de>
Date:   Sat Mar 3 19:24:28 2012 +0100

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

 po/POTFILES.in                                     |    4 ++
 src/camel/camel-kolab-imapx-metadata-db.c          |   35 ++++++++++---------
 src/camel/camel-kolab-imapx-metadata.c             |    7 ++--
 src/camel/camel-kolab-session.c                    |    5 ++-
 .../providers/imapx/camel-imapx-extd-folder.c      |    2 +-
 .../providers/imapx/camel-imapx-extd-server.c      |    4 +-
 src/camel/providers/imapx/camel-imapx-metadata.c   |   10 ++---
 7 files changed, 35 insertions(+), 32 deletions(-)
---
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 41e6d29..45cf7a6 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -1,12 +1,16 @@
 # List of source files containing translatable strings.
 src/camel/camel-kolab-imapx-folder.c
+src/camel/camel-kolab-imapx-metadata-db.c
+src/camel/camel-kolab-imapx-metadata.c
 src/camel/camel-kolab-imapx-provider.c
 src/camel/camel-kolab-imapx-store.c
+src/camel/camel-kolab-session.c
 src/camel/providers/imapx/camel-imapx-command.c
 src/camel/providers/imapx/camel-imapx-extd-folder.c
 src/camel/providers/imapx/camel-imapx-extd-server.c
 src/camel/providers/imapx/camel-imapx-extd-store.c
 src/camel/providers/imapx/camel-imapx-folder.c
+src/camel/providers/imapx/camel-imapx-metadata.c
 src/camel/providers/imapx/camel-imapx-provider.c
 src/camel/providers/imapx/camel-imapx-server.c
 src/camel/providers/imapx/camel-imapx-store.c
diff --git a/src/camel/camel-kolab-imapx-metadata-db.c b/src/camel/camel-kolab-imapx-metadata-db.c
index 75206fa..56c7105 100644
--- a/src/camel/camel-kolab-imapx-metadata-db.c
+++ b/src/camel/camel-kolab-imapx-metadata-db.c
@@ -47,6 +47,7 @@
 #endif
 
 #include <string.h>
+#include <glib/gi18n-lib.h>
 
 /* Kolab error reporting */
 #include <libekolabutil/kolab-util-error.h>
@@ -151,8 +152,8 @@ camel_kolab_imapx_metadata_db_table_exists (CamelKolabImapxMetadataDb *mdb,
 		g_set_error (err,
 		             KOLAB_CAMEL_KOLAB_ERROR,
 		             KOLAB_CAMEL_KOLAB_ERROR_DB,
-		             "%s: %s",
-		             __func__, sqlite3_errmsg (mdb->db));
+		             _("SQLite Error: %s"),
+		             sqlite3_errmsg (mdb->db));
 		return FALSE;
 	}
 
@@ -161,7 +162,7 @@ camel_kolab_imapx_metadata_db_table_exists (CamelKolabImapxMetadataDb *mdb,
 		g_set_error (err,
 		             KOLAB_CAMEL_KOLAB_ERROR,
 		             KOLAB_CAMEL_KOLAB_ERROR_DB,
-		             "%s: multiple table [%s], corrupted [%s]",
+		             _("SQLite Error: Multiple tables named %s, corrupted database %s"),
 		             __func__, name, mdb->path);
 		return FALSE;
 	}
@@ -201,8 +202,8 @@ camel_kolab_imapx_metadata_db_table_create (CamelKolabImapxMetadataDb *mdb,
 		g_set_error (err,
 		             KOLAB_CAMEL_KOLAB_ERROR,
 		             KOLAB_CAMEL_KOLAB_ERROR_DB,
-		             "%s: %s",
-		             __func__, sqlite3_errmsg (mdb->db));
+		             _("SQLite Error: %s"),
+		             sqlite3_errmsg (mdb->db));
 		return FALSE;
 	}
 
@@ -255,8 +256,8 @@ camel_kolab_imapx_metadata_db_open (CamelKolabImapxMetadataDb *mdb,
 		g_set_error (err,
 		             KOLAB_CAMEL_KOLAB_ERROR,
 		             KOLAB_CAMEL_KOLAB_ERROR_DB,
-		             "%s: could not open/create sqlite db for [%s]",
-		             __func__, filename);
+		             _("SQLite Error: could not open/create SQLite database %s"),
+		             filename);
 		g_free (filename);
 		return FALSE;
 	}
@@ -316,8 +317,8 @@ camel_kolab_imapx_metadata_db_close (CamelKolabImapxMetadataDb *mdb,
 			g_set_error (err,
 			             KOLAB_CAMEL_KOLAB_ERROR,
 			             KOLAB_CAMEL_KOLAB_ERROR_DB,
-			             "%s: %s",
-			             __func__, sqlite3_errmsg (mdb->db));
+			             _("SQLite Error: %s"),
+			             sqlite3_errmsg (mdb->db));
 			return FALSE;
 		}
 	}
@@ -355,8 +356,8 @@ camel_kolab_imapx_metadata_db_folder_update (CamelKolabImapxMetadataDb *mdb,
 		g_set_error (err,
 		             KOLAB_CAMEL_KOLAB_ERROR,
 		             KOLAB_CAMEL_KOLAB_ERROR_DB,
-		             "%s: %s",
-		             __func__, sqlite3_errmsg (mdb->db));
+		             _("SQLite Error: %s"),
+		             sqlite3_errmsg (mdb->db));
 		return FALSE;
 	}
 
@@ -433,8 +434,8 @@ camel_kolab_imapx_metadata_db_lookup (CamelKolabImapxMetadataDb *mdb,
 			g_set_error (err,
 			             KOLAB_CAMEL_KOLAB_ERROR,
 			             KOLAB_CAMEL_KOLAB_ERROR_DB,
-			             "%s: %s",
-			             __func__, sqlite3_errmsg (mdb->db));
+			             _("SQLite Error: %s"),
+			             sqlite3_errmsg (mdb->db));
 		}
 		sql_errno = sqlite3_finalize (sql_stmt);
 		sqlite3_free (sql_str);
@@ -451,8 +452,8 @@ camel_kolab_imapx_metadata_db_lookup (CamelKolabImapxMetadataDb *mdb,
 		g_set_error (err,
 		             KOLAB_CAMEL_KOLAB_ERROR,
 		             KOLAB_CAMEL_KOLAB_ERROR_DB,
-		             "%s: %s",
-		             __func__, sqlite3_errmsg (mdb->db));
+		             _("SQLite Error: %s"),
+		             sqlite3_errmsg (mdb->db));
 		camel_kolab_imapx_folder_metadata_free (kfmd);
 		return NULL;
 	}
@@ -496,8 +497,8 @@ camel_kolab_imapx_metadata_db_remove_folder (CamelKolabImapxMetadataDb *mdb,
 		g_set_error (err,
 		             KOLAB_CAMEL_KOLAB_ERROR,
 		             KOLAB_CAMEL_KOLAB_ERROR_DB,
-		             "%s: %s",
-		             __func__, sqlite3_errmsg (mdb->db));
+		             _("SQLite Error: %s"),
+		             sqlite3_errmsg (mdb->db));
 		return FALSE;
 	}
 
diff --git a/src/camel/camel-kolab-imapx-metadata.c b/src/camel/camel-kolab-imapx-metadata.c
index bb9b4ff..f7d79db 100644
--- a/src/camel/camel-kolab-imapx-metadata.c
+++ b/src/camel/camel-kolab-imapx-metadata.c
@@ -30,6 +30,7 @@
 #endif
 
 #include <string.h>
+#include <glib/gi18n-lib.h>
 
 #include <libekolabutil/kolab-util-error.h>
 
@@ -92,8 +93,7 @@ camel_kolab_imapx_metadata_folder_metadata_new_from_imapx (CamelImapxMetadataAnn
 		g_set_error (err,
 		             KOLAB_CAMEL_KOLAB_ERROR,
 		             KOLAB_CAMEL_KOLAB_ERROR_FORMAT,
-		             "%s: invalid folder type string encoding",
-		             __func__);
+		             _("Invalid Kolab folder type string encoding"));
 		return NULL;
 	}
 
@@ -105,8 +105,7 @@ camel_kolab_imapx_metadata_folder_metadata_new_from_imapx (CamelImapxMetadataAnn
 		g_set_error (err,
 		             KOLAB_CAMEL_KOLAB_ERROR,
 		             KOLAB_CAMEL_KOLAB_ERROR_TYPE,
-		             "%s: invalid folder type string",
-		             __func__);
+		             _("Invalid Kolab folder type string"));
 		return NULL;
 	}
 
diff --git a/src/camel/camel-kolab-session.c b/src/camel/camel-kolab-session.c
index 51c445e..b54210b 100644
--- a/src/camel/camel-kolab-session.c
+++ b/src/camel/camel-kolab-session.c
@@ -38,6 +38,8 @@
 #include <config.h>
 #endif
 
+#include <glib/gi18n-lib.h>
+
 #include <pk11func.h>
 #include <prtypes.h>
 
@@ -198,8 +200,7 @@ camel_kolab_session_bringup (CamelKolabSession *self,
 		g_set_error (err,
 		             KOLAB_CAMEL_KOLAB_ERROR,
 		             KOLAB_CAMEL_KOLAB_ERROR_GENERIC,
-		             "%s: data dir not configured",
-		             __func__);
+		             _("Camel data directory not configured"));
 		return FALSE;
 	}
 
diff --git a/src/camel/providers/imapx/camel-imapx-extd-folder.c b/src/camel/providers/imapx/camel-imapx-extd-folder.c
index 0637b38..90e2be1 100644
--- a/src/camel/providers/imapx/camel-imapx-extd-folder.c
+++ b/src/camel/providers/imapx/camel-imapx-extd-folder.c
@@ -441,7 +441,7 @@ camel_imapx_extd_folder_new (CamelIMAPXExtdStore *store,
 	ifolder->cache = camel_data_cache_new (folder_dir, err);
 	if (!ifolder->cache) {
 		g_prefix_error (err,
-		                _("Could not create cache for %s: "),
+		                _("Could not create cache for %s"),
 		                short_name);
 		return NULL;
 	}
diff --git a/src/camel/providers/imapx/camel-imapx-extd-server.c b/src/camel/providers/imapx/camel-imapx-extd-server.c
index c827649..705bde6 100644
--- a/src/camel/providers/imapx/camel-imapx-extd-server.c
+++ b/src/camel/providers/imapx/camel-imapx-extd-server.c
@@ -824,7 +824,7 @@ extd_server_connect_to_server (CamelIMAPXExtdServer *self,
 			success = FALSE;
 			goto exit;
 		}
-
+y
 		tok = camel_imapx_stream_token (is->stream, &token, &len, cancellable, error);
 		if (tok < 0) {
 			success = FALSE;
@@ -1209,7 +1209,7 @@ imapx_extd_server_connect (CamelIMAPXServer *self,
 	g_return_val_if_fail (err == NULL || *err == NULL, FALSE);
 
 	if (self->state == IMAPX_SHUTDOWN) {
-		g_set_error (err, CAMEL_SERVICE_ERROR, CAMEL_SERVICE_ERROR_UNAVAILABLE, "Shutting down");
+		g_set_error (err, CAMEL_SERVICE_ERROR, CAMEL_SERVICE_ERROR_UNAVAILABLE, _("Shutting down"));
 		return FALSE;
 	}
 
diff --git a/src/camel/providers/imapx/camel-imapx-metadata.c b/src/camel/providers/imapx/camel-imapx-metadata.c
index 0986cf7..6269e6c 100644
--- a/src/camel/providers/imapx/camel-imapx-metadata.c
+++ b/src/camel/providers/imapx/camel-imapx-metadata.c
@@ -31,6 +31,7 @@
 #endif
 
 #include <string.h>
+#include <glib/gi18n-lib.h>
 
 /* Kolab error reporting */
 #include <libekolabutil/kolab-util-error.h>
@@ -507,8 +508,7 @@ camel_imapx_metadata_add_from_server_response (CamelImapxMetadata *md,
 		g_set_error (err,
 		             KOLAB_CAMEL_ERROR,
 		             KOLAB_CAMEL_ERROR_GENERIC,
-		             "%s: invalid annotation protocol",
-		             __func__);
+		             _("Invalid IMAP annotation protocol"));
 		return FALSE;
 	default:
 		/* can't happen... */
@@ -731,8 +731,7 @@ camel_imapx_metadata_spec_new (camel_imapx_metadata_proto_t proto,
 			g_set_error (err,
 			             KOLAB_CAMEL_ERROR,
 			             KOLAB_CAMEL_ERROR_GENERIC,
-			             "%s: invalid token in meta data spec",
-			             __func__);
+			             _("Invalid token in meta data string"));
 			return NULL;
 		}
 		break;
@@ -760,8 +759,7 @@ camel_imapx_metadata_spec_new (camel_imapx_metadata_proto_t proto,
 			g_set_error (err,
 			             KOLAB_CAMEL_ERROR,
 			             KOLAB_CAMEL_ERROR_GENERIC,
-			             "%s: invalid token in meta data spec",
-			             __func__);
+			             _("Invalid token in meta data string"));
 			return NULL;
 		}
 		break;



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