diff options
Diffstat (limited to 'camel')
32 files changed, 216 insertions, 235 deletions
diff --git a/camel/ChangeLog b/camel/ChangeLog index afe13dec41..05a6a0d344 100644 --- a/camel/ChangeLog +++ b/camel/ChangeLog @@ -1,3 +1,10 @@ +2000-10-23 Dan Winship <danw@helixcode.com> + + * camel-object.h: #include gnome-i18n.h (and gnome-defs.h since + the former depends on it.) + + * *: Add lots of _() and N_(). + 2000-10-23 Chris Toshok <toshok@helixcode.com> * providers/nntp/Makefile.am (libcamelnntpinclude_HEADERS): add diff --git a/camel/camel-movemail.c b/camel/camel-movemail.c index b44c9edb1b..ea3fdb3da0 100644 --- a/camel/camel-movemail.c +++ b/camel/camel-movemail.c @@ -93,8 +93,8 @@ camel_movemail (const char *source, const char *dest, CamelException *ex) if (stat (source, &st) == -1) { if (errno != ENOENT) { camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM, - "Could not check mail file " - "%s: %s", source, + _("Could not check mail file " + "%s: %s"), source, g_strerror (errno)); } return; @@ -130,8 +130,9 @@ camel_movemail (const char *source, const char *dest, CamelException *ex) } #endif camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM, - "Could not create lock file " - "for %s: %s", source, g_strerror (errno)); + _("Could not create lock file " + "for %s: %s"), source, + g_strerror (errno)); return; } close (tmpfd); @@ -139,7 +140,7 @@ camel_movemail (const char *source, const char *dest, CamelException *ex) sfd = open (source, O_RDWR); if (sfd == -1) { camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM, - "Could not open mail file %s: %s", + _("Could not open mail file %s: %s"), source, g_strerror (errno)); unlink (locktmpfile); g_free (locktmpfile); @@ -149,8 +150,9 @@ camel_movemail (const char *source, const char *dest, CamelException *ex) dfd = open (dest, O_WRONLY | O_CREAT | O_APPEND, S_IRUSR | S_IWUSR); if (dfd == -1) { camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM, - "Could not open temporary mail " - "file %s: %s", dest, g_strerror (errno)); + _("Could not open temporary mail " + "file %s: %s"), dest, + g_strerror (errno)); close (sfd); unlink (locktmpfile); g_free (locktmpfile); @@ -175,8 +177,8 @@ camel_movemail (const char *source, const char *dest, CamelException *ex) */ if (errno != EEXIST) { camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM, - "Could not create lock " - "file for %s: %s", source, + _("Could not create lock " + "file for %s: %s"), source, g_strerror (errno)); break; } @@ -189,8 +191,8 @@ camel_movemail (const char *source, const char *dest, CamelException *ex) /* Some other error. Abort. */ camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM, - "Could not test lock " - "file for %s: %s", source, + _("Could not test lock " + "file for %s: %s"), source, g_strerror (errno)); break; } @@ -209,9 +211,9 @@ camel_movemail (const char *source, const char *dest, CamelException *ex) /* Something has gone awry. */ if (now >= timeout) { camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM, - "Timed out trying to get " - "lock file on %s. Try again " - "later.", source); + _("Timed out trying to get " + "lock file on %s. Try again " + "later."), source); } g_free (lockfile); unlink (locktmpfile); @@ -235,7 +237,7 @@ camel_movemail (const char *source, const char *dest, CamelException *ex) if (errno == EINTR) continue; camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM, - "Error reading mail file: %s", + _("Error reading mail file: %s"), g_strerror (errno)); break; } @@ -246,8 +248,8 @@ camel_movemail (const char *source, const char *dest, CamelException *ex) if (errno == EINTR) continue; /* continues inner loop */ camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM, - "Error writing " - "mail temp file: %s", + _("Error writing " + "mail temp file: %s"), g_strerror (errno)); break; } @@ -264,8 +266,8 @@ camel_movemail (const char *source, const char *dest, CamelException *ex) ftruncate (sfd, 0); else { camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM, - "Failed to store mail in " - "temp file %s: %s", dest, + _("Failed to store mail in " + "temp file %s: %s"), dest, g_strerror (errno)); } } else @@ -296,7 +298,7 @@ movemail_external (const char *source, const char *dest, CamelException *ex) if (pipe (fd) == -1) { sigprocmask (SIG_SETMASK, &omask, NULL); camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM, - "Could not create pipe: %s", + _("Could not create pipe: %s"), g_strerror (errno)); return; } @@ -308,7 +310,7 @@ movemail_external (const char *source, const char *dest, CamelException *ex) close (fd[1]); sigprocmask (SIG_SETMASK, &omask, NULL); camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM, - "Could not fork: %s", + _("Could not fork: %s"), g_strerror (errno)); return; @@ -346,8 +348,8 @@ movemail_external (const char *source, const char *dest, CamelException *ex) if (!WIFEXITED (status) || WEXITSTATUS (status) != 0) { camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM, - "Movemail program failed: %s", - output ? output : "(Unknown error)"); + _("Movemail program failed: %s"), + output ? output : _("(Unknown error)")); } g_free (output); } diff --git a/camel/camel-object.h b/camel/camel-object.h index fdcf7b4a15..1308e075d5 100644 --- a/camel/camel-object.h +++ b/camel/camel-object.h @@ -35,6 +35,8 @@ extern "C" #include <stdlib.h> /* size_t */ #include <camel/camel-types.h> #include <glib.h> +#include <libgnome/gnome-defs.h> +#include <libgnome/gnome-i18n.h> #ifdef G_DISABLE_CHECKS #define CAMEL_CHECK_CAST( obj, ctype, ptype ) ((ptype *) obj) diff --git a/camel/camel-provider.c b/camel/camel-provider.c index 9b76fc1766..03be7cdf1e 100644 --- a/camel/camel-provider.c +++ b/camel/camel-provider.c @@ -41,11 +41,6 @@ #include <gmodule.h> -char *camel_provider_type_name[CAMEL_NUM_PROVIDER_TYPES] = { - "store", - "transport" -}; - /** * camel_provider_init: * @@ -135,7 +130,7 @@ camel_provider_load (CamelSession *session, const char *path, CamelException *ex module = g_module_open (path, 0); if (!module) { camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM, - "Could not load %s: %s", + _("Could not load %s: %s"), path, g_module_error ()); return; } @@ -143,8 +138,8 @@ camel_provider_load (CamelSession *session, const char *path, CamelException *ex if (!g_module_symbol (module, "camel_provider_module_init", (gpointer *)&camel_provider_module_init)) { camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM, - "Could not load %s: No initialization " - "routine in module.", path); + _("Could not load %s: No initialization " + "code in module."), path); g_module_close (module); return; } diff --git a/camel/camel-remote-store.c b/camel/camel-remote-store.c index 5d1b762fbb..9d4081e344 100644 --- a/camel/camel-remote-store.c +++ b/camel/camel-remote-store.c @@ -150,10 +150,10 @@ camel_remote_store_get_type (void) /* static CamelServiceAuthType password_authtype = { - "SSH Tunneling", + N_("SSH Tunneling"), - "This option will connect to the server using a " - "SSH tunnel.", + N_("This option will connect to the server using a " + "SSH tunnel."), "", TRUE @@ -182,11 +182,11 @@ static char * remote_get_name (CamelService *service, gboolean brief) { if (brief) - return g_strdup_printf ("%s server %s", + return g_strdup_printf (_("%s server %s"), service->provider->name, service->url->host); else { - return g_strdup_printf ("%s service for %s on %s", + return g_strdup_printf (_("%s service for %s on %s"), service->provider->name, service->url->user, service->url->host); @@ -227,8 +227,8 @@ remote_connect (CamelService *service, CamelException *ex) fd = socket (h->h_addrtype, SOCK_STREAM, 0); if (fd == -1 || connect (fd, (struct sockaddr *)&sin, sizeof (sin)) == -1) { camel_exception_setv (ex, CAMEL_EXCEPTION_SERVICE_UNAVAILABLE, - "Could not connect to %s (port %d): %s", - service->url->host ? service->url->host : "(unknown host)", + _("Could not connect to %s (port %d): %s"), + service->url->host ? service->url->host : _("(unknown host)"), port, g_strerror (errno)); if (fd > -1) close (fd); diff --git a/camel/camel-service.c b/camel/camel-service.c index 0449eb9d48..14d086653b 100644 --- a/camel/camel-service.c +++ b/camel/camel-service.c @@ -116,7 +116,7 @@ check_url (CamelService *service, CamelException *ex) (service->url->user == NULL || service->url->user[0] == '\0')) { url_string = camel_url_to_string (service->url, FALSE); camel_exception_setv (ex, CAMEL_EXCEPTION_SERVICE_URL_INVALID, - "URL '%s' needs a username component", + _("URL '%s' needs a username component"), url_string); g_free (url_string); return FALSE; @@ -125,7 +125,7 @@ check_url (CamelService *service, CamelException *ex) (service->url->host == NULL || service->url->host[0] == '\0')) { url_string = camel_url_to_string (service->url, FALSE); camel_exception_setv (ex, CAMEL_EXCEPTION_SERVICE_URL_INVALID, - "URL '%s' needs a host component", + _("URL '%s' needs a host component"), url_string); g_free (url_string); return FALSE; @@ -134,7 +134,7 @@ check_url (CamelService *service, CamelException *ex) (service->url->path == NULL || service->url->path[0] == '\0')) { url_string = camel_url_to_string (service->url, FALSE); camel_exception_setv (ex, CAMEL_EXCEPTION_SERVICE_URL_INVALID, - "URL '%s' needs a path component", + _("URL '%s' needs a path component"), url_string); g_free (url_string); return FALSE; @@ -267,12 +267,7 @@ camel_service_disconnect (CamelService *service, CamelException *ex) { gboolean res; - if (!service->connected) { - camel_exception_set (ex, CAMEL_EXCEPTION_SERVICE_NOT_CONNECTED, - "Trying to disconnect from a service that isn't connected"); - return FALSE; - } - + g_return_val_if_fail (service->connected, FALSE); res = CSERV_CLASS (service)->disconnect (service, ex); service->connected = FALSE; return res; @@ -518,11 +513,11 @@ camel_service_gethost (CamelService *service, CamelException *ex) if (h_errno == HOST_NOT_FOUND || h_errno == NO_DATA) { camel_exception_setv (ex, CAMEL_EXCEPTION_SERVICE_URL_INVALID, - "No such host %s.", hostname); + _("No such host %s."), hostname); } else { camel_exception_setv (ex, CAMEL_EXCEPTION_SERVICE_UNAVAILABLE, - "Temporarily unable to look up " - "hostname %s.", hostname); + _("Temporarily unable to look " + "up hostname %s."), hostname); } return NULL; } diff --git a/camel/camel-session.c b/camel/camel-session.c index 6f6896c885..3e2424a401 100644 --- a/camel/camel-session.c +++ b/camel/camel-session.c @@ -267,8 +267,7 @@ camel_session_get_service (CamelSession *session, const char *url_string, if (!provider || !provider->object_types[type]) { camel_exception_setv (ex, CAMEL_EXCEPTION_SERVICE_URL_INVALID, - "No %s available for protocol `%s'", - camel_provider_type_name[type], + _("No provider available for protocol `%s'"), url->protocol); camel_url_free (url); return NULL; @@ -356,7 +355,7 @@ camel_session_get_storage_path (CamelSession *session, CamelService *service, if (e_mkdir_hier (path, S_IRWXU) == -1) { camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM, - "Could not create directory %s:\n%s", + _("Could not create directory %s:\n%s"), path, g_strerror (errno)); g_free (path); return NULL; diff --git a/camel/camel-store.c b/camel/camel-store.c index fd3e7c83cf..706ade9b97 100644 --- a/camel/camel-store.c +++ b/camel/camel-store.c @@ -144,14 +144,12 @@ delete_folder (CamelStore *store, const char *folder_name, CamelException *ex) camel_type_to_name (CAMEL_OBJECT_GET_TYPE (store))); } -static void rename_folder (CamelStore *store, const char *old_name, - const char *new_name, CamelException *ex) +static void +rename_folder (CamelStore *store, const char *old_name, + const char *new_name, CamelException *ex) { g_warning ("CamelStore::rename_folder not implemented for `%s'", camel_type_to_name (CAMEL_OBJECT_GET_TYPE (store))); - camel_exception_setv(ex, CAMEL_EXCEPTION_SYSTEM, - "rename folder unimplemented for: %s", - camel_type_to_name (CAMEL_OBJECT_GET_TYPE (store))); } diff --git a/camel/camel-url.c b/camel/camel-url.c index e52645c8e2..04c84dc450 100644 --- a/camel/camel-url.c +++ b/camel/camel-url.c @@ -35,6 +35,7 @@ #include <string.h> #include "camel-url.h" #include "camel-exception.h" +#include "camel-object.h" /** * camel_url_new: create a CamelURL object from a string @@ -73,7 +74,7 @@ camel_url_new (const char *url_string, CamelException *ex) colon = strchr (url_string, ':'); if (!colon) { camel_exception_setv (ex, CAMEL_EXCEPTION_SERVICE_URL_INVALID, - "URL string `%s' contains no protocol", + _("URL string `%s' contains no protocol"), url_string); return NULL; } @@ -88,7 +89,7 @@ camel_url_new (const char *url_string, CamelException *ex) if (!((*p >= 'a' && *p <= 'z') || (*p == '-') || (*p == '+') || (*p == '.'))) { camel_exception_setv (ex, CAMEL_EXCEPTION_SERVICE_URL_INVALID, - "URL string `%s' contains an invalid protocol", + _("URL string `%s' contains an invalid protocol"), url_string); return NULL; } @@ -149,8 +150,8 @@ camel_url_new (const char *url_string, CamelException *ex) url->port = strtoul (colon + 1, &colon, 10); if (*colon && colon != slash) { camel_exception_setv (ex, CAMEL_EXCEPTION_SERVICE_URL_INVALID, - "Port number in URL `%s' is non-" - "numeric", url_string); + _("Port number in URL `%s' is non-" + "numeric"), url_string); camel_url_free (url); return NULL; } diff --git a/camel/providers/imap/camel-imap-command.c b/camel/providers/imap/camel-imap-command.c index 932bccfde8..9f79db5020 100644 --- a/camel/providers/imap/camel-imap-command.c +++ b/camel/providers/imap/camel-imap-command.c @@ -217,16 +217,16 @@ imap_read_response (CamelImapStore *store, CamelException *ex) g_warning ("Unexpected response from IMAP server: %s", respbuf); camel_exception_setv (ex, CAMEL_EXCEPTION_SERVICE_UNAVAILABLE, - "Unexpected response from IMAP server: " - "%s", respbuf); + _("Unexpected response from IMAP " + "server: %s"), respbuf); camel_imap_response_free (response); return NULL; } retcode = imap_next_word (retcode); camel_exception_setv (ex, CAMEL_EXCEPTION_SERVICE_UNAVAILABLE, - "IMAP command failed: %s", - retcode ? retcode : "Unknown error"); + _("IMAP command failed: %s"), + retcode ? retcode : _("Unknown error")); camel_imap_response_free (response); return NULL; } @@ -367,8 +367,8 @@ camel_imap_response_extract (CamelImapResponse *response, const char *type, } else { resp = NULL; camel_exception_setv (ex, CAMEL_EXCEPTION_SERVICE_UNAVAILABLE, - "IMAP server response did not contain " - "%s information", type); + _("IMAP server response did not contain " + "%s information"), type); } g_ptr_array_free (response->untagged, TRUE); @@ -403,7 +403,7 @@ camel_imap_response_extract_continuation (CamelImapResponse *response, } camel_exception_setv (ex, CAMEL_EXCEPTION_SERVICE_UNAVAILABLE, - "Unexpected OK response from IMAP server: %s", + _("Unexpected OK response from IMAP server: %s"), response->status); camel_imap_response_free (response); return NULL; diff --git a/camel/providers/imap/camel-imap-folder.c b/camel/providers/imap/camel-imap-folder.c index 0a4189372a..46d80c6e29 100644 --- a/camel/providers/imap/camel-imap-folder.c +++ b/camel/providers/imap/camel-imap-folder.c @@ -216,7 +216,7 @@ camel_imap_folder_new (CamelStore *parent, const char *folder_name, if (!imap_folder->summary) { camel_object_unref (CAMEL_OBJECT (folder)); camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM, - "Could not load summary for %s", + _("Could not load summary for %s"), folder_name); return NULL; } @@ -575,8 +575,8 @@ imap_get_message (CamelFolder *folder, const gchar *uid, CamelException *ex) } if (!p) { camel_exception_setv (ex, CAMEL_EXCEPTION_SERVICE_UNAVAILABLE, - "Could not find message body in FETCH " - "response."); + _("Could not find message body in FETCH " + "response.")); g_free (result); return NULL; } diff --git a/camel/providers/imap/camel-imap-provider.c b/camel/providers/imap/camel-imap-provider.c index 21452d5cee..a94daa3e19 100644 --- a/camel/providers/imap/camel-imap-provider.c +++ b/camel/providers/imap/camel-imap-provider.c @@ -36,9 +36,9 @@ static gint imap_url_equal (gconstpointer a, gconstpointer b); static CamelProvider imap_provider = { "imap", - "IMAPv4", + N_("IMAPv4"), - "For reading and storing mail on IMAP servers.", + N_("For reading and storing mail on IMAP servers."), "mail", diff --git a/camel/providers/imap/camel-imap-store.c b/camel/providers/imap/camel-imap-store.c index 80dc8dcd3c..a731ac9a68 100644 --- a/camel/providers/imap/camel-imap-store.c +++ b/camel/providers/imap/camel-imap-store.c @@ -136,10 +136,10 @@ camel_imap_store_get_type (void) } static CamelServiceAuthType password_authtype = { - "Password", + N_("Password"), - "This option will connect to the IMAP server using a " - "plaintext password.", + N_("This option will connect to the IMAP server using a " + "plaintext password."), "", TRUE @@ -163,9 +163,9 @@ query_auth_types_connected (CamelService *service, CamelException *ex) if (!ret) { camel_exception_setv (ex, CAMEL_EXCEPTION_SERVICE_UNAVAILABLE, - "Could not connect to IMAP server on %s.", + _("Could not connect to IMAP server on %s."), service->url->host ? service->url->host : - "(unknown host)"); + _("(unknown host)")); } return ret; @@ -227,7 +227,7 @@ imap_connect (CamelService *service, CamelException *ex) if (!service->url->authmech && !service->url->passwd) { gchar *prompt; - prompt = g_strdup_printf ("%sPlease enter the IMAP password for %s@%s", + prompt = g_strdup_printf (_("%sPlease enter the IMAP password for %s@%s"), errbuf ? errbuf : "", service->url->user, service->url->host); service->url->passwd = camel_session_query_authenticator (session, @@ -238,7 +238,7 @@ imap_connect (CamelService *service, CamelException *ex) errbuf = NULL; if (!service->url->passwd) { - camel_exception_set (ex, CAMEL_EXCEPTION_USER_CANCEL, + camel_exception_set (ex, CAMEL_EXCEPTION_USER_CANCEL, "You didn\'t enter a password."); return FALSE; } @@ -249,12 +249,10 @@ imap_connect (CamelService *service, CamelException *ex) service->url->user, service->url->passwd); if (!response) { - errbuf = g_strdup_printf ("Unable to authenticate to IMAP server.\n" - "%s\n\n", + errbuf = g_strdup_printf (_("Unable to authenticate to IMAP server.\n%s\n\n"), camel_exception_get_description (ex)); camel_exception_clear (ex); } else { - g_message ("IMAP Service sucessfully authenticated user %s", service->url->user); authenticated = TRUE; camel_imap_response_free (response); } @@ -456,7 +454,7 @@ get_folder (CamelStore *store, const char *folder_name, guint32 flags, CamelExce summary_file, ex); } else { camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM, - "Could not create directory %s: %s", + _("Could not create directory %s: %s"), summary_file, g_strerror (errno)); } g_free (summary_file); diff --git a/camel/providers/mbox/camel-mbox-folder.c b/camel/providers/mbox/camel-mbox-folder.c index 9f8dcce3c0..b7d97ca56b 100644 --- a/camel/providers/mbox/camel-mbox-folder.c +++ b/camel/providers/mbox/camel-mbox-folder.c @@ -217,7 +217,7 @@ camel_mbox_folder_new(CamelStore *parent_store, const char *full_name, guint32 f mbox_folder->folder_file_path, mbox_folder->index); if (mbox_folder->summary == NULL || camel_mbox_summary_load(mbox_folder->summary, forceindex) == -1) { camel_exception_set(ex, CAMEL_EXCEPTION_FOLDER_INVALID, /* FIXME: right error code */ - "Could not create summary"); + _("Could not create summary")); camel_object_unref (CAMEL_OBJECT (folder)); return NULL; } @@ -380,10 +380,10 @@ mbox_append_message(CamelFolder *folder, CamelMimeMessage * message, const Camel fail: if (camel_exception_is_set(ex)) { camel_exception_setv(ex, camel_exception_get_id(ex), - "Cannot append message to mbox file: %s", camel_exception_get_description(ex)); + _("Cannot append message to mbox file: %s"), camel_exception_get_description(ex)); } else { camel_exception_setv(ex, CAMEL_EXCEPTION_SYSTEM, - "Cannot append message to mbox file: %s", g_strerror(errno)); + _("Cannot append message to mbox file: %s"), g_strerror(errno)); } if (filter_stream) { /*camel_stream_close (filter_stream); */ @@ -486,7 +486,7 @@ mbox_get_message(CamelFolder *folder, const gchar * uid, CamelException *ex) return message; fail: - camel_exception_setv(ex, CAMEL_EXCEPTION_FOLDER_INVALID_UID, "Cannot get message: %s", g_strerror(errno)); + camel_exception_setv(ex, CAMEL_EXCEPTION_FOLDER_INVALID_UID, _("Cannot get message: %s"), g_strerror(errno)); if (parser) camel_object_unref(CAMEL_OBJECT(parser)); diff --git a/camel/providers/mbox/camel-mbox-provider.c b/camel/providers/mbox/camel-mbox-provider.c index d4048e1be3..3130a3ffd9 100644 --- a/camel/providers/mbox/camel-mbox-provider.c +++ b/camel/providers/mbox/camel-mbox-provider.c @@ -31,10 +31,10 @@ static CamelProvider mbox_provider = { "mbox", - "UNIX mbox-format mail files", + N_("UNIX mbox-format mail files"), - "For reading mail delivered by the local system, and for " - "storing mail on local disk.", + N_("For reading mail delivered by the local system, and for " + "storing mail on local disk."), "mail", diff --git a/camel/providers/mbox/camel-mbox-store.c b/camel/providers/mbox/camel-mbox-store.c index 2625722134..68ecfd229e 100644 --- a/camel/providers/mbox/camel-mbox-store.c +++ b/camel/providers/mbox/camel-mbox-store.c @@ -118,15 +118,14 @@ get_folder(CamelStore *store, const char *folder_name, guint32 flags, CamelExcep if (errno != ENOENT) { camel_exception_setv(ex, CAMEL_EXCEPTION_SYSTEM, - "Could not open file `%s':" - "\n%s", name, - g_strerror(errno)); + _("Could not open file `%s':\n%s"), + name, g_strerror(errno)); g_free(name); return NULL; } if ((flags & CAMEL_STORE_FOLDER_CREATE) == 0) { camel_exception_setv(ex, CAMEL_EXCEPTION_STORE_NO_FOLDER, - "Folder `%s' does not exist.", + _("Folder `%s' does not exist."), folder_name); g_free(name); return NULL; @@ -135,9 +134,8 @@ get_folder(CamelStore *store, const char *folder_name, guint32 flags, CamelExcep fd = open(name, O_WRONLY | O_CREAT | O_APPEND, 0600); if (fd == -1) { camel_exception_setv(ex, CAMEL_EXCEPTION_SYSTEM, - "Could not create file `%s':" - "\n%s", name, - g_strerror(errno)); + _("Could not create file `%s':\n%s"), + name, g_strerror(errno)); g_free(name); return NULL; } @@ -145,7 +143,7 @@ get_folder(CamelStore *store, const char *folder_name, guint32 flags, CamelExcep close(fd); } else if (!S_ISREG(st.st_mode)) { camel_exception_setv(ex, CAMEL_EXCEPTION_STORE_NO_FOLDER, - "`%s' is not a regular file.", + _("`%s' is not a regular file."), name); g_free(name); return NULL; @@ -171,7 +169,7 @@ delete_folder (CamelStore *store, const char *folder_name, CamelException *ex) } camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM, - "Could not delete folder `%s':\n%s", + _("Could not delete folder `%s':\n%s"), folder_name, g_strerror (errno)); g_free (name); return; @@ -179,14 +177,14 @@ delete_folder (CamelStore *store, const char *folder_name, CamelException *ex) if (!S_ISREG (st.st_mode)) { camel_exception_setv (ex, CAMEL_EXCEPTION_STORE_NO_FOLDER, - "`%s' is not a regular file.", name); + _("`%s' is not a regular file."), name); g_free (name); return; } if (st.st_size != 0) { camel_exception_setv (ex, CAMEL_EXCEPTION_FOLDER_NON_EMPTY, - "Folder `%s' is not empty. Not deleted.", + _("Folder `%s' is not empty. Not deleted."), folder_name); g_free (name); return; @@ -207,7 +205,7 @@ delete_folder (CamelStore *store, const char *folder_name, CamelException *ex) if (status == -1 && errno != ENOENT) { camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM, - "Could not delete folder `%s':\n%s", + _("Could not delete folder `%s':\n%s"), folder_name, g_strerror (errno)); } } @@ -224,7 +222,7 @@ static int xrename(const char *oldp, const char *newp, const char *prefix, const /* FIXME: this has races ... */ if (!(stat(new, &st) == -1 && errno==ENOENT)) { camel_exception_setv(ex, CAMEL_EXCEPTION_SYSTEM, - "Could not rename folder %s to %s: destination exists", + _("Could not rename folder %s to %s: destination exists"), old, new); } else if (rename(old, new) == 0 || errno==ENOENT) { ret = 0; @@ -232,7 +230,6 @@ static int xrename(const char *oldp, const char *newp, const char *prefix, const /* for nfs, check if the rename worked anyway ... */ ret = 0; } - printf("success = %d\n", ret); g_free(old); g_free(new); @@ -263,7 +260,7 @@ get_folder_name (CamelStore *store, const char *folder_name, CamelException *ex) /* For now, we don't allow hieararchy. FIXME. */ if (strchr (folder_name + 1, '/')) { camel_exception_set (ex, CAMEL_EXCEPTION_STORE_NO_FOLDER, - "Mbox folders may not be nested."); + _("Mbox folders may not be nested.")); return NULL; } @@ -277,7 +274,7 @@ get_name (CamelService *service, gboolean brief) if (brief) return g_strdup (service->url->path); else - return g_strdup_printf ("Local mail file %s", service->url->path); + return g_strdup_printf (_("Local mail file %s"), service->url->path); } static CamelFolderInfo * diff --git a/camel/providers/mbox/camel-mbox-summary.c b/camel/providers/mbox/camel-mbox-summary.c index c037b6000e..93e634084a 100644 --- a/camel/providers/mbox/camel-mbox-summary.c +++ b/camel/providers/mbox/camel-mbox-summary.c @@ -647,7 +647,7 @@ camel_mbox_summary_sync(CamelMboxSummary *mbs, gboolean expunge, CamelException fd = open(mbs->folder_path, O_RDWR); if (fd == -1) { camel_exception_setv(ex, CAMEL_EXCEPTION_SYSTEM, - "Could not open summary %s", mbs->folder_path); + _("Could not open summary %s"), mbs->folder_path); return -1; } @@ -668,7 +668,7 @@ camel_mbox_summary_sync(CamelMboxSummary *mbs, gboolean expunge, CamelException tmpname = NULL; camel_exception_setv(ex, CAMEL_EXCEPTION_SYSTEM, - "Cannot open temporary mailbox: %s", strerror(errno)); + _("Cannot open temporary mailbox: %s"), strerror(errno)); goto error; } } @@ -712,7 +712,7 @@ camel_mbox_summary_sync(CamelMboxSummary *mbs, gboolean expunge, CamelException if (camel_mime_parser_tell_start_from (mp) != info->frompos) { g_warning("Summary/mbox mismatch, aborting sync"); camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM, - "Summary mismatch, aborting sync"); + _("Summary mismatch, aborting sync")); goto error; } @@ -732,7 +732,7 @@ camel_mbox_summary_sync(CamelMboxSummary *mbs, gboolean expunge, CamelException if (!xevok) { g_warning("The summary told me I had an X-Evolution header, but i dont!"); camel_exception_setv(ex, CAMEL_EXCEPTION_SYSTEM, - "Summary mismatch, X-Evolution header missing"); + _("Summary mismatch, X-Evolution header missing")); goto error; } buffer = g_strdup_printf("X-Evolution: %s", xevnew); @@ -754,7 +754,7 @@ camel_mbox_summary_sync(CamelMboxSummary *mbs, gboolean expunge, CamelException if (header_write(fdout, camel_mime_parser_headers_raw(mp), xevnew) == -1) { d(printf("Error writing to tmp mailbox\n")); camel_exception_setv(ex, CAMEL_EXCEPTION_SYSTEM, - "Error writing to temp mailbox: %s", + _("Error writing to temp mailbox: %s"), strerror(errno)); goto error; } @@ -767,7 +767,7 @@ camel_mbox_summary_sync(CamelMboxSummary *mbs, gboolean expunge, CamelException info->info.content->endpos - info->info.content->bodypos) == -1) { g_warning("Cannot copy data to output fd"); camel_exception_setv(ex, CAMEL_EXCEPTION_SYSTEM, - "Cannot copy data to output fd: %s", + _("Cannot copy data to output file: %s"), strerror (errno)); goto error; } @@ -785,7 +785,7 @@ camel_mbox_summary_sync(CamelMboxSummary *mbs, gboolean expunge, CamelException info->info.content->endpos - info->frompos) == -1) { g_warning("Cannot copy data to output fd"); camel_exception_setv(ex, CAMEL_EXCEPTION_SYSTEM, - "Cannot copy data to output fd: %s", + _("Cannot copy data to output file: %s"), strerror(errno)); goto error; } @@ -810,7 +810,7 @@ camel_mbox_summary_sync(CamelMboxSummary *mbs, gboolean expunge, CamelException if (close(fd) == -1) { g_warning("Cannot close source folder: %s", strerror(errno)); camel_exception_setv(ex, CAMEL_EXCEPTION_SYSTEM, - "Could not close source folder %s: %s", + _("Could not close source folder %s: %s"), mbs->folder_path, strerror(errno)); goto error; } @@ -819,7 +819,7 @@ camel_mbox_summary_sync(CamelMboxSummary *mbs, gboolean expunge, CamelException if (close(fdout) == -1) { g_warning("Cannot close tmp folder: %s", strerror(errno)); camel_exception_setv(ex, CAMEL_EXCEPTION_SYSTEM, - "Could not close temp folder: %s", + _("Could not close temp folder: %s"), strerror(errno)); goto error; } @@ -827,7 +827,7 @@ camel_mbox_summary_sync(CamelMboxSummary *mbs, gboolean expunge, CamelException if (rename(tmpname, mbs->folder_path) == -1) { g_warning("Cannot rename folder: %s", strerror(errno)); camel_exception_setv(ex, CAMEL_EXCEPTION_SYSTEM, - "Could not rename folder: %s", + _("Could not rename folder: %s"), strerror(errno)); goto error; } @@ -839,7 +839,7 @@ camel_mbox_summary_sync(CamelMboxSummary *mbs, gboolean expunge, CamelException if (stat(mbs->folder_path, &st) == -1) { camel_exception_setv(ex, CAMEL_EXCEPTION_SYSTEM, - "Unknown error: %s", + _("Unknown error: %s"), strerror(errno)); goto error; } diff --git a/camel/providers/mh/camel-mh-folder.c b/camel/providers/mh/camel-mh-folder.c index ccd9d717e9..5b5c6688d7 100644 --- a/camel/providers/mh/camel-mh-folder.c +++ b/camel/providers/mh/camel-mh-folder.c @@ -208,7 +208,7 @@ camel_mh_folder_new(CamelStore *parent_store, const char *full_name, guint32 fla if (camel_mh_summary_load(mh_folder->summary, forceindex) == -1) { camel_exception_set(ex, CAMEL_EXCEPTION_FOLDER_INVALID, /* FIXME: right error code */ - "Could not load or create summary"); + _("Could not load or create summary")); camel_object_unref (CAMEL_OBJECT (folder)); return NULL; } @@ -327,10 +327,10 @@ static void mh_append_message(CamelFolder * folder, CamelMimeMessage * message, fail: if (camel_exception_is_set(ex)) { camel_exception_setv(ex, camel_exception_get_id(ex), - "Cannot append message to mh file: %s", camel_exception_get_description(ex)); + _("Cannot append message to mh folder: %s"), camel_exception_get_description(ex)); } else { camel_exception_setv(ex, CAMEL_EXCEPTION_SYSTEM, - "Cannot append message to mh file: %s", g_strerror(errno)); + _("Cannot append message to mh folder: %s"), g_strerror(errno)); } if (output_stream) camel_object_unref(CAMEL_OBJECT(output_stream)); @@ -396,7 +396,7 @@ static CamelMimeMessage *mh_get_message(CamelFolder * folder, const gchar * uid, return message; fail: - camel_exception_setv(ex, CAMEL_EXCEPTION_FOLDER_INVALID_UID, "Cannot get message: %s\n %s", + camel_exception_setv(ex, CAMEL_EXCEPTION_FOLDER_INVALID_UID, _("Cannot get message: %s\n %s"), name, g_strerror(errno)); if (message_stream) diff --git a/camel/providers/mh/camel-mh-provider.c b/camel/providers/mh/camel-mh-provider.c index 58e97eed30..25a3522678 100644 --- a/camel/providers/mh/camel-mh-provider.c +++ b/camel/providers/mh/camel-mh-provider.c @@ -31,9 +31,9 @@ static CamelProvider mh_provider = { "mh", - "UNIX mh-format mail files", + N_("UNIX MH-format mail directories"), - "For reading mail delivered by the local system, and for " "storing mail on local disk.", + N_("For storing local mail in MH-like mail directories"), "mail", diff --git a/camel/providers/mh/camel-mh-store.c b/camel/providers/mh/camel-mh-store.c index ead6e4f340..65b1005b85 100644 --- a/camel/providers/mh/camel-mh-store.c +++ b/camel/providers/mh/camel-mh-store.c @@ -109,18 +109,17 @@ static CamelFolder *get_folder(CamelStore * store, const char *folder_name, guin name = g_strdup_printf("%s%s", CAMEL_SERVICE(store)->url->path, folder_name); - printf("getting folder: %s\n", name); if (stat(name, &st) == -1) { - printf("doesn't exist ...\n"); if (errno != ENOENT) { camel_exception_setv(ex, CAMEL_EXCEPTION_SYSTEM, - "Could not open folder `%s':" "\n%s", folder_name, g_strerror(errno)); + _("Could not open folder `%s':\n%s"), + folder_name, g_strerror(errno)); g_free (name); return NULL; } if ((flags & CAMEL_STORE_FOLDER_CREATE) == 0) { camel_exception_setv(ex, CAMEL_EXCEPTION_STORE_NO_FOLDER, - "Folder `%s' does not exist.", folder_name); + _("Folder `%s' does not exist."), folder_name); g_free (name); return NULL; } @@ -128,14 +127,16 @@ static CamelFolder *get_folder(CamelStore * store, const char *folder_name, guin if (mkdir(name, 0700) != 0) { camel_exception_setv(ex, CAMEL_EXCEPTION_SYSTEM, - "Could not create folder `%s':" "\n%s", folder_name, g_strerror(errno)); + _("Could not create folder `%s':\n%s"), + folder_name, g_strerror(errno)); g_free (name); return NULL; } printf("created ok?\n"); } else if (!S_ISDIR(st.st_mode)) { - camel_exception_setv(ex, CAMEL_EXCEPTION_STORE_NO_FOLDER, "`%s' is not a directory.", name); + camel_exception_setv(ex, CAMEL_EXCEPTION_STORE_NO_FOLDER, + _("`%s' is not a directory."), name); g_free (name); return NULL; } @@ -154,7 +155,8 @@ static void delete_folder(CamelStore * store, const char *folder_name, CamelExce if (stat(name, &st) == -1) { if (errno != ENOENT) camel_exception_setv(ex, CAMEL_EXCEPTION_SYSTEM, - "Could not delete folder `%s': %s", folder_name, strerror(errno)); + _("Could not delete folder `%s': %s"), + folder_name, strerror(errno)); } else { /* this will 'fail' if there are still messages in the directory - but only the metadata is lost */ @@ -166,7 +168,8 @@ static void delete_folder(CamelStore * store, const char *folder_name, CamelExce g_free(str); if (rmdir(name) == -1) { camel_exception_setv(ex, CAMEL_EXCEPTION_SYSTEM, - "Could not delete folder `%s': %s", folder_name, strerror(errno)); + _("Could not delete folder `%s': %s"), + folder_name, strerror(errno)); } } g_free(name); @@ -183,15 +186,15 @@ static void rename_folder (CamelStore *store, const char *old_name, const char * if (stat(old, &st) == 0 && S_ISDIR(st.st_mode)) { if (rename(old, new) != 0) { camel_exception_setv(ex, CAMEL_EXCEPTION_SYSTEM, - "Could not rename folder `%s': %s", old_name, strerror(errno)); + _("Could not rename folder `%s': %s"), old_name, strerror(errno)); } } else { camel_exception_setv(ex, CAMEL_EXCEPTION_SYSTEM, - "Could not rename folder `%s': %s", old_name, strerror(errno)); + _("Could not rename folder `%s': %s"), old_name, strerror(errno)); } } else { camel_exception_setv(ex, CAMEL_EXCEPTION_SYSTEM, - "Could not rename folder `%s': %s exists", old_name, new_name); + _("Could not rename folder `%s': %s exists"), old_name, new_name); } } @@ -199,7 +202,7 @@ static char *get_folder_name(CamelStore * store, const char *folder_name, CamelE { /* For now, we don't allow hieararchy. FIXME. */ if (strchr(folder_name + 1, '/')) { - camel_exception_set(ex, CAMEL_EXCEPTION_STORE_NO_FOLDER, "Mh folders may not be nested."); + camel_exception_set(ex, CAMEL_EXCEPTION_STORE_NO_FOLDER, _("MH folders may not be nested.")); return NULL; } @@ -211,7 +214,7 @@ static char *get_name(CamelService * service, gboolean brief) if (brief) return g_strdup(service->url->path); else - return g_strdup_printf("Local mail file %s", service->url->path); + return g_strdup_printf(_("Local mail directory %s"), service->url->path); } diff --git a/camel/providers/nntp/camel-nntp-auth.c b/camel/providers/nntp/camel-nntp-auth.c index 1a7402a339..1f1e6ab2d8 100644 --- a/camel/providers/nntp/camel-nntp-auth.c +++ b/camel/providers/nntp/camel-nntp-auth.c @@ -38,7 +38,7 @@ camel_nntp_auth_authenticate (CamelNNTPStore *store, CamelException *ex) if (!service->url->authmech && !service->url->passwd) { gchar *prompt; - prompt = g_strdup_printf ("Please enter the NNTP password for %s@%s", + prompt = g_strdup_printf (_("Please enter the NNTP password for %s@%s"), service->url->user, service->url->host); service->url->passwd = camel_session_query_authenticator (session, @@ -59,13 +59,13 @@ camel_nntp_auth_authenticate (CamelNNTPStore *store, CamelException *ex) if (resp == NNTP_AUTH_REJECTED) { camel_exception_setv (ex, CAMEL_EXCEPTION_SERVICE_CANT_AUTHENTICATE, - "Server rejected username"); + _("Server rejected username")); goto done; } else if (resp != NNTP_AUTH_CONTINUE) { camel_exception_setv (ex, CAMEL_EXCEPTION_SERVICE_CANT_AUTHENTICATE, - "Failed to send username to server"); + _("Failed to send username to server")); goto done; } @@ -74,7 +74,7 @@ camel_nntp_auth_authenticate (CamelNNTPStore *store, CamelException *ex) if (resp == NNTP_AUTH_REJECTED) { camel_exception_setv (ex, CAMEL_EXCEPTION_SERVICE_CANT_AUTHENTICATE, - "Server rejected username/password"); + _("Server rejected username/password")); goto done; } diff --git a/camel/providers/nntp/camel-nntp-folder.c b/camel/providers/nntp/camel-nntp-folder.c index c9fb19373a..e4d53d779f 100644 --- a/camel/providers/nntp/camel-nntp-folder.c +++ b/camel/providers/nntp/camel-nntp-folder.c @@ -137,7 +137,7 @@ nntp_folder_get_message (CamelFolder *folder, const gchar *uid, CamelException * if (status == NNTP_NO_SUCH_ARTICLE) { camel_exception_setv (ex, CAMEL_EXCEPTION_FOLDER_INVALID_UID, - "message %s not found.", + _("Message %s not found."), message_id); return NULL; } @@ -161,7 +161,7 @@ nntp_folder_get_message (CamelFolder *folder, const gchar *uid, CamelException * char *line; if (camel_remote_store_recv_line (CAMEL_REMOTE_STORE (parent_store), &line, ex) < 0) { - g_error ("recv_line failed while building message\n"); + g_warning ("recv_line failed while building message\n"); break; } diff --git a/camel/providers/nntp/camel-nntp-grouplist.c b/camel/providers/nntp/camel-nntp-grouplist.c index ee1da0da6f..98aac2a03b 100644 --- a/camel/providers/nntp/camel-nntp-grouplist.c +++ b/camel/providers/nntp/camel-nntp-grouplist.c @@ -42,7 +42,7 @@ camel_nntp_get_grouplist_from_server (CamelNNTPStore *store, CamelException *ex) if (status != NNTP_LIST_FOLLOWS) { camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM, - "Could not get group list from server."); + _("Could not get group list from server.")); return NULL; } @@ -90,7 +90,7 @@ camel_nntp_get_grouplist_from_file (CamelNNTPStore *store, CamelException *ex) if (fp == NULL) { camel_exception_setv (ex, CAMEL_EXCEPTION_SERVICE_UNAVAILABLE, - "Unable to load grouplist file for %s: %s", + _("Unable to load grouplist file for %s: %s"), CAMEL_SERVICE(store)->url->host, strerror(errno)); return NULL; @@ -99,7 +99,7 @@ camel_nntp_get_grouplist_from_file (CamelNNTPStore *store, CamelException *ex) /* read the time */ if (!fgets (buf, 300, fp)) { camel_exception_setv (ex, CAMEL_EXCEPTION_SERVICE_UNAVAILABLE, - "Unable to load grouplist file for %s: %s", + _("Unable to load grouplist file for %s: %s"), CAMEL_SERVICE(store)->url->host, strerror(errno)); fclose (fp); @@ -148,7 +148,7 @@ camel_nntp_grouplist_save (CamelNNTPGroupList *group_list, CamelException *ex) if (fp == NULL) { camel_exception_setv (ex, CAMEL_EXCEPTION_SERVICE_UNAVAILABLE, - "Unable to save grouplist file for %s: %s", + _("Unable to save grouplist file for %s: %s"), CAMEL_SERVICE(group_list->store)->url->host, strerror(errno)); return; diff --git a/camel/providers/nntp/camel-nntp-provider.c b/camel/providers/nntp/camel-nntp-provider.c index 7041c81c31..59a251a795 100644 --- a/camel/providers/nntp/camel-nntp-provider.c +++ b/camel/providers/nntp/camel-nntp-provider.c @@ -35,10 +35,10 @@ static gint nntp_url_equal (gconstpointer a, gconstpointer b); static CamelProvider news_provider = { "nntp", - "USENET news", + N_("USENET news"), - "This is a provider for reading from and posting to" - "USENET newsgroups.", + N_("This is a provider for reading from and posting to" + "USENET newsgroups."), "news", diff --git a/camel/providers/nntp/camel-nntp-store.c b/camel/providers/nntp/camel-nntp-store.c index 0cd37b29de..9bc59e7150 100644 --- a/camel/providers/nntp/camel-nntp-store.c +++ b/camel/providers/nntp/camel-nntp-store.c @@ -223,7 +223,7 @@ nntp_store_connect (CamelService *service, CamelException *ex) if (!ensure_news_dir_exists(store)) { camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM, - "Could not open directory for news server: %s", + _("Could not open directory for news server: %s"), strerror (errno)); return FALSE; } @@ -284,15 +284,15 @@ nntp_store_get_name (CamelService *service, gboolean brief) if (brief) return g_strdup_printf ("%s", service->url->host); else - return g_strdup_printf ("USENET News via %s", service->url->host); + return g_strdup_printf (_("USENET News via %s"), service->url->host); } static CamelServiceAuthType password_authtype = { - "Password", + N_("Password"), - "This option will authenticate with the NNTP server using a " - "plaintext password.", + N_("This option will authenticate with the NNTP server using a " + "plaintext password."), "", TRUE @@ -330,7 +330,7 @@ nntp_store_get_folder (CamelStore *store, const gchar *folder_name, if (!nntp_store->newsrc) { camel_exception_setv (ex, CAMEL_EXCEPTION_SERVICE_UNAVAILABLE, - "Unable to open or create .newsrc file for %s: %s", + _("Unable to open or create .newsrc file for %s: %s"), CAMEL_SERVICE(store)->url->host, strerror(errno)); return NULL; @@ -496,7 +496,7 @@ nntp_store_get_folder_info (CamelStore *store, const char *top, if (!nntp_store->newsrc) { camel_exception_setv (ex, CAMEL_EXCEPTION_SERVICE_UNAVAILABLE, - "Unable to open or create .newsrc file for %s: %s", + _("Unable to open or create .newsrc file for %s: %s"), CAMEL_SERVICE(store)->url->host, strerror(errno)); return NULL; diff --git a/camel/providers/pop3/camel-pop3-folder.c b/camel/providers/pop3/camel-pop3-folder.c index 7b66c87f26..5cc0609e01 100644 --- a/camel/providers/pop3/camel-pop3-folder.c +++ b/camel/providers/pop3/camel-pop3-folder.c @@ -174,8 +174,9 @@ pop3_refresh_info (CamelFolder *folder, CamelException *ex) if (!uids) { camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM, - "Could not open folder: message " - "listing was incomplete."); + _("Could not open folder: " + "message listing was " + "incomplete.")); return; } } @@ -267,7 +268,7 @@ pop3_get_message (CamelFolder *folder, const char *uid, CamelException *ex) num = uid_to_number (CAMEL_POP3_FOLDER (folder), uid); if (num == -1) { camel_exception_setv (ex, CAMEL_EXCEPTION_FOLDER_INVALID_UID, - "No message with uid %s", uid); + _("No message with uid %s"), uid); return NULL; } @@ -281,8 +282,8 @@ pop3_get_message (CamelFolder *folder, const char *uid, CamelException *ex) if (!body) { CamelService *service = CAMEL_SERVICE (folder->parent_store); camel_exception_setv (ex, CAMEL_EXCEPTION_SERVICE_UNAVAILABLE, - "Could not retrieve message from POP " - "server %s: %s", service->url->host, + _("Could not retrieve message from POP " + "server %s: %s"), service->url->host, camel_exception_get_description (ex)); return NULL; } diff --git a/camel/providers/pop3/camel-pop3-provider.c b/camel/providers/pop3/camel-pop3-provider.c index 52399c99ec..2884cf6238 100644 --- a/camel/providers/pop3/camel-pop3-provider.c +++ b/camel/providers/pop3/camel-pop3-provider.c @@ -31,11 +31,11 @@ static CamelProvider pop3_provider = { "pop", - "POP", + N_("POP"), - "For connecting to POP servers. The POP protocol can also be used " - "to retrieve mail from certain web mail providers and proprietary " - "email systems.", + N_("For connecting to POP servers. The POP protocol can also " + "be used to retrieve mail from certain web mail providers " + "and proprietary email systems."), "mail", diff --git a/camel/providers/pop3/camel-pop3-store.c b/camel/providers/pop3/camel-pop3-store.c index 57af24b7f3..54b5e0dea3 100644 --- a/camel/providers/pop3/camel-pop3-store.c +++ b/camel/providers/pop3/camel-pop3-store.c @@ -23,8 +23,6 @@ * USA */ -#define d(x) - #include "config.h" #include <sys/types.h> @@ -149,10 +147,10 @@ finalize (CamelObject *object) } static CamelServiceAuthType password_authtype = { - "Password", + N_("Password"), - "This option will connect to the POP server using a plaintext " - "password. This is the only option supported by many POP servers.", + N_("This option will connect to the POP server using a plaintext " + "password. This is the only option supported by many POP servers."), "", TRUE @@ -161,9 +159,9 @@ static CamelServiceAuthType password_authtype = { static CamelServiceAuthType apop_authtype = { "APOP", - "This option will connect to the POP server using an encrypted " - "password via the APOP protocol. This may not work for all users " - "even on servers that claim to support it.", + N_("This option will connect to the POP server using an encrypted " + "password via the APOP protocol. This may not work for all users " + "even on servers that claim to support it."), "+APOP", TRUE @@ -173,8 +171,8 @@ static CamelServiceAuthType apop_authtype = { static CamelServiceAuthType kpop_authtype = { "Kerberos 4 (KPOP)", - "This will connect to the POP server and use Kerberos 4 " - "to authenticate to it.", + N_("This will connect to the POP server and use Kerberos 4 " + "to authenticate to it."), "+KPOP", FALSE @@ -217,12 +215,10 @@ connect_to_server (CamelService *service, /*gboolean real, */CamelException *ex) NULL, NULL, "KPOPV0.1"); g_free (hostname); if (status != KSUCCESS) { - /*if (real) {*/ - camel_exception_setv (ex, CAMEL_EXCEPTION_SERVICE_UNAVAILABLE, - "Could not authenticate " - "to KPOP server: %s", - krb_err_txt[status]); - /*}*/ + camel_exception_setv (ex, CAMEL_EXCEPTION_SERVICE_UNAVAILABLE, + _("Could not authenticate to " + "KPOP server: %s"), + krb_err_txt[status]); return FALSE; } @@ -338,8 +334,8 @@ query_auth_types_connected (CamelService *service, CamelException *ex) if (!ret) { camel_exception_setv (ex, CAMEL_EXCEPTION_SERVICE_UNAVAILABLE, - "Could not connect to POP server on " - "%s.", service->url->host); + _("Could not connect to POP server on " + "%s."), service->url->host); } return ret; @@ -392,8 +388,8 @@ pop3_try_authenticate (CamelService *service, gboolean kpop, if (!service->url->passwd) { char *prompt; - prompt = g_strdup_printf ("%sPlease enter the POP3 password " - "for %s@%s", errmsg ? errmsg : "", + prompt = g_strdup_printf (_("%sPlease enter the POP3 password " + "for %s@%s"), errmsg ? errmsg : "", service->url->user, service->url->host); service->url->passwd = camel_session_query_authenticator ( @@ -411,10 +407,10 @@ pop3_try_authenticate (CamelService *service, gboolean kpop, switch (status) { case CAMEL_POP3_ERR: camel_exception_setv (ex, CAMEL_EXCEPTION_SERVICE_CANT_AUTHENTICATE, - "Unable to connect to POP " - "server.\nError sending " - "username: %s", - msg ? msg : "(Unknown)"); + _("Unable to connect to POP " + "server.\nError sending " + "username: %s"), + msg ? msg : _("(Unknown)")); g_free (msg); /*fallll*/ case CAMEL_POP3_FAIL: @@ -441,18 +437,18 @@ pop3_try_authenticate (CamelService *service, gboolean kpop, service->url->user, md5asc); } else { camel_exception_set (ex, CAMEL_EXCEPTION_SERVICE_CANT_AUTHENTICATE, - "Unable to connect to POP server.\n" - "No support for requested authentication " - "mechanism."); + _("Unable to connect to POP server.\n" + "No support for requested " + "authentication mechanism.")); return FALSE; } if (status == CAMEL_POP3_ERR) { camel_exception_setv (ex, CAMEL_EXCEPTION_SERVICE_CANT_AUTHENTICATE, - "Unable to connect to POP server.\n" - "Error sending password: %s", - msg ? msg : "(Unknown)"); - } /*if status == camel_pop3_fail, ex will be set*/ + _("Unable to connect to POP server.\n" + "Error sending password: %s"), + msg ? msg : _("(Unknown)")); + } g_free (msg); return camel_exception_is_set (ex); @@ -496,7 +492,6 @@ pop3_connect (CamelService *service, CamelException *ex) if (res == FALSE) return FALSE; - d(printf ("POP3: Connecting to %s\n", service->url->host)); /*FIXME integrate these functions */ if (!connect_to_server (service, ex)) return FALSE; @@ -538,7 +533,6 @@ pop3_disconnect (CamelService *service, CamelException *ex) if (!CAMEL_SERVICE_CLASS (parent_class)->disconnect (service, ex)) return FALSE; - d(printf ("POP3: Disconnecting from %s\n", service->url->host)); return TRUE; } @@ -557,7 +551,7 @@ get_folder_name (CamelStore *store, const char *folder_name, return g_strdup ("inbox"); else { camel_exception_setv (ex, CAMEL_EXCEPTION_FOLDER_INVALID, - "No such folder `%s'.", folder_name); + _("No such folder `%s'."), folder_name); return NULL; } } @@ -599,13 +593,6 @@ camel_pop3_command (CamelPop3Store *store, char **ret, CamelException *ex, char cmdbuf = g_strdup_vprintf (fmt, ap); va_end (ap); -#if 0 /*remote-store prints output now*/ - if (!strncmp (cmdbuf, "PASS", 4)) - printf ("POP3: >>> PASS xxx\n"); - else - printf ("POP3: >>> %s\n", cmdbuf); -#endif - /* Send the command */ if (camel_remote_store_send_string (CAMEL_REMOTE_STORE (store), ex, "%s\r\n", cmdbuf) < 0) { g_free (cmdbuf); @@ -627,7 +614,6 @@ pop3_get_response (CamelPop3Store *store, char **ret, CamelException *ex) if (camel_remote_store_recv_line (CAMEL_REMOTE_STORE (store), &respbuf, ex) < 0) { if (ret) *ret = NULL; - d(printf ("POP3: !!! %s\n", camel_exception_get_description (ex))); return CAMEL_POP3_FAIL; } @@ -698,12 +684,6 @@ camel_pop3_command_get_additional_data (CamelPop3Store *store, CamelException *e datap = (char *) data->pdata[i]; ptr = (*datap == '.') ? datap + 1 : datap; len = strlen (ptr); -#if 0 /*remote store prints stuff now */ - if (i == data->len - 1) - printf ("POP3: <<<<<< %s\n", ptr); - else if (i == 0) - printf ("POP3: <<<<<< %s...\n", ptr); -#endif memcpy (p, ptr, len); p += len; *p++ = '\n'; diff --git a/camel/providers/sendmail/camel-sendmail-provider.c b/camel/providers/sendmail/camel-sendmail-provider.c index 3b0b35dd72..5fbac10434 100644 --- a/camel/providers/sendmail/camel-sendmail-provider.c +++ b/camel/providers/sendmail/camel-sendmail-provider.c @@ -31,10 +31,10 @@ static CamelProvider sendmail_provider = { "sendmail", - "Sendmail", + N_("Sendmail"), - "For delivering mail by passing it to the \"sendmail\" program " - "on the local system.", + N_("For delivering mail by passing it to the \"sendmail\" program " + "on the local system."), "mail", diff --git a/camel/providers/sendmail/camel-sendmail-transport.c b/camel/providers/sendmail/camel-sendmail-transport.c index c53512ccb4..137c1d32a9 100644 --- a/camel/providers/sendmail/camel-sendmail-transport.c +++ b/camel/providers/sendmail/camel-sendmail-transport.c @@ -102,8 +102,8 @@ _send_internal (CamelMedium *message, char **argv, CamelException *ex) if (pipe (fd) == -1) { camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM, - "Could not create pipe to sendmail: " - "%s: mail not sent", + _("Could not create pipe to sendmail: " + "%s: mail not sent"), g_strerror (errno)); return FALSE; } @@ -119,8 +119,9 @@ _send_internal (CamelMedium *message, char **argv, CamelException *ex) switch (pid) { case -1: camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM, - "Could not fork sendmail: " - "%s: mail not sent", g_strerror (errno)); + _("Could not fork sendmail: " + "%s: mail not sent"), + g_strerror (errno)); sigprocmask (SIG_SETMASK, &omask, NULL); return FALSE; @@ -144,7 +145,7 @@ _send_internal (CamelMedium *message, char **argv, CamelException *ex) || camel_stream_close(out) == -1) { camel_object_unref (CAMEL_OBJECT (out)); camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM, - "Could not send message: %s", + _("Could not send message: %s"), strerror(errno)); return FALSE; } @@ -157,19 +158,20 @@ _send_internal (CamelMedium *message, char **argv, CamelException *ex) if (!WIFEXITED (wstat)) { camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM, - "sendmail exited with signal %s: " - "mail not sent.", + _("sendmail exited with signal %s: " + "mail not sent."), g_strsignal (WTERMSIG (wstat))); return FALSE; } else if (WEXITSTATUS (wstat) != 0) { if (WEXITSTATUS (wstat) == 255) { - camel_exception_set (ex, CAMEL_EXCEPTION_SYSTEM, - "Could not execute " - SENDMAIL_PATH ": mail not sent."); + camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM, + _("Could not execute %s: " + "mail not sent."), + SENDMAIL_PATH); } else { camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM, - "sendmail exited with status " - "%d: mail not sent.", + _("sendmail exited with status " + "%d: mail not sent."), WEXITSTATUS (wstat)); } return FALSE; @@ -215,7 +217,7 @@ static char * get_name (CamelService *service, gboolean brief) { if (brief) - return g_strdup ("sendmail"); + return g_strdup (_("sendmail")); else - return g_strdup ("Mail delivery via the sendmail program"); + return g_strdup (_("Mail delivery via the sendmail program")); } diff --git a/camel/providers/smtp/camel-smtp-provider.c b/camel/providers/smtp/camel-smtp-provider.c index 1d18e445cc..ca6116042c 100644 --- a/camel/providers/smtp/camel-smtp-provider.c +++ b/camel/providers/smtp/camel-smtp-provider.c @@ -33,7 +33,8 @@ static CamelProvider smtp_provider = { "smtp", "SMTP", - "For delivering mail by connecting to a remote mailhub using SMTP.", + N_("For delivering mail by connecting to a remote mailhub " + "using SMTP."), "mail", diff --git a/camel/providers/vee/camel-vee-provider.c b/camel/providers/vee/camel-vee-provider.c index e36e7fcff1..335a5de097 100644 --- a/camel/providers/vee/camel-vee-provider.c +++ b/camel/providers/vee/camel-vee-provider.c @@ -27,9 +27,9 @@ static CamelProvider vee_provider = { "vfolder", - "Virtual folder email provider", + N_("Virtual folder email provider"), - "For reading mail as a query of another set of folders", + N_("For reading mail as a query of another set of folders"), "vfolder", |