revise 'translatable string' policy
authorPaul Mangan <paul@claws-mail.org>
Sun, 28 Mar 2004 08:16:17 +0000 (08:16 +0000)
committerPaul Mangan <paul@claws-mail.org>
Sun, 28 Mar 2004 08:16:17 +0000 (08:16 +0000)
ChangeLog.claws
configure.ac
src/common/nntp.c
src/common/smtp.c
src/folder.c
src/folderview.c
src/imap.c
src/inc.c
src/news.c
src/pop.c

index 5617e0c..2a0a56a 100644 (file)
@@ -1,3 +1,19 @@
+2004-03-28 [paul]      0.9.10claws33
+
+       * src/common/nntp.c
+         src/common/smtp.c
+         src/folder.c
+         src/imap.c
+         src/inc.c
+         src/news.c
+         src/pop.c
+               revise 'translatable string' policy:
+               don't translate debug_print() or log_print(),
+               translate log_message() and log_warning()
+       
+       * po/zh_CN.po
+               update submitted by Hansom Young
+
 2004-03-25 [alfons]    0.9.10claws32
 
        * src/prefs_common.c
index 26ad91d..3afda2d 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=9
 MICRO_VERSION=10
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=32
+EXTRA_VERSION=33
 if test $EXTRA_VERSION -eq 0; then
     VERSION=${MAJOR_VERSION}.${MINOR_VERSION}.${MICRO_VERSION}claws
 else
index b44bad8..6bcc83e 100644 (file)
@@ -65,7 +65,7 @@ Session *nntp_session_new(const gchar *server, gushort port, gchar *buf,
        SockInfo *sock;
 
        if ((sock = sock_connect(server, port)) == NULL) {
-               log_warning("Can't connect to NNTP server: %s:%d\n",
+               log_warning(_("Can't connect to NNTP server: %s:%d\n"),
                            server, port);
                return NULL;
        }
@@ -169,7 +169,7 @@ gint nntp_group(NNTPSession *session, const gchar *group,
 
        if (sscanf(buf, "%d %d %d %d", &resp, num, first, last)
            != 4) {
-               log_warning("protocol error: %s\n", buf);
+               log_warning(_("protocol error: %s\n"), buf);
                return NN_PROTOCOL;
        }
 
@@ -192,7 +192,7 @@ gint nntp_get_article(NNTPSession *session, const gchar *cmd, gint num,
 
        extract_parenthesis(buf, '<', '>');
        if (buf[0] == '\0') {
-               log_warning("protocol error\n");
+               log_warning(_("protocol error\n"));
                return NN_PROTOCOL;
        }
        *msgid = g_strdup(buf);
@@ -232,13 +232,13 @@ gint nntp_next(NNTPSession *session, gint *num, gchar **msgid)
                return ok;
 
        if (sscanf(buf, "%d %d", &resp, num) != 2) {
-               log_warning("protocol error: %s\n", buf);
+               log_warning(_("protocol error: %s\n"), buf);
                return NN_PROTOCOL;
        }
 
        extract_parenthesis(buf, '<', '>');
        if (buf[0] == '\0') {
-               log_warning("protocol error\n");
+               log_warning(_("protocol error\n"));
                return NN_PROTOCOL;
        }
        *msgid = g_strdup(buf);
@@ -288,7 +288,7 @@ gint nntp_post(NNTPSession *session, FILE *fp)
 
        msg = get_outgoing_rfc2822_str(fp);
        if (sock_write_all(SESSION(session)->sock, msg, strlen(msg)) < 0) {
-               log_warning("Error occurred while posting\n");
+               log_warning(_("Error occurred while posting\n"));
                g_free(msg);
                return NN_SOCKET;
        }
@@ -366,7 +366,7 @@ static gint nntp_gen_send(SockInfo *sock, const gchar *format, ...)
 
        strcat(buf, "\r\n");
        if (sock_write_all(sock, buf, strlen(buf)) < 0) {
-               log_warning("Error occurred while sending command\n");
+               log_warning(_("Error occurred while sending command\n"));
                return NN_SOCKET;
        }
 
index 92a6f78..647a727 100644 (file)
@@ -149,7 +149,7 @@ static gint smtp_auth(SMTPSession *session)
                  (session->avail_auth_type & SMTPAUTH_LOGIN) != 0))
                smtp_auth_login(session);
        else {
-               log_warning("SMTP AUTH not available\n");
+               log_warning(_("SMTP AUTH not available\n"));
                return SM_AUTHFAIL;
        }
 
@@ -414,7 +414,7 @@ static gint smtp_session_recv_msg(Session *session, const gchar *msg)
        gboolean cont = FALSE;
 
        if (strlen(msg) < 4) {
-               log_warning("bad SMTP response\n");
+               log_warning(_("bad SMTP response\n"));
                return -1;
        }
 
@@ -434,7 +434,7 @@ static gint smtp_session_recv_msg(Session *session, const gchar *msg)
 
        if (msg[0] == '5' && msg[1] == '0' &&
            (msg[2] == '4' || msg[2] == '3' || msg[2] == '1')) {
-               log_warning("error occurred on SMTP session\n");
+               log_warning(_("error occurred on SMTP session\n"));
                smtp_session->state = SMTP_ERROR;
                smtp_session->error_val = SM_ERROR;
                g_free(smtp_session->error_msg);
@@ -443,7 +443,7 @@ static gint smtp_session_recv_msg(Session *session, const gchar *msg)
        }
 
        if (!strncmp(msg, "535", 3)) {
-               log_warning("error occurred on authentication\n");
+               log_warning(_("error occurred on authentication\n"));
                smtp_session->state = SMTP_ERROR;
                smtp_session->error_val = SM_AUTHFAIL;
                g_free(smtp_session->error_msg);
@@ -452,7 +452,7 @@ static gint smtp_session_recv_msg(Session *session, const gchar *msg)
        }
 
        if (msg[0] != '1' && msg[0] != '2' && msg[0] != '3') {
-               log_warning("error occurred on SMTP session\n");
+               log_warning(_("error occurred on SMTP session\n"));
                smtp_session->state = SMTP_ERROR;
                smtp_session->error_val = SM_ERROR;
                g_free(smtp_session->error_msg);
@@ -463,7 +463,7 @@ static gint smtp_session_recv_msg(Session *session, const gchar *msg)
        if (msg[3] == '-')
                cont = TRUE;
        else if (msg[3] != ' ' && msg[3] != '\0') {
-               log_warning("bad SMTP response\n");
+               log_warning(_("bad SMTP response\n"));
                smtp_session->state = SMTP_ERROR;
                smtp_session->error_val = SM_UNRECOVERABLE;
                return -1;
@@ -508,7 +508,7 @@ static gint smtp_session_recv_msg(Session *session, const gchar *msg)
        case SMTP_STARTTLS:
 #if USE_OPENSSL
                if (session_start_tls(session) < 0) {
-                       log_warning("can't start TLS session\n");
+                       log_warning(_("can't start TLS session\n"));
                        smtp_session->state = SMTP_ERROR;
                        smtp_session->error_val = SM_ERROR;
                        return -1;
@@ -548,7 +548,7 @@ static gint smtp_session_recv_msg(Session *session, const gchar *msg)
                break;
        case SMTP_ERROR:
        default:
-               log_warning("error occurred on SMTP session\n");
+               log_warning(_("error occurred on SMTP session\n"));
                smtp_session->error_val = SM_ERROR;
                return -1;
        }
index 7bd159f..81c6e7c 100644 (file)
@@ -2251,7 +2251,7 @@ FolderItem *folder_item_move_recursive(FolderItem *src, FolderItem *dest)
                new_item->folder = dest->folder;
 
        /* move messages */
-       log_message("Moving %s to %s...\n"
+       log_message(_("Moving %s to %s...\n")
                        src->name, new_item->path);
        folder_item_move_msgs(new_item, mlist);
        
index ccf4337..08bd424 100644 (file)
@@ -2109,7 +2109,7 @@ static void folderview_rename_folder_cb(FolderView *folderview, guint action,
 
        if (item->folder->klass->rename_folder(item->folder, item, new_folder) < 0) {
                alertpanel_error(_("The folder could not be renamed.\n"
-                                  "The new folder name could not be allowed."));
+                                  "The new folder name is not allowed."));
                return;
        }
 
index 5b18267..58d3568 100644 (file)
@@ -665,13 +665,13 @@ static IMAPSession *imap_session_get(Folder *folder)
                        /* Check if this is the first try to establish a
                           connection, if yes we don't try to reconnect */
                        if (rfolder->session == NULL) {
-                               log_warning("Connecting %s failed",
+                               log_warning(_("Connecting to %s failed"),
                                            folder->account->recv_server);
                                session_destroy(SESSION(session));
                                session = NULL;
                        } else {
-                               log_warning("IMAP4 connection to %s has been"
-                                           " disconnected. Reconnecting...\n",
+                               log_warning(_("IMAP4 connection to %s has been"
+                                           " disconnected. Reconnecting...\n"),
                                            folder->account->recv_server);
                                session_destroy(SESSION(session));
                                /* Clear folders session to make imap_session_get create
@@ -710,7 +710,7 @@ static IMAPSession *imap_session_new(const PrefsAccount *account)
 #endif
 
        if (account->set_tunnelcmd) {
-               log_message("creating tunneled IMAP4 connection\n");
+               log_message(_("creating tunneled IMAP4 connection\n"));
 #if USE_OPENSSL
                if ((imap_sock = imap_open_tunnel(account->recv_server, 
                                                  account->tunnelcmd,
@@ -723,7 +723,7 @@ static IMAPSession *imap_session_new(const PrefsAccount *account)
        } else {
                g_return_val_if_fail(account->recv_server != NULL, NULL);
 
-               log_message("creating IMAP4 connection to %s:%d ...\n",
+               log_message(_("creating IMAP4 connection to %s:%d ...\n"),
                            account->recv_server, port);
                
 #if USE_OPENSSL
@@ -762,7 +762,7 @@ static IMAPSession *imap_session_new(const PrefsAccount *account)
 
                ok = imap_cmd_starttls(session);
                if (ok != IMAP_SUCCESS) {
-                       log_warning("Can't start TLS session.\n");
+                       log_warning(_("Can't start TLS session.\n"));
                        session_destroy(SESSION(session));
                        return NULL;
                }
@@ -1096,7 +1096,7 @@ static gint imap_remove_msg(Folder *folder, FolderItem *item, gint uid)
                (IMAP_SESSION(REMOTE_FOLDER(folder)->session),
                &numlist, IMAP_FLAG_DELETED, TRUE);
        if (ok != IMAP_SUCCESS) {
-               log_warning("can't set deleted flags: %d\n", uid);
+               log_warning(_("can't set deleted flags: %d\n"), uid);
                return ok;
        }
 
@@ -1110,7 +1110,7 @@ static gint imap_remove_msg(Folder *folder, FolderItem *item, gint uid)
                g_free(uidstr);
        }
        if (ok != IMAP_SUCCESS) {
-               log_warning("can't expunge\n");
+               log_warning(_("can't expunge\n"));
                return ok;
        }
 
@@ -1144,13 +1144,13 @@ static gint imap_remove_all_msg(Folder *folder, FolderItem *item)
        imap_gen_send(session, "STORE 1:* +FLAGS.SILENT (\\Deleted)");
        ok = imap_cmd_ok(session, NULL);
        if (ok != IMAP_SUCCESS) {
-               log_warning("can't set deleted flags: 1:*\n");
+               log_warning(_("can't set deleted flags: 1:*\n"));
                return ok;
        }
 
        ok = imap_cmd_expunge(session, NULL);
        if (ok != IMAP_SUCCESS) {
-               log_warning("can't expunge\n");
+               log_warning(_("can't expunge\n"));
                return ok;
        }
 
@@ -1186,7 +1186,7 @@ static gint imap_close(Folder *folder, FolderItem *item)
 
                ok = imap_cmd_close(session);
                if (ok != IMAP_SUCCESS)
-                       log_warning("can't close folder\n");
+                       log_warning(_("can't close folder\n"));
 
                g_free(session->mbox);
                session->mbox = NULL;
@@ -1238,7 +1238,7 @@ static gint imap_scan_tree(Folder *folder)
                ok = imap_cmd_list(session, NULL, real_path, argbuf);
                if (ok != IMAP_SUCCESS ||
                    search_array_str(argbuf, "LIST ") == NULL) {
-                       log_warning("root folder %s does not exist\n", real_path);
+                       log_warning(_("root folder %s does not exist\n"), real_path);
                        g_ptr_array_free(argbuf, TRUE);
                        g_free(real_path);
 
@@ -1417,7 +1417,7 @@ static GSList *imap_parse_list(IMAPFolder *folder, IMAPSession *session,
 
        for (;;) {
                if (sock_gets(SESSION(session)->sock, buf, sizeof(buf)) <= 0) {
-                       log_warning("error occurred while getting LIST.\n");
+                       log_warning(_("error occurred while getting LIST.\n"));
                        break;
                }
                strretchomp(buf);
@@ -1425,7 +1425,7 @@ static GSList *imap_parse_list(IMAPFolder *folder, IMAPSession *session,
                        log_print("IMAP4< %s\n", buf);
                        if (sscanf(buf, "%*d %16s", buf) < 1 ||
                            strcmp(buf, "OK") != 0)
-                               log_warning("error occurred while getting LIST.\n");
+                               log_warning(_("error occurred while getting LIST.\n"));
                                
                        break;
                }
@@ -1653,7 +1653,7 @@ static FolderItem *imap_create_folder(Folder *folder, FolderItem *parent,
                ok = imap_cmd_list(session, NULL, imap_path,
                                   argbuf);
                if (ok != IMAP_SUCCESS) {
-                       log_warning("can't create mailbox: LIST failed\n");
+                       log_warning(_("can't create mailbox: LIST failed\n"));
                        g_free(imap_path);
                        g_free(dirpath);
                        ptr_array_free_strings(argbuf);
@@ -1675,7 +1675,7 @@ static FolderItem *imap_create_folder(Folder *folder, FolderItem *parent,
                if (!exist) {
                        ok = imap_cmd_create(session, imap_path);
                        if (ok != IMAP_SUCCESS) {
-                               log_warning("can't create mailbox\n");
+                               log_warning(_("can't create mailbox\n"));
                                g_free(imap_path);
                                g_free(dirpath);
                                return NULL;
@@ -1750,7 +1750,7 @@ static gint imap_rename_folder(Folder *folder, FolderItem *item,
 
        ok = imap_cmd_rename(session, real_oldpath, real_newpath);
        if (ok != IMAP_SUCCESS) {
-               log_warning("can't rename mailbox: %s to %s\n",
+               log_warning(_("can't rename mailbox: %s to %s\n"),
                            real_oldpath, real_newpath);
                g_free(real_oldpath);
                g_free(newpath);
@@ -1812,7 +1812,7 @@ static gint imap_remove_folder(Folder *folder, FolderItem *item)
 
        ok = imap_cmd_delete(session, path);
        if (ok != IMAP_SUCCESS) {
-               log_warning("can't delete mailbox\n");
+               log_warning(_("can't delete mailbox\n"));
                g_free(path);
                return -1;
        }
@@ -1850,7 +1850,7 @@ static GSList *imap_get_uncached_messages(IMAPSession *session,
 
                if (imap_cmd_envelope(session, imapset)
                    != IMAP_SUCCESS) {
-                       log_warning("can't get envelope\n");
+                       log_warning(_("can't get envelope\n"));
                        continue;
                }
 
@@ -1858,7 +1858,7 @@ static GSList *imap_get_uncached_messages(IMAPSession *session,
 
                for (;;) {
                        if ((tmp = sock_getline(SESSION(session)->sock)) == NULL) {
-                               log_warning("error occurred while getting envelope.\n");
+                               log_warning(_("error occurred while getting envelope.\n"));
                                g_string_free(str, TRUE);
                                break;
                        }
@@ -1880,7 +1880,7 @@ static GSList *imap_get_uncached_messages(IMAPSession *session,
                        msginfo = imap_parse_envelope
                                (SESSION(session)->sock, item, str);
                        if (!msginfo) {
-                               log_warning("can't parse envelope: %s\n", str->str);
+                               log_warning(_("can't parse envelope: %s\n"), str->str);
                                continue;
                        }
                        if (item->stype == F_QUEUE) {
@@ -1936,7 +1936,7 @@ static SockInfo *imap_open_tunnel(const gchar *server,
        SockInfo *sock;
 
        if ((sock = sock_connect_cmd(server, tunnelcmd)) == NULL) {
-               log_warning("Can't establish IMAP4 session with: %s\n",
+               log_warning(_("Can't establish IMAP4 session with: %s\n"),
                            server);
                return NULL;
        }
@@ -1958,14 +1958,14 @@ static SockInfo *imap_open(const gchar *server, gushort port)
        SockInfo *sock;
 
        if ((sock = sock_connect(server, port)) == NULL) {
-               log_warning("Can't connect to IMAP4 server: %s:%d\n",
+               log_warning(_("Can't connect to IMAP4 server: %s:%d\n"),
                            server, port);
                return NULL;
        }
 
 #if USE_OPENSSL
        if (ssl_type == SSL_TUNNEL && !ssl_init_socket(sock)) {
-               log_warning("Can't establish IMAP4 session with: %s:%d\n",
+               log_warning(_("Can't establish IMAP4 session with: %s:%d\n"),
                            server, port);
                sock_close(sock);
                return NULL;
@@ -2055,7 +2055,7 @@ static void imap_parse_namespace(IMAPSession *session, IMAPFolder *folder)
        
        if (imap_cmd_namespace(session, &ns_str)
            != IMAP_SUCCESS) {
-               log_warning("can't get namespace\n");
+               log_warning(_("can't get namespace\n"));
                return;
        }
 
@@ -2489,7 +2489,7 @@ static gint imap_select(IMAPSession *session, IMAPFolder *folder,
        ok = imap_cmd_select(session, real_path,
                             exists, recent, unseen, uid_validity);
        if (ok != IMAP_SUCCESS)
-               log_warning("can't select folder: %s\n", real_path);
+               log_warning(_("can't select folder: %s\n"), real_path);
        else {
                session->mbox = g_strdup(path);
                session->folder_content_changed = FALSE;
@@ -2629,7 +2629,7 @@ static gint imap_cmd_authenticate(IMAPSession *session, const gchar *user,
        sock_puts(SESSION(session)->sock, response64);
        ok = imap_cmd_ok(session, NULL);
        if (ok != IMAP_SUCCESS)
-               log_warning("IMAP4 authentication failed.\n");
+               log_warning(_("IMAP4 authentication failed.\n"));
 
        return ok;
 }
@@ -2646,7 +2646,7 @@ static gint imap_cmd_login(IMAPSession *session,
 
        ok = imap_cmd_ok(session, NULL);
        if (ok != IMAP_SUCCESS)
-               log_warning("IMAP4 login failed.\n");
+               log_warning(_("IMAP4 login failed.\n"));
 
        return ok;
 }
@@ -2964,7 +2964,7 @@ static gint imap_cmd_append(IMAPSession *session, const gchar *destfolder,
 
        ok = imap_gen_recv(session, &ret);
        if (ok != IMAP_SUCCESS || ret[0] != '+' || ret[1] != ' ') {
-               log_warning("can't append %s to %s\n", file, destfolder_);
+               log_warning(_("can't append %s to %s\n"), file, destfolder_);
                g_free(ret);
                fclose(fp);
                return IMAP_ERROR;
@@ -3013,7 +3013,7 @@ static gint imap_cmd_append(IMAPSession *session, const gchar *destfolder,
                ok = imap_cmd_ok(session, NULL);
 
        if (ok != IMAP_SUCCESS)
-               log_warning("can't append message to %s\n",
+               log_warning(_("can't append message to %s\n"),
                            destfolder_);
 
        return ok;
@@ -3095,7 +3095,7 @@ static gint imap_cmd_copy(IMAPSession *session, const gchar *seq_set,
                ok = imap_cmd_ok(session, NULL);
 
        if (ok != IMAP_SUCCESS)
-               log_warning("can't copy %s to %s\n", seq_set, destfolder_);
+               log_warning(_("can't copy %s to %s\n"), seq_set, destfolder_);
 
        return ok;
 }
@@ -3145,7 +3145,7 @@ static gint imap_cmd_store(IMAPSession *session, IMAPSet seq_set,
        imap_gen_send(session, "UID STORE %s %s", seq_set, sub_cmd);
 
        if ((ok = imap_cmd_ok(session, NULL)) != IMAP_SUCCESS) {
-               log_warning("error while imap command: STORE %s %s\n",
+               log_warning(_("error while imap command: STORE %s %s\n"),
                            seq_set, sub_cmd);
                return ok;
        }
@@ -3162,7 +3162,7 @@ static gint imap_cmd_expunge(IMAPSession *session, IMAPSet seq_set)
        else    
                imap_gen_send(session, "EXPUNGE");
        if ((ok = imap_cmd_ok(session, NULL)) != IMAP_SUCCESS) {
-               log_warning("error while imap command: EXPUNGE\n");
+               log_warning(_("error while imap command: EXPUNGE\n"));
                return ok;
        }
 
@@ -3175,7 +3175,7 @@ static gint imap_cmd_close(IMAPSession *session)
 
        imap_gen_send(session, "CLOSE");
        if ((ok = imap_cmd_ok(session, NULL)) != IMAP_SUCCESS)
-               log_warning("error while imap command: CLOSE\n");
+               log_warning(_("error while imap command: CLOSE\n"));
 
        return ok;
 }
index bc328fb..7b9e33d 100644 (file)
--- a/src/inc.c
+++ b/src/inc.c
@@ -750,7 +750,7 @@ static IncState inc_pop3_session_do(IncSession *session)
        g_free(buf);
 
        if (session_connect(SESSION(pop3_session), server, port) < 0) {
-               log_warning("Can't connect to POP3 server: %s:%d\n",
+               log_warning(_("Can't connect to POP3 server: %s:%d\n"),
                            server, port);
                if(!prefs_common.no_recv_err_panel) {
                        if((prefs_common.recv_dialog_mode == RECV_DIALOG_ALWAYS) ||
@@ -1202,7 +1202,7 @@ static void inc_cancel(IncProgressDialog *dialog)
 
        session->inc_state = INC_CANCEL;
 
-       log_message("Incorporation cancelled\n");
+       log_message(_("Incorporation cancelled\n"));
 }
 
 gboolean inc_is_active(void)
index 4b44f44..40fb340 100644 (file)
@@ -200,7 +200,7 @@ static Session *news_session_new(const gchar *server, gushort port,
 
        g_return_val_if_fail(server != NULL, NULL);
 
-       log_message("creating NNTP connection to %s:%d ...\n", server, port);
+       log_message(_("creating NNTP connection to %s:%d ...\n"), server, port);
 
 #if USE_OPENSSL
        session = nntp_session_new(server, port, buf, userid, passwd, ssl_type);
@@ -273,8 +273,8 @@ static NNTPSession *news_session_get(Folder *folder)
 
        if (nntp_mode(NNTP_SESSION(rfolder->session), FALSE)
            != NN_SUCCESS) {
-               log_warning("NNTP connection to %s:%d has been"
-                             " disconnected. Reconnecting...\n",
+               log_warning(_("NNTP connection to %s:%d has been"
+                             " disconnected. Reconnecting...\n"),
                            folder->account->nntp_server,
                            folder->account->set_nntpport ?
                            folder->account->nntpport : NNTP_PORT);
@@ -402,7 +402,7 @@ GSList *news_get_group_list(Folder *folder)
                        return NULL;
                }
                if (recv_write_to_file(SESSION(session)->sock, filename) < 0) {
-                       log_warning("can't retrieve newsgroup list\n");
+                       log_warning(_("can't retrieve newsgroup list\n"));
                        session_destroy(SESSION(session));
                        REMOTE_FOLDER(folder)->session = NULL;
                        g_free(filename);
@@ -515,7 +515,7 @@ gint news_post_stream(Folder *folder, FILE *fp)
 
        ok = nntp_post(session, fp);
        if (ok != NN_SUCCESS) {
-               log_warning("can't post article.\n");
+               log_warning(_("can't post article.\n"));
                if (ok == NN_SOCKET) {
                        session_destroy(SESSION(session));
                        REMOTE_FOLDER(folder)->session = NULL;
@@ -541,7 +541,7 @@ static gint news_get_article_cmd(NNTPSession *session, const gchar *cmd,
 
        ok = recv_write_to_file(SESSION(session)->sock, filename);
        if (ok < 0) {
-               log_warning("can't retrieve article %d\n", num);
+               log_warning(_("can't retrieve article %d\n"), num);
                if (ok == -2)
                        return NN_SOCKET;
                else
@@ -590,7 +590,7 @@ static gint news_select_group(NNTPSession *session, const gchar *group,
        if (ok == NN_SUCCESS)
                session->group = g_strdup(group);
        else
-               log_warning("can't select group: %s\n", group);
+               log_warning(_("can't select group: %s\n"), group);
 
        return ok;
 }
@@ -803,7 +803,7 @@ gint news_get_num_list(Folder *folder, FolderItem *item, GSList **msgnum_list, g
 
        ok = news_select_group(session, item->path, &num, &first, &last);
        if (ok != NN_SUCCESS) {
-               log_warning("can't set group: %s\n", item->path);
+               log_warning(_("can't set group: %s\n"), item->path);
                return -1;
        }
 
@@ -811,7 +811,7 @@ gint news_get_num_list(Folder *folder, FolderItem *item, GSList **msgnum_list, g
        if (num <= 0)
                remove_all_numbered_files(dir);
        else if (last < first)
-               log_warning("invalid article range: %d - %d\n",
+               log_warning(_("invalid article range: %d - %d\n"),
                            first, last);
        else {
                for (i = first; i <= last; i++) {
@@ -831,7 +831,7 @@ gint news_get_num_list(Folder *folder, FolderItem *item, GSList **msgnum_list, g
 #define READ_TO_LISTEND(hdr) \
        while (!(buf[0] == '.' && buf[1] == '\r')) { \
                if (sock_gets(SESSION(session)->sock, buf, sizeof(buf)) < 0) { \
-                       log_warning("error occurred while getting %s.\n", hdr); \
+                       log_warning(_("error occurred while getting %s.\n"), hdr); \
                        return msginfo; \
                } \
        }
@@ -849,11 +849,11 @@ MsgInfo *news_get_msginfo(Folder *folder, FolderItem *item, gint num)
        g_return_val_if_fail(item->folder != NULL, NULL);
        g_return_val_if_fail(FOLDER_CLASS(item->folder) == &news_class, NULL);
 
-       log_message("getting xover %d in %s...\n",
+       log_message(_("getting xover %d in %s...\n"),
                    num, item->path);
        ok = nntp_xover(session, num, num);
        if (ok != NN_SUCCESS) {
-               log_warning("can't get xover\n");
+               log_warning(_("can't get xover\n"));
                if (ok == NN_SOCKET) {
                        session_destroy(SESSION(session));
                        REMOTE_FOLDER(item->folder)->session = NULL;
@@ -862,13 +862,13 @@ MsgInfo *news_get_msginfo(Folder *folder, FolderItem *item, gint num)
        }
        
        if (sock_gets(SESSION(session)->sock, buf, sizeof(buf)) < 0) {
-               log_warning("error occurred while getting xover.\n");
+               log_warning(_("error occurred while getting xover.\n"));
                return NULL;
        }
        
        msginfo = news_parse_xover(buf);
        if (!msginfo) {
-               log_warning("invalid xover line: %s\n", buf);
+               log_warning(_("invalid xover line: %s\n"), buf);
        }
 
        READ_TO_LISTEND("xover");
@@ -883,7 +883,7 @@ MsgInfo *news_get_msginfo(Folder *folder, FolderItem *item, gint num)
 
        ok = nntp_xhdr(session, "to", num, num);
        if (ok != NN_SUCCESS) {
-               log_warning("can't get xhdr\n");
+               log_warning(_("can't get xhdr\n"));
                if (ok == NN_SOCKET) {
                        session_destroy(SESSION(session));
                        REMOTE_FOLDER(item->folder)->session = NULL;
@@ -892,7 +892,7 @@ MsgInfo *news_get_msginfo(Folder *folder, FolderItem *item, gint num)
        }
 
        if (sock_gets(SESSION(session)->sock, buf, sizeof(buf)) < 0) {
-               log_warning("error occurred while getting xhdr.\n");
+               log_warning(_("error occurred while getting xhdr.\n"));
                return msginfo;
        }
 
@@ -902,7 +902,7 @@ MsgInfo *news_get_msginfo(Folder *folder, FolderItem *item, gint num)
 
        ok = nntp_xhdr(session, "cc", num, num);
        if (ok != NN_SUCCESS) {
-               log_warning("can't get xhdr\n");
+               log_warning(_("can't get xhdr\n"));
                if (ok == NN_SOCKET) {
                        session_destroy(SESSION(session));
                        REMOTE_FOLDER(item->folder)->session = NULL;
@@ -911,7 +911,7 @@ MsgInfo *news_get_msginfo(Folder *folder, FolderItem *item, gint num)
        }
 
        if (sock_gets(SESSION(session)->sock, buf, sizeof(buf)) < 0) {
-               log_warning("error occurred while getting xhdr.\n");
+               log_warning(_("error occurred while getting xhdr.\n"));
                return msginfo;
        }
 
@@ -934,11 +934,11 @@ static GSList *news_get_msginfos_for_range(NNTPSession *session, FolderItem *ite
        g_return_val_if_fail(session != NULL, NULL);
        g_return_val_if_fail(item != NULL, NULL);
 
-       log_message("getting xover %d - %d in %s...\n",
+       log_message(_("getting xover %d - %d in %s...\n"),
                    begin, end, item->path);
        ok = nntp_xover(session, begin, end);
        if (ok != NN_SUCCESS) {
-               log_warning("can't get xover\n");
+               log_warning(_("can't get xover\n"));
                if (ok == NN_SOCKET) {
                        session_destroy(SESSION(session));
                        REMOTE_FOLDER(item->folder)->session = NULL;
@@ -948,7 +948,7 @@ static GSList *news_get_msginfos_for_range(NNTPSession *session, FolderItem *ite
 
        for (;;) {
                if (sock_gets(SESSION(session)->sock, buf, sizeof(buf)) < 0) {
-                       log_warning("error occurred while getting xover.\n");
+                       log_warning(_("error occurred while getting xover.\n"));
                        return newlist;
                }
                count++;
@@ -961,7 +961,7 @@ static GSList *news_get_msginfos_for_range(NNTPSession *session, FolderItem *ite
 
                msginfo = news_parse_xover(buf);
                if (!msginfo) {
-                       log_warning("invalid xover line: %s\n", buf);
+                       log_warning(_("invalid xover line: %s\n"), buf);
                        continue;
                }
 
@@ -980,7 +980,7 @@ static GSList *news_get_msginfos_for_range(NNTPSession *session, FolderItem *ite
 
        ok = nntp_xhdr(session, "to", begin, end);
        if (ok != NN_SUCCESS) {
-               log_warning("can't get xhdr\n");
+               log_warning(_("can't get xhdr\n"));
                if (ok == NN_SOCKET) {
                        session_destroy(SESSION(session));
                        REMOTE_FOLDER(item->folder)->session = NULL;
@@ -992,7 +992,7 @@ static GSList *news_get_msginfos_for_range(NNTPSession *session, FolderItem *ite
 
        for (;;) {
                if (sock_gets(SESSION(session)->sock, buf, sizeof(buf)) < 0) {
-                       log_warning("error occurred while getting xhdr.\n");
+                       log_warning(_("error occurred while getting xhdr.\n"));
                        return newlist;
                }
                count++;
@@ -1015,7 +1015,7 @@ static GSList *news_get_msginfos_for_range(NNTPSession *session, FolderItem *ite
 
        ok = nntp_xhdr(session, "cc", begin, end);
        if (ok != NN_SUCCESS) {
-               log_warning("can't get xhdr\n");
+               log_warning(_("can't get xhdr\n"));
                if (ok == NN_SOCKET) {
                        session_destroy(SESSION(session));
                        REMOTE_FOLDER(item->folder)->session = NULL;
@@ -1027,7 +1027,7 @@ static GSList *news_get_msginfos_for_range(NNTPSession *session, FolderItem *ite
 
        for (;;) {
                if (sock_gets(SESSION(session)->sock, buf, sizeof(buf)) < 0) {
-                       log_warning("error occurred while getting xhdr.\n");
+                       log_warning(_("error occurred while getting xhdr.\n"));
                        return newlist;
                }
                count++;
index 637421c..942cf9a 100644 (file)
--- a/src/pop.c
+++ b/src/pop.c
@@ -147,14 +147,14 @@ static gint pop3_getauth_apop_send(Pop3Session *session)
        session->state = POP3_GETAUTH_APOP;
 
        if ((start = strchr(session->greeting, '<')) == NULL) {
-               log_warning("Required APOP timestamp not found "
-                           "in greeting\n");
+               log_warning(_("Required APOP timestamp not found "
+                           "in greeting\n"));
                session->error_val = PS_PROTOCOL;
                return -1;
        }
 
        if ((end = strchr(start, '>')) == NULL || end == start + 1) {
-               log_warning("Timestamp syntax error in greeting\n");
+               log_warning(_("Timestamp syntax error in greeting\n"));
                session->error_val = PS_PROTOCOL;
                return -1;
        }
@@ -180,7 +180,7 @@ static gint pop3_getrange_stat_send(Pop3Session *session)
 static gint pop3_getrange_stat_recv(Pop3Session *session, const gchar *msg)
 {
        if (sscanf(msg, "%d %d", &session->count, &session->total_bytes) != 2) {
-               log_warning("POP3 protocol error\n");
+               log_warning(_("POP3 protocol error\n"));
                session->error_val = PS_PROTOCOL;
                return -1;
        } else {
@@ -207,7 +207,7 @@ static gint pop3_getrange_last_recv(Pop3Session *session, const gchar *msg)
        gint last;
 
        if (sscanf(msg, "%d", &last) == 0) {
-               log_warning("POP3 protocol error\n");
+               log_warning(_("POP3 protocol error\n"));
                session->error_val = PS_PROTOCOL;
                return -1;
        } else {
@@ -624,16 +624,17 @@ static Pop3State pop3_lookup_next(Pop3Session *session)
                    msg->recv_time != RECV_TIME_KEEP &&
                    session->current_time - msg->recv_time >=
                    ac->msg_leave_time * 24 * 60 * 60) {
-                       log_print("POP3: Deleting expired message %d\n",
-                                 session->cur_msg);
+                       log_message
+                               (_("POP3: Deleting expired message %d\n"),
+                                  session->cur_msg);
                        pop3_delete_send(session);
                        return POP3_DELETE;
                }
 
                if (size_limit_over)
-                       log_print
-                               ("POP3: Skipping message %d (%d bytes)\n",
-                                 session->cur_msg, size);
+                       log_message
+                               (_("POP3: Skipping message %d (%d bytes)\n"),
+                                  session->cur_msg, size);
 
                if (size == 0 || msg->received || size_limit_over) {
                        session->cur_total_bytes += size;
@@ -663,32 +664,32 @@ static Pop3ErrorValue pop3_ok(Pop3Session *session, const gchar *msg)
                    strstr(msg + 4, "Lock") ||
                    strstr(msg + 4, "LOCK") ||
                    strstr(msg + 4, "wait")) {
-                       log_warning("mailbox is locked\n");
+                       log_warning(_("mailbox is locked\n"));
                        ok = PS_LOCKBUSY;
                } else if (strcasestr(msg + 4, "timeout")) {
-                       log_warning("session timeout\n");
+                       log_warning(_("session timeout\n"));
                        ok = PS_ERROR;
                } else {
                        switch (session->state) {
 #if USE_OPENSSL
                        case POP3_STLS:
-                               log_warning("can't start TLS session\n");
+                               log_warning(_("can't start TLS session\n"));
                                ok = PS_ERROR;
                                break;
 #endif
                        case POP3_GETAUTH_USER:
                        case POP3_GETAUTH_PASS:
                        case POP3_GETAUTH_APOP:
-                               log_warning("error occurred on authentication\n");
+                               log_warning(_("error occurred on authentication\n"));
                                ok = PS_AUTHFAIL;
                                break;
                        case POP3_GETRANGE_LAST:
                        case POP3_GETRANGE_UIDL:
-                               log_warning("command not supported\n");
+                               log_warning(_("command not supported\n"));
                                ok = PS_NOTSUPPORTED;
                                break;
                        default:
-                               log_warning("error occurred on POP3 session\n");
+                               log_warning(_("error occurred on POP3 session\n"));
                                ok = PS_ERROR;
                        }
                }