diff options
65 files changed, 472 insertions, 422 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", diff --git a/composer/ChangeLog b/composer/ChangeLog index b12591d5c9..15f7c64b50 100644 --- a/composer/ChangeLog +++ b/composer/ChangeLog @@ -1,5 +1,8 @@ 2000-10-23 Dan Winship <danw@helixcode.com> + * e-msg-composer.c, e-msg-composer-attachment-bar.c: add some + missing _()s. + * e-msg-composer-address-dialog.*, e-msg-composer-address-entry.*: Old cruft. Remove. diff --git a/composer/e-msg-composer-attachment-bar.c b/composer/e-msg-composer-attachment-bar.c index 71ccf2a4f3..357045ce06 100644 --- a/composer/e-msg-composer-attachment-bar.c +++ b/composer/e-msg-composer-attachment-bar.c @@ -296,7 +296,7 @@ update (EMsgComposerAttachmentBar *bar) if (!desc || *desc == '\0') desc = camel_mime_part_get_filename (attachment->body); if (!desc) - desc = "attachment"; + desc = _("attachment"); if (attachment->size) { size_string = size_to_string (attachment->size); diff --git a/composer/e-msg-composer.c b/composer/e-msg-composer.c index 52b371a4aa..e8f6f40994 100644 --- a/composer/e-msg-composer.c +++ b/composer/e-msg-composer.c @@ -295,8 +295,8 @@ get_signature (const char *sigfile) if (fd == -1) { char *msg; - msg = g_strdup_printf ("Could not open signature file %s:\n%s", - sigfile, g_strerror (errno)); + msg = g_strdup_printf (_("Could not open signature file %s:\n" + "%s"), sigfile, g_strerror (errno)); gnome_error_dialog (msg); g_free (msg); @@ -459,7 +459,7 @@ describe_save_draft (gpointer in_data, gboolean gerund) if (gerund) { return g_strdup (_("Saving changes to message...")); } else { - return g_strdup (_("About to save changes to message...")); + return g_strdup (_("Save changes to message...")); } } @@ -500,7 +500,7 @@ cleanup_save_draft (gpointer in_data, gpointer op_data, CamelException *ex) if (camel_exception_is_set (ex)) { char *reason; - reason = g_strdup_printf ("Error saving composition to 'Drafts': %s", + reason = g_strdup_printf (_("Error saving composition to 'Drafts': %s"), camel_exception_get_description (ex)); gnome_warning_dialog_parented (reason, GTK_WINDOW (input->composer)); diff --git a/filter/ChangeLog b/filter/ChangeLog index a5568df3ff..ff710109bc 100644 --- a/filter/ChangeLog +++ b/filter/ChangeLog @@ -1,3 +1,21 @@ +2000-10-24 Dan Winship <danw@helixcode.com> + + * Makefile.am (libfilter-i18n.h): Build a fake header file with + the titles from the xml files, for translation purposes. + + * filter-rule.c (get_rule_part_widget): Call _() on the rule's + title. + + * filter-option.c (get_widget): Call _() on the option's title. + + * filter.glade: Turn on translatable strings. + + * libfilter-i18n.h, filter.glade.h: Translatable string files. + + * add #include <config.h> to a bunch of C files so that _() + actually does anything. Undo some UTF8 frobs since we're now + dealing in localized strings. + 2000-10-23 Jeffrey Stedfast <fejj@helixcode.com> * filter-filter.c (less_parts): Set the remove button insensitive diff --git a/filter/Makefile.am b/filter/Makefile.am index bf17f89614..3f8e3ed165 100644 --- a/filter/Makefile.am +++ b/filter/Makefile.am @@ -69,9 +69,17 @@ libfilter_la_SOURCES = \ vfolder-rule.c \ vfolder-rule.h +libfilter_la_DEPENDENCIES = libfilter-i18n.h + EXTRA_DIST = filtertypes.xml vfoldertypes.xml \ - filter.glade + filter.glade filter.glade.h libfilter-i18n.h # basic rules. filterdir = $(datadir)/evolution filter_DATA = filtertypes.xml vfoldertypes.xml + +libfilter-i18n.h: filtertypes.xml vfoldertypes.xml + echo "/* Automatically generated. Do not edit. */" > $@; \ + cat $(srcdir)/filtertypes.xml $(srcdir)/vfoldertypes.xml | \ + sed -n -e 's:.*<title>\(.*\)</title>:char *s = N_("\1");:p' | \ + sort -u >> $@ diff --git a/filter/filter-editor.c b/filter/filter-editor.c index 776fd740ac..83af757657 100644 --- a/filter/filter-editor.c +++ b/filter/filter-editor.c @@ -19,7 +19,7 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include <gtk/gtk.h> +#include <config.h> #include <gnome.h> #include <glade/glade.h> @@ -401,7 +401,7 @@ filter_editor_construct (struct _FilterContext *f) d = glade_xml_get_widget (gui, "edit_filter"); gtk_object_set_data_full (GTK_OBJECT (d), "data", data, g_free); - gtk_window_set_title (GTK_WINDOW (d), "Edit Filters"); + gtk_window_set_title (GTK_WINDOW (d), _("Edit Filters")); for (i = 0; i < BUTTON_LAST; i++) { data->buttons[i] = (GtkButton *)w = glade_xml_get_widget (gui, edit_buttons[i].name); gtk_signal_connect (GTK_OBJECT (w), "clicked", edit_buttons[i].func, data); diff --git a/filter/filter-filter.c b/filter/filter-filter.c index 145f5f6d92..88c8c76a02 100644 --- a/filter/filter-filter.c +++ b/filter/filter-filter.c @@ -19,7 +19,7 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include <gtk/gtk.h> +#include <config.h> #include <gnome.h> #include <gnome-xml/xmlmemory.h> @@ -285,7 +285,6 @@ get_rule_part_widget (FilterContext *f, FilterPart *newpart, FilterRule *fr) GtkWidget *p; int index = 0, current = 0; struct _part_data *data; - gchar *s; data = g_malloc0 (sizeof (*data)); data->fr = fr; @@ -300,9 +299,7 @@ get_rule_part_widget (FilterContext *f, FilterPart *newpart, FilterRule *fr) menu = gtk_menu_new (); while ((part = filter_context_next_action (f, part))) { - s = e_utf8_to_gtk_string (menu, part->title); - item = gtk_menu_item_new_with_label (s); - g_free (s); + item = gtk_menu_item_new_with_label (_(part->title)); gtk_object_set_data (GTK_OBJECT (item), "part", part); gtk_signal_connect (GTK_OBJECT (item), "activate", option_activate, data); diff --git a/filter/filter-folder.c b/filter/filter-folder.c index 1682415009..209bb2e295 100644 --- a/filter/filter-folder.c +++ b/filter/filter-folder.c @@ -18,7 +18,7 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include <gtk/gtk.h> +#include <config.h> #include <gnome.h> #define SHELL diff --git a/filter/filter-option.c b/filter/filter-option.c index 5c8cba208b..28b7f88850 100644 --- a/filter/filter-option.c +++ b/filter/filter-option.c @@ -18,7 +18,7 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include <gtk/gtk.h> +#include <config.h> #include <gnome.h> #include <gnome-xml/xmlmemory.h> @@ -239,14 +239,11 @@ static GtkWidget *get_widget(FilterElement *fe) GList *l = fo->options; struct _filter_option *op; int index = 0, current=0; - gchar *s; menu = (GtkMenu *)gtk_menu_new(); while (l) { op = l->data; - s = e_utf8_to_gtk_string ((GtkWidget *) menu, op->title); - item = (GtkMenuItem *)gtk_menu_item_new_with_label(s); - g_free (s); + item = (GtkMenuItem *)gtk_menu_item_new_with_label(_(op->title)); gtk_object_set_data((GtkObject *)item, "option", op); gtk_signal_connect((GtkObject *)item, "activate", option_activate, fo); gtk_menu_append(menu, (GtkWidget *)item); diff --git a/filter/filter-part.c b/filter/filter-part.c index 5f478d3888..e5ae231b7c 100644 --- a/filter/filter-part.c +++ b/filter/filter-part.c @@ -18,7 +18,7 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include <gtk/gtk.h> +#include <config.h> #include <gnome.h> #include <gnome-xml/xmlmemory.h> diff --git a/filter/filter-rule.c b/filter/filter-rule.c index 4a1573e4c9..37afe15518 100644 --- a/filter/filter-rule.c +++ b/filter/filter-rule.c @@ -19,7 +19,7 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include <gtk/gtk.h> +#include <config.h> #include <gnome.h> #include <gnome-xml/xmlmemory.h> @@ -376,7 +376,6 @@ get_rule_part_widget (RuleContext *f, FilterPart *newpart, FilterRule *fr) GtkWidget *p; int index = 0, current = 0; struct _part_data *data; - gchar *s; data = g_malloc0 (sizeof (*data)); data->fr = fr; @@ -395,9 +394,7 @@ get_rule_part_widget (RuleContext *f, FilterPart *newpart, FilterRule *fr) menu = gtk_menu_new (); /* sigh, this is a little ugly */ while ((part = rule_context_next_part (f, part))) { - s = e_utf8_to_gtk_string (menu, part->title); - item = gtk_menu_item_new_with_label (s); - g_free (s); + item = gtk_menu_item_new_with_label (_(part->title)); gtk_object_set_data (GTK_OBJECT (item), "part", part); gtk_signal_connect (GTK_OBJECT (item), "activate", option_activate, data); gtk_menu_append (GTK_MENU (menu), item); @@ -503,7 +500,6 @@ get_widget (FilterRule *fr, struct _RuleContext *f) GtkObject *hadj, *vadj; GList *l; FilterPart *part; - char *string; struct _rule_data *data; /* this stuff should probably be a table, but the @@ -515,7 +511,7 @@ get_widget (FilterRule *fr, struct _RuleContext *f) if (!fr->name) { fr->name = g_strdup (_("Untitled")); - e_utf8_gtk_entry_set_text (GTK_ENTRY (name), fr->name); + gtk_entry_set_text (GTK_ENTRY (name), fr->name); gtk_editable_select_region (GTK_EDITABLE (name), 0, -1); gtk_widget_grab_focus (GTK_WIDGET (name)); } else { @@ -549,16 +545,12 @@ get_widget (FilterRule *fr, struct _RuleContext *f) menu = gtk_menu_new (); - string = e_utf8_to_gtk_string (menu, _("if all criteria are met")); - item = gtk_menu_item_new_with_label (string); - g_free (string); + item = gtk_menu_item_new_with_label (_("if all criteria are met")); gtk_signal_connect (GTK_OBJECT (item), "activate", match_all, fr); gtk_menu_append (GTK_MENU (menu), item); gtk_widget_show (item); - string = e_utf8_to_gtk_string (menu, _("if any criteria are met")); - item = gtk_menu_item_new_with_label (string); - g_free (string); + item = gtk_menu_item_new_with_label (_("if any criteria are met")); gtk_signal_connect (GTK_OBJECT (item), "activate", match_any, fr); gtk_menu_append (GTK_MENU (menu), item); gtk_widget_show (item); diff --git a/filter/filter.glade b/filter/filter.glade index f7206a41c5..1445ed7be8 100644 --- a/filter/filter.glade +++ b/filter/filter.glade @@ -10,6 +10,8 @@ <language>C</language> <gnome_support>True</gnome_support> <gettext_support>True</gettext_support> + <output_translatable_strings>True</output_translatable_strings> + <translatable_strings_file>filter.glade.h</translatable_strings_file> </project> <widget> @@ -163,7 +165,6 @@ Outgoing <can_default>True</can_default> <can_focus>True</can_focus> <label>Add</label> - <relief>GTK_RELIEF_NORMAL</relief> </widget> <widget> @@ -172,7 +173,6 @@ Outgoing <can_default>True</can_default> <can_focus>True</can_focus> <label>Edit</label> - <relief>GTK_RELIEF_NORMAL</relief> </widget> <widget> @@ -181,7 +181,6 @@ Outgoing <can_default>True</can_default> <can_focus>True</can_focus> <label>Delete</label> - <relief>GTK_RELIEF_NORMAL</relief> </widget> <widget> @@ -190,7 +189,6 @@ Outgoing <can_default>True</can_default> <can_focus>True</can_focus> <stock_button>GNOME_STOCK_BUTTON_UP</stock_button> - <relief>GTK_RELIEF_NORMAL</relief> </widget> <widget> @@ -199,7 +197,6 @@ Outgoing <can_default>True</can_default> <can_focus>True</can_focus> <stock_button>GNOME_STOCK_BUTTON_DOWN</stock_button> - <relief>GTK_RELIEF_NORMAL</relief> </widget> </widget> </widget> @@ -345,7 +342,6 @@ Outgoing <can_default>True</can_default> <can_focus>True</can_focus> <label>Add</label> - <relief>GTK_RELIEF_NORMAL</relief> </widget> <widget> @@ -354,7 +350,6 @@ Outgoing <can_default>True</can_default> <can_focus>True</can_focus> <label>Edit</label> - <relief>GTK_RELIEF_NORMAL</relief> </widget> <widget> @@ -363,7 +358,6 @@ Outgoing <can_default>True</can_default> <can_focus>True</can_focus> <label>Delete</label> - <relief>GTK_RELIEF_NORMAL</relief> </widget> <widget> @@ -372,7 +366,6 @@ Outgoing <can_default>True</can_default> <can_focus>True</can_focus> <stock_button>GNOME_STOCK_BUTTON_UP</stock_button> - <relief>GTK_RELIEF_NORMAL</relief> </widget> <widget> @@ -381,7 +374,6 @@ Outgoing <can_default>True</can_default> <can_focus>True</can_focus> <stock_button>GNOME_STOCK_BUTTON_DOWN</stock_button> - <relief>GTK_RELIEF_NORMAL</relief> </widget> </widget> </widget> @@ -534,7 +526,6 @@ Outgoing <can_default>True</can_default> <can_focus>True</can_focus> <label>Add</label> - <relief>GTK_RELIEF_NORMAL</relief> </widget> <widget> @@ -543,7 +534,6 @@ Outgoing <can_default>True</can_default> <can_focus>True</can_focus> <label>Remove</label> - <relief>GTK_RELIEF_NORMAL</relief> </widget> </widget> </widget> @@ -696,7 +686,6 @@ Outgoing <can_default>True</can_default> <can_focus>True</can_focus> <label>Add</label> - <relief>GTK_RELIEF_NORMAL</relief> </widget> <widget> @@ -705,7 +694,6 @@ Outgoing <can_default>True</can_default> <can_focus>True</can_focus> <label>Remove</label> - <relief>GTK_RELIEF_NORMAL</relief> </widget> </widget> </widget> diff --git a/filter/filter.glade.h b/filter/filter.glade.h new file mode 100644 index 0000000000..bcd3ae40d0 --- /dev/null +++ b/filter/filter.glade.h @@ -0,0 +1,25 @@ +/* + * Translatable strings file generated by Glade. + * Add this file to your project's POTFILES.in. + * DO NOT compile it as part of your application. + */ + +gchar *s = N_("Edit Filters"); +gchar *s = N_("Incoming\n" + "Outgoing\n" + ""); +gchar *s = N_("Filter Rules"); +gchar *s = N_("Add"); +gchar *s = N_("Edit"); +gchar *s = N_("Delete"); +gchar *s = N_("Edit VFolders"); +gchar *s = N_("Virtual Folders"); +gchar *s = N_("Add"); +gchar *s = N_("Edit"); +gchar *s = N_("Delete"); +gchar *s = N_("vFolder Sources"); +gchar *s = N_("Add"); +gchar *s = N_("Remove"); +gchar *s = N_("vFolder Sources"); +gchar *s = N_("Add"); +gchar *s = N_("Remove"); diff --git a/filter/libfilter-i18n.h b/filter/libfilter-i18n.h new file mode 100644 index 0000000000..25391215ad --- /dev/null +++ b/filter/libfilter-i18n.h @@ -0,0 +1,32 @@ +/* Automatically generated. Do not edit. */ +char *s = N_("Assign Colour"); +char *s = N_("Assign Score"); +char *s = N_("Copy to Folder"); +char *s = N_("Date received"); +char *s = N_("Date sent"); +char *s = N_("Delete"); +char *s = N_("Expression"); +char *s = N_("Forward to Address"); +char *s = N_("Message Body"); +char *s = N_("Message was received"); +char *s = N_("Message was sent"); +char *s = N_("Move to Folder"); +char *s = N_("Priority"); +char *s = N_("Recipients"); +char *s = N_("Sender"); +char *s = N_("Source"); +char *s = N_("Specific header"); +char *s = N_("Stop Processing"); +char *s = N_("Subject"); +char *s = N_("after"); +char *s = N_("before"); +char *s = N_("contains"); +char *s = N_("does not contain"); +char *s = N_("is greater than"); +char *s = N_("is less than"); +char *s = N_("is not"); +char *s = N_("is"); +char *s = N_("on or after"); +char *s = N_("on or before"); +char *s = N_("was after"); +char *s = N_("was before"); diff --git a/filter/score-editor.c b/filter/score-editor.c index 77031d6e77..57dbb434f3 100644 --- a/filter/score-editor.c +++ b/filter/score-editor.c @@ -18,7 +18,7 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include <gtk/gtk.h> +#include <config.h> #include <gnome.h> #include <glade/glade.h> diff --git a/filter/score-rule.c b/filter/score-rule.c index 7ad73a8df3..f34f46081d 100644 --- a/filter/score-rule.c +++ b/filter/score-rule.c @@ -19,7 +19,7 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include <gtk/gtk.h> +#include <config.h> #include <gnome.h> #include "score-rule.h" diff --git a/filter/vfolder-editor.c b/filter/vfolder-editor.c index 33f292bd18..0f17005e6e 100644 --- a/filter/vfolder-editor.c +++ b/filter/vfolder-editor.c @@ -19,7 +19,7 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include <gtk/gtk.h> +#include <config.h> #include <gnome.h> #include <glade/glade.h> diff --git a/filter/vfolder-rule.c b/filter/vfolder-rule.c index 2bb54ff30f..322e3eabb7 100644 --- a/filter/vfolder-rule.c +++ b/filter/vfolder-rule.c @@ -18,7 +18,7 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include <gtk/gtk.h> +#include <config.h> #include <gnome.h> #include <glade/glade.h> diff --git a/mail/ChangeLog b/mail/ChangeLog index dd6f72ac58..4e6c4a339e 100644 --- a/mail/ChangeLog +++ b/mail/ChangeLog @@ -1,5 +1,9 @@ 2000-10-23 Dan Winship <danw@helixcode.com> + * *: Add some missing _()s and N_()s. + +2000-10-23 Dan Winship <danw@helixcode.com> + * Makefile.am (INCLUDES): Update EVOLUTION_LOCALEDIR. 2000-10-23 Jeffrey Stedfast <fejj@helixcode.com> diff --git a/mail/component-factory.c b/mail/component-factory.c index 17d67c46de..2bf099a2f2 100644 --- a/mail/component-factory.c +++ b/mail/component-factory.c @@ -327,7 +327,7 @@ mail_add_new_storage (const char *uri, Evolution_Shell corba_shell, CamelExcepti if (url->host == NULL) { camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM, - "Bad storage URL (no server): %s", + _("Bad storage URL (no server): %s"), uri); return; } @@ -346,7 +346,7 @@ mail_add_new_storage (const char *uri, Evolution_Shell corba_shell, CamelExcepti return; default: camel_exception_set (ex, CAMEL_EXCEPTION_SYSTEM, - "mail_tool_add_new_storage: Cannot register storage on shell"); + _("Cannot register storage with shell")); break; } diff --git a/mail/folder-browser.c b/mail/folder-browser.c index 86f5214b45..a88b5db0ac 100644 --- a/mail/folder-browser.c +++ b/mail/folder-browser.c @@ -134,12 +134,12 @@ folder_browser_set_message_preview (FolderBrowser *folder_browser, gboolean show } static char * search_options[] = { - "Body or subject contains", - "Body contains", - "Subject contains", - "Body does not contain", - "Subject does not contain", - "Custom search", + N_("Body or subject contains"), + N_("Body contains"), + N_("Subject contains"), + N_("Body does not contain"), + N_("Subject does not contain"), + N_("Custom search"), NULL }; @@ -265,7 +265,11 @@ create_option_menu (char **menu_list, int item, void *data) while (*menu_list){ GtkWidget *entry; - entry = e_utf8_gtk_menu_item_new_with_label (GTK_MENU(menu), *menu_list); + /* We don't use e_utf8_gtk_menu_item_new_with_label here + * because the string comes from gettext and so is localized, + * not UTF-8. + */ + entry = gtk_menu_item_new_with_label (_(*menu_list)); gtk_widget_show (entry); gtk_object_set_data((GtkObject *)entry, "search_option", (void *)i); gtk_menu_append (GTK_MENU (menu), entry); @@ -307,7 +311,7 @@ search_save(GtkWidget *w, FolderBrowser *fb) /* some special case code for the custom search position */ if (index == CUSTOM_SEARCH_ID) { g_free(text); - text = g_strdup("Custom"); + text = g_strdup(_("Custom")); } else { if (text == NULL || text[0] == 0) { g_free (text); diff --git a/mail/mail-callbacks.c b/mail/mail-callbacks.c index e6f6e4c59e..e2b8c8b4be 100644 --- a/mail/mail-callbacks.c +++ b/mail/mail-callbacks.c @@ -160,8 +160,9 @@ fetch_mail (GtkWidget *widget, gpointer user_data) GtkWidget *win = gtk_widget_get_ancestor (GTK_WIDGET (user_data), GTK_TYPE_WINDOW); - gnome_error_dialog_parented ("You have no mail sources " - "configured", GTK_WINDOW (win)); + gnome_error_dialog_parented (_("You have no mail sources " + "configured"), + GTK_WINDOW (win)); return; } @@ -171,8 +172,9 @@ fetch_mail (GtkWidget *widget, gpointer user_data) GtkWidget *win = gtk_widget_get_ancestor (GTK_WIDGET (user_data), GTK_TYPE_WINDOW); - gnome_error_dialog_parented ("You have no mail sources " - "configured", GTK_WINDOW (win)); + gnome_error_dialog_parented (_("You have no mail sources " + "configured"), + GTK_WINDOW (win)); return; } @@ -207,7 +209,7 @@ send_queued_mail (GtkWidget *widget, gpointer user_data) GtkWidget *win = gtk_widget_get_ancestor (GTK_WIDGET (user_data), GTK_TYPE_WINDOW); - gnome_error_dialog_parented ("You have not set a transport method", + gnome_error_dialog_parented (_("You have not set a mail transport method"), GTK_WINDOW (win)); return; } @@ -216,7 +218,7 @@ send_queued_mail (GtkWidget *widget, gpointer user_data) GtkWidget *win = gtk_widget_get_ancestor (GTK_WIDGET (user_data), GTK_TYPE_WINDOW); - gnome_error_dialog_parented ("You have no Outbox configured", + gnome_error_dialog_parented (_("You have no Outbox configured"), GTK_WINDOW (win)); return; } diff --git a/mail/mail-config-gui.c b/mail/mail-config-gui.c index 56a251c58d..65b3fd5791 100644 --- a/mail/mail-config-gui.c +++ b/mail/mail-config-gui.c @@ -720,7 +720,7 @@ service_page_item_auth_activate (GtkWidget *menuitem, authtype = gtk_object_get_data (GTK_OBJECT (menuitem), "authtype"); put_html (GTK_HTML (spitem->auth_html), - authtype->description); + _(authtype->description)); } static void @@ -885,7 +885,7 @@ service_page_item_new (MailDialogServicePage *page, MailService *mcs) /* Description */ description = html_new (TRUE); - put_html (GTK_HTML (description), mcs->provider->description); + put_html (GTK_HTML (description), _(mcs->provider->description)); gtk_box_pack_start (GTK_BOX (item->vbox), description->parent->parent, TRUE, TRUE, 0); @@ -1104,7 +1104,7 @@ source_page_new (GSList *sources) MailDialogSourcePage *page = g_new0 (MailDialogSourcePage, 1); GtkWidget *html; - page->page = service_page_new ("Mail source type:", sources); + page->page = service_page_new (_("Mail source type:"), sources); page->vbox = page->page->vbox; html = html_new (FALSE); @@ -1128,7 +1128,7 @@ news_page_new (GSList *sources) MailDialogNewsPage *page = g_new0 (MailDialogNewsPage, 1); GtkWidget *html; - page->page = service_page_new ("News source type:", sources); + page->page = service_page_new (_("News source type:"), sources); page->vbox = page->page->vbox; html = html_new (FALSE); @@ -2230,9 +2230,9 @@ static gchar *describe_test_service (gpointer in_data, gboolean gerund) test_service_input_t *input = (test_service_input_t *) in_data; if (gerund) { - return g_strdup_printf ("Testing \"%s\"", input->url); + return g_strdup_printf (_("Testing \"%s\""), input->url); } else { - return g_strdup_printf ("Test connection to \"%s\"", input->url); + return g_strdup_printf (_("Test connection to \"%s\""), input->url); } } @@ -2241,12 +2241,6 @@ static void setup_test_service (gpointer in_data, gpointer op_data, CamelExcepti test_service_input_t *input = (test_service_input_t *) in_data; test_service_data_t *data = (test_service_data_t *) op_data; - if (!input->url) { - camel_exception_set (ex, CAMEL_EXCEPTION_INVALID_PARAM, - "No URL was provided to test"); - return; - } - data->success = FALSE; } @@ -2341,18 +2335,6 @@ static void setup_query_authtypes (gpointer in_data, gpointer op_data, CamelExce query_authtypes_input_t *input = (query_authtypes_input_t *) in_data; query_authtypes_data_t *data = (query_authtypes_data_t *) op_data; - if (!input->page) { - camel_exception_set (ex, CAMEL_EXCEPTION_INVALID_PARAM, - "No service page was provided to test"); - return; - } - - if (!input->url) { - camel_exception_set (ex, CAMEL_EXCEPTION_INVALID_PARAM, - "No URL was provided to test"); - return; - } - data->items = NULL; data->service = NULL; } diff --git a/mail/mail-crypto.c b/mail/mail-crypto.c index 47279e29b3..5d97b7d46a 100644 --- a/mail/mail-crypto.c +++ b/mail/mail-crypto.c @@ -134,8 +134,8 @@ crypto_exec_with_passwd (char *path, char *argv[], const char *input, if ((pipe (ip_fds) < 0 ) || (pipe (op_fds) < 0 ) || (pipe (diag_fds) < 0 )) { - *diagnostics = g_strdup_printf ("Couldn't create pipe to %s: " - "%s", PGP_PROGRAM, + *diagnostics = g_strdup_printf (_("Couldn't create pipe to " + "%s: %s"), PGP_PROGRAM, g_strerror (errno)); return 0; } @@ -161,11 +161,11 @@ crypto_exec_with_passwd (char *path, char *argv[], const char *input, cleanup_before_exec(passwd_fds[0]); execvp (path, argv); - fprintf (stderr, "Could not execute %s: %s\n", argv[0], + fprintf (stderr, _("Could not execute %s: %s\n"), argv[0], g_strerror (errno)); _exit (255); } else if (child < 0) { - *diagnostics = g_strdup_printf ("Cannot fork %s: %s", + *diagnostics = g_strdup_printf (_("Cannot fork %s: %s"), argv[0], g_strerror (errno)); return 0; } diff --git a/mail/mail-display.c b/mail/mail-display.c index f98244b655..ca3c2990f2 100644 --- a/mail/mail-display.c +++ b/mail/mail-display.c @@ -84,7 +84,7 @@ write_data_to_file (CamelMimePart *part, const char *name, gboolean unique) if (fd == -1) { char *msg; - msg = g_strdup_printf ("Could not open file %s:\n%s", + msg = g_strdup_printf (_("Could not open file %s:\n%s"), name, g_strerror (errno)); gnome_error_dialog (msg); g_free (msg); @@ -96,7 +96,7 @@ write_data_to_file (CamelMimePart *part, const char *name, gboolean unique) || camel_stream_flush (stream_fs) == -1) { char *msg; - msg = g_strdup_printf ("Could not write data: %s", + msg = g_strdup_printf (_("Could not write data: %s"), strerror (errno)); gnome_error_dialog (msg); g_free (msg); @@ -114,8 +114,10 @@ make_safe_filename (const char *prefix, CamelMimePart *part) char *safe, *p; name = camel_mime_part_get_filename (part); - if (!name) - name = "attachment"; + if (!name) { + /* This is a filename. Translators take note. */ + name = _("attachment"); + } p = strrchr (name, '/'); if (p) @@ -190,7 +192,7 @@ save_cb (GtkWidget *widget, gpointer user_data) filename = make_safe_filename (g_get_home_dir (), part); file_select = GTK_FILE_SELECTION ( - gtk_file_selection_new ("Save Attachment")); + gtk_file_selection_new (_("Save Attachment"))); gtk_file_selection_set_filename (file_select, filename); g_free (filename); @@ -230,8 +232,8 @@ launch_cb (GtkWidget *widget, gpointer user_data) } #endif if (!tmpdir) { - char *msg = g_strdup_printf ("Could not create temporary " - "directory: %s", + char *msg = g_strdup_printf (_("Could not create temporary " + "directory: %s"), g_strerror (errno)); gnome_error_dialog (msg); g_free (msg); @@ -291,13 +293,16 @@ pixmap_press (GtkWidget *ebox, GdkEventButton *event, gpointer user_data) handler = mail_lookup_handler (gtk_object_get_data (user_data, "mime_type")); + /* Save item */ + menu[0].name = _(menu[0].name); + /* External view item */ if (handler && handler->application) { - menu[1].name = g_strdup_printf (menu[1].name, + menu[1].name = g_strdup_printf (_(menu[1].name), handler->application->name); } else { - menu[1].name = g_strdup_printf (menu[1].name, - N_("External Viewer")); + menu[1].name = g_strdup_printf (_(menu[1].name), + _("External Viewer")); mask |= 1; } @@ -320,13 +325,13 @@ pixmap_press (GtkWidget *ebox, GdkEventButton *event, gpointer user_data) else name = "bonobo"; menu[2].name = g_strdup_printf ( - N_("View Inline (via %s)"), name); + _("View Inline (via %s)"), name); } else - menu[2].name = g_strdup (menu[2].name); + menu[2].name = g_strdup (_(menu[2].name)); } else - menu[2].name = g_strdup (N_("Hide")); + menu[2].name = g_strdup (_("Hide")); } else { - menu[2].name = g_strdup (menu[2].name); + menu[2].name = g_strdup (_(menu[2].name)); mask |= 2; } diff --git a/mail/mail-format.c b/mail/mail-format.c index ccbdf420fd..76c21000a6 100644 --- a/mail/mail-format.c +++ b/mail/mail-format.c @@ -474,7 +474,7 @@ attachment_header (CamelMimePart *part, const char *mime_type, /* Write the MIME type */ info = gnome_vfs_mime_get_value (mime_type, "description"); htmlinfo = e_text_to_html (info ? info : mime_type, 0); - mail_html_write (md->html, md->stream, "%s attachment", htmlinfo); + mail_html_write (md->html, md->stream, _("%s attachment"), htmlinfo); g_free (htmlinfo); /* Write the name, if we have it. */ @@ -585,31 +585,33 @@ write_headers (CamelMimeMessage *message, MailDisplay *md) "cellspacing=0 border=1>" "<tr><td><table>\n"); - write_field_to_stream ("From:", camel_mime_message_get_from (message), + write_field_to_stream (_("From:"), + camel_mime_message_get_from (message), TRUE, TRUE, md->html, md->stream); reply_to = camel_mime_message_get_reply_to (message); if (reply_to) { - write_field_to_stream ("Reply-To:", reply_to, TRUE, FALSE, + write_field_to_stream (_("Reply-To:"), reply_to, TRUE, FALSE, md->html, md->stream); } recipients = camel_mime_message_get_recipients ( message, CAMEL_RECIPIENT_TYPE_TO); string = camel_address_encode (CAMEL_ADDRESS (recipients)); - write_field_to_stream ("To:", string ? string : "", TRUE, TRUE, + write_field_to_stream (_("To:"), string ? string : "", TRUE, TRUE, md->html, md->stream); g_free (string); recipients = camel_mime_message_get_recipients(message, CAMEL_RECIPIENT_TYPE_CC); string = camel_address_encode(CAMEL_ADDRESS(recipients)); if (string) { - write_field_to_stream ("Cc:", string, TRUE, TRUE, + write_field_to_stream (_("Cc:"), string, TRUE, TRUE, md->html, md->stream); } g_free (string); - write_field_to_stream ("Subject:", camel_mime_message_get_subject (message), + write_field_to_stream (_("Subject:"), + camel_mime_message_get_subject (message), FALSE, TRUE, md->html, md->stream); mail_html_write (md->html, md->stream, @@ -829,8 +831,8 @@ decode_pgp (const char *ciphertext, MailDisplay *md) } #else camel_exception_set (&ex, CAMEL_EXCEPTION_SYSTEM, - "No GPG/PGP support available in this copy " - "of Evolution."); + _("No GPG/PGP support available in this copy " + "of Evolution.")); #endif mail_html_write (md->html, md->stream, @@ -840,15 +842,15 @@ decode_pgp (const char *ciphertext, MailDisplay *md) get_url_for_icon ("gnome-lockscreen.png", md)); if (camel_exception_is_set (&ex)) { - mail_html_write (md->html, md->stream, - "Encrypted message not displayed<br><br>\n"); + mail_html_write (md->html, md->stream, "%s<br><br>\n", + _("Encrypted message not displayed")); mail_error_write (md->html, md->stream, camel_exception_get_description (&ex)); camel_exception_clear (&ex); } else { - mail_html_write (md->html, md->stream, - "Encrypted message<br><br>\n" - "Click icon to decrypt."); + mail_html_write (md->html, md->stream, "%s<br><br>\n%s", + _("Encrypted message"), + _("Click icon to decrypt.")); } mail_html_write (md->html, md->stream, "</td></tr></table>"); @@ -1450,7 +1452,7 @@ handle_message_external_body (CamelMimePart *part, const char *mime_type, url = g_strdup_printf ("ftp://%s%s%s", site, path, ftype); g_free (path); - desc = g_strdup_printf ("Pointer to FTP site (%s)", url); + desc = g_strdup_printf (_("Pointer to FTP site (%s)"), url); } else if (!g_strcasecmp (access_type, "local-file")) { const char *name, *site; @@ -1461,9 +1463,14 @@ handle_message_external_body (CamelMimePart *part, const char *mime_type, url = g_strdup_printf ("file://%s%s", *name == '/' ? "" : "/", name); - desc = g_strdup_printf ("Pointer to local file (%s)%s%s%s", - name, site ? " valid at site \"" : "", - site ? site : "", site ? "\"" : ""); + if (site) { + desc = g_strdup_printf (_("Pointer to local file (%s) " + "valid at site \"%s\""), + name, site); + } else { + desc = g_strdup_printf (_("Pointer to local file (%s)"), + name); + } } else if (!g_strcasecmp (access_type, "URL")) { const char *urlparam; char *s, *d; @@ -1495,11 +1502,12 @@ handle_message_external_body (CamelMimePart *part, const char *mime_type, fallback: if (!desc) { if (access_type) { - desc = g_strdup_printf ("Pointer to unknown external " - "data (\"%s\" type)", + desc = g_strdup_printf (_("Pointer to unknown " + "external data " + "(\"%s\" type)"), access_type); } else - desc = g_strdup ("Malformed external-body part."); + desc = g_strdup (_("Malformed external-body part.")); } #if 0 /* FIXME */ diff --git a/mail/mail-local.c b/mail/mail-local.c index a852b7c183..e2d5a8cea1 100644 --- a/mail/mail-local.c +++ b/mail/mail-local.c @@ -290,18 +290,6 @@ setup_reconfigure_folder (gpointer in_data, gpointer op_data, CamelException *ex { reconfigure_folder_input_t *input = (reconfigure_folder_input_t *) in_data; - if (!IS_FOLDER_BROWSER (input->fb)) { - camel_exception_set (ex, CAMEL_EXCEPTION_INVALID_PARAM, - "Input has a bad FolderBrowser in reconfigure_folder"); - return; - } - - if (!input->newtype) { - camel_exception_set (ex, CAMEL_EXCEPTION_INVALID_PARAM, - "No new folder type in reconfigure_folder"); - return; - } - gtk_object_ref (GTK_OBJECT (input->fb)); } @@ -336,7 +324,7 @@ do_reconfigure_folder(gpointer in_data, gpointer op_data, CamelException *ex) /* first, 'close' the old folder */ if (input->fb->folder != NULL) { - update_progress("Closing current folder", 0.0); + update_progress(_("Closing current folder"), 0.0); mail_tool_camel_lock_up (); camel_folder_sync(input->fb->folder, FALSE, ex); @@ -368,7 +356,7 @@ do_reconfigure_folder(gpointer in_data, gpointer op_data, CamelException *ex) /* rename the old mbox and open it again, without indexing */ tmpname = g_strdup_printf("%s_reconfig", meta->name); printf("renaming %s to %s, and opening it\n", meta->name, tmpname); - update_progress("Renaming old folder and opening", 0.0); + update_progress(_("Renaming old folder and opening"), 0.0); mail_tool_camel_lock_up (); camel_store_rename_folder(fromstore, meta->name, tmpname, ex); @@ -389,7 +377,7 @@ do_reconfigure_folder(gpointer in_data, gpointer op_data, CamelException *ex) /* create a new mbox */ printf("Creating the destination mbox\n"); - update_progress("Creating new folder", 0.0); + update_progress(_("Creating new folder"), 0.0); flags = CAMEL_STORE_FOLDER_CREATE; if (meta->indexed) @@ -404,7 +392,7 @@ do_reconfigure_folder(gpointer in_data, gpointer op_data, CamelException *ex) goto cleanup; } - update_progress("Copying messages", 0.0); + update_progress(_("Copying messages"), 0.0); mail_tool_move_folder_contents (fromfolder, tofolder, FALSE, ex); printf("delete old mbox ...\n"); @@ -415,9 +403,11 @@ do_reconfigure_folder(gpointer in_data, gpointer op_data, CamelException *ex) g_free(meta->format); meta->format = g_strdup(input->newtype); if (save_metainfo(meta) == -1) { - camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM, "Cannot save folder metainfo; " - "you'll probably find you can't\n" - "open this folder anymore: %s", tourl); + camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM, + _("Cannot save folder metainfo; " + "you'll probably find you can't\n" + "open this folder anymore: %s"), + tourl); } free_metainfo(meta); @@ -450,8 +440,8 @@ cleanup_reconfigure_folder (gpointer in_data, gpointer op_data, CamelException if (camel_exception_is_set(ex)) { GtkWidget *win = gtk_widget_get_ancestor((GtkWidget *)input->frame, GTK_TYPE_WINDOW); - gnome_error_dialog_parented ("If you can no longer open this mailbox, then\n" - "you may need to repair it manually.", GTK_WINDOW (win)); + gnome_error_dialog_parented (_("If you can no longer open this mailbox, then\n" + "you may need to repair it manually."), GTK_WINDOW (win)); } gtk_object_unref (GTK_OBJECT (input->fb)); diff --git a/mail/mail-tools.c b/mail/mail-tools.c index 6eb11b3bb2..11e15012bb 100644 --- a/mail/mail-tools.c +++ b/mail/mail-tools.c @@ -261,7 +261,7 @@ mail_tool_move_folder_contents (CamelFolder *source, CamelFolder *dest, gboolean /* Get all uids of source */ - mail_op_set_message ("Examining %s", source->full_name); + mail_op_set_message (_("Examining %s"), source->full_name); uids = camel_folder_get_uids (source); printf ("mail_tool_move_folder: got %d messages in source\n", uids->len); @@ -312,7 +312,8 @@ mail_tool_move_folder_contents (CamelFolder *source, CamelFolder *dest, gboolean /* Info */ - mail_op_set_message ("Retrieving message %d of %d", i + 1, uids->len); + mail_op_set_message (_("Retrieving message %d of %d"), + i + 1, uids->len); /* Get the message */ @@ -324,7 +325,8 @@ mail_tool_move_folder_contents (CamelFolder *source, CamelFolder *dest, gboolean /* Append it to dest */ - mail_op_set_message ("Writing message %d of %d", i + 1, uids->len); + mail_op_set_message (_("Writing message %d of %d"), + i + 1, uids->len); if (summary_capability) info = camel_folder_get_message_info (source, uids->pdata[i]); @@ -352,7 +354,7 @@ mail_tool_move_folder_contents (CamelFolder *source, CamelFolder *dest, gboolean } else camel_folder_free_uids (source, uids); - mail_op_set_message ("Saving changes to %s", source->full_name); + mail_op_set_message (_("Saving changes to %s"), source->full_name); camel_folder_sync (source, TRUE, ex); @@ -384,7 +386,7 @@ mail_tool_generate_forward_subject (CamelMimeMessage *msg) if (from) { if (subject && *subject) { - fwd_subj = g_strdup_printf (_("[%s] %s"), from, subject); + fwd_subj = g_strdup_printf ("[%s] %s", from, subject); } else { fwd_subj = g_strdup_printf (_("[%s] (forwarded message)"), from); diff --git a/mail/mail-vfolder.c b/mail/mail-vfolder.c index 8909a2f933..a0c3289806 100644 --- a/mail/mail-vfolder.c +++ b/mail/mail-vfolder.c @@ -144,7 +144,7 @@ vfolder_create_storage(EvolutionShellComponent *shell_component) corba_shell = bonobo_object_corba_objref (BONOBO_OBJECT (shell_client)); - storage = evolution_storage_new ("VFolders"); + storage = evolution_storage_new (_("VFolders")); if (evolution_storage_register_on_shell (storage, corba_shell) != EVOLUTION_STORAGE_OK) { g_warning ("Cannot register storage"); return; diff --git a/mail/message-list.c b/mail/message-list.c index 64ec31837d..6442e2aa47 100644 --- a/mail/message-list.c +++ b/mail/message-list.c @@ -508,13 +508,13 @@ ml_value_to_string (ETableModel *etm, int col, const void *value, void *data) case COL_MESSAGE_STATUS: switch ((int) value) { case 0: - return g_strdup ("Unseen"); + return g_strdup (_("Unseen")); break; case 1: - return g_strdup ("Seen"); + return g_strdup (_("Seen")); break; case 2: - return g_strdup ("Answered"); + return g_strdup (_("Answered")); break; default: return g_strdup (""); @@ -1691,21 +1691,15 @@ static void cleanup_regenerate_messagelist (gpointer in_data, gpointer op_data, static gchar *describe_regenerate_messagelist (gpointer in_data, gboolean gerund) { if (gerund) - return g_strdup ("Rebuilding message view"); + return g_strdup (_("Rebuilding message view")); else - return g_strdup ("Rebuild message view"); + return g_strdup (_("Rebuild message view")); } static void setup_regenerate_messagelist (gpointer in_data, gpointer op_data, CamelException *ex) { regenerate_messagelist_input_t *input = (regenerate_messagelist_input_t *) in_data; - if (!IS_MESSAGE_LIST (input->ml)) { - camel_exception_set (ex, CAMEL_EXCEPTION_INVALID_PARAM, - "No messagelist specified to regenerate"); - return; - } - gtk_object_ref (GTK_OBJECT (input->ml)); e_table_model_pre_change (input->ml->table_model); } diff --git a/mail/message-thread.c b/mail/message-thread.c index dd391c1201..4114ae0f33 100644 --- a/mail/message-thread.c +++ b/mail/message-thread.c @@ -522,33 +522,15 @@ static void cleanup_thread_messages (gpointer in_data, gpointer op_data, CamelEx static gchar *describe_thread_messages (gpointer in_data, gboolean gerund) { if (gerund) - return g_strdup ("Threading message list"); + return g_strdup (_("Threading message list")); else - return g_strdup ("Thread message list"); + return g_strdup (_("Thread message list")); } static void setup_thread_messages (gpointer in_data, gpointer op_data, CamelException *ex) { thread_messages_input_t *input = (thread_messages_input_t *) in_data; - if (!IS_MESSAGE_LIST (input->ml)) { - camel_exception_set (ex, CAMEL_EXCEPTION_INVALID_PARAM, - "No messagelist to thread was provided to thread_messages"); - return; - } - - if (!input->uids) { - camel_exception_set (ex, CAMEL_EXCEPTION_INVALID_PARAM, - "No uids were provided to thread_messages"); - return; - } - - if (!input->build) { - camel_exception_set (ex, CAMEL_EXCEPTION_INVALID_PARAM, - "No build callback provided to thread_messages"); - return; - } - gtk_object_ref (GTK_OBJECT (input->ml)); } diff --git a/po/ChangeLog b/po/ChangeLog index 71c1236c2a..b5b95f60f5 100644 --- a/po/ChangeLog +++ b/po/ChangeLog @@ -1,3 +1,7 @@ +2000-10-24 Dan Winship <danw@helixcode.com> + + * POTFILES.in: Add lots of camel and filter files. + 2000-10-23 Dan Winship <danw@helixcode.com> * POTFILES.in: Remove removed composer files diff --git a/po/POTFILES.in b/po/POTFILES.in index ab18f440b2..0aa51cacf1 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -53,6 +53,35 @@ calendar/gui/main.c calendar/gui/popup-menu.c calendar/gui/print.c calendar/gui/prop.c +camel/camel-movemail.c +camel/camel-provider.c +camel/camel-remote-store.c +camel/camel-service.c +camel/camel-session.c +camel/camel-url.c +camel/providers/imap/camel-imap-command.c +camel/providers/imap/camel-imap-folder.c +camel/providers/imap/camel-imap-provider.c +camel/providers/imap/camel-imap-store.c +camel/providers/mbox/camel-mbox-folder.c +camel/providers/mbox/camel-mbox-provider.c +camel/providers/mbox/camel-mbox-store.c +camel/providers/mbox/camel-mbox-summary.c +camel/providers/mh/camel-mh-folder.c +camel/providers/mh/camel-mh-provider.c +camel/providers/mh/camel-mh-store.c +camel/providers/nntp/camel-nntp-auth.c +camel/providers/nntp/camel-nntp-folder.c +camel/providers/nntp/camel-nntp-grouplist.c +camel/providers/nntp/camel-nntp-provider.c +camel/providers/nntp/camel-nntp-store.c +camel/providers/pop3/camel-pop3-folder.c +camel/providers/pop3/camel-pop3-provider.c +camel/providers/pop3/camel-pop3-store.c +camel/providers/sendmail/camel-sendmail-provider.c +camel/providers/sendmail/camel-sendmail-transport.c +camel/providers/smtp/camel-smtp-provider.c +camel/providers/vee/camel-vee-provider.c composer/e-msg-composer-attachment-bar.c composer/e-msg-composer-attachment.c composer/e-msg-composer-attachment.glade.h @@ -62,8 +91,11 @@ filter/filter-datespec.c filter/filter-editor.c filter/filter-filter.c filter/filter-folder.c +filter/filter-option.c filter/filter-part.c filter/filter-rule.c +filter/filter.glade.h +filter/libfilter-i18n.h filter/score-editor.c filter/score-rule.c filter/vfolder-editor.c |