Revision: 7189
Author: ek.kato
Date: Wed Jul 6 19:11:32 2011
Log: * Merge r7188 from trunk.
http://code.google.com/p/uim/source/detail?r=7189
Modified:
/branches/1.7/po/POTFILES.in
/branches/1.7/scm/dict-socket.scm
/branches/1.7/scm/fileio.scm
/branches/1.7/scm/process.scm
/branches/1.7/uim/dynlib.c
/branches/1.7/uim/skk.c
/branches/1.7/uim/uim-notify.c
/branches/1.7/uim/uim-notify.h
/branches/1.7/uim/uim.c
=======================================
--- /branches/1.7/po/POTFILES.in Mon May 9 23:22:26 2011
+++ /branches/1.7/po/POTFILES.in Wed Jul 6 19:11:32 2011
@@ -42,6 +42,7 @@
scm/direct.scm
scm/elatin-custom.scm
scm/elatin.scm
+scm/fileio.scm
scm/generic-custom.scm
scm/generic-key-custom.scm
scm/generic.scm
=======================================
--- /branches/1.7/scm/dict-socket.scm Thu Jan 6 18:09:56 2011
+++ /branches/1.7/scm/dict-socket.scm Wed Jul 6 19:11:32 2011
@@ -74,7 +74,7 @@
(receive (responce message)
(dict-server-parse-responce line)
(cond ((dict-server-error-responce? responce)
- (uim-notify-fatal (format "dict (~a): ~a" (N_ "Error
Response") message)))
+ (uim-notify-fatal (format "dict (~a): ~a" (_ "Error
Response") message)))
((string=? "151" responce)
(dict-server-get-1yz port))
((string=? "150" responce)
@@ -83,7 +83,7 @@
(dict-server-parse-responce responce-line)
(if (string=? "151" (substring responce-line 0 3))
(dict-server-get-1yz port)
- (uim-notify-fatal (format "dict (~a): ~a"
(N_ "Error Response") message))))))
+ (uim-notify-fatal (format "dict (~a): ~a" (_ "Error
Response") message))))))
((string=? "2" (substring responce 0 1))
'())
((string=? "4" (substring responce 0 1))
@@ -91,7 +91,7 @@
((string=? "5" (substring responce 0 1))
'())
(else
- (uim-notify-fatal (format "~a ~a" (N_ "dict: Protocol error")
message)))))))
+ (uim-notify-fatal (format "~a ~a" (_ "dict: Protocol error")
message)))))))
(define (dict-server-parse-banner port)
=======================================
--- /branches/1.7/scm/fileio.scm Thu Jan 6 18:09:56 2011
+++ /branches/1.7/scm/fileio.scm Wed Jul 6 19:11:32 2011
@@ -235,7 +235,7 @@
fd-list))
(ret (file-poll fds timeout)))
(cond ((not ret)
- (uim-notify-fatal (format "~a: '~a'" (N_ "poll error")
(posix-error-string)))
+ (uim-notify-fatal (format "~a: '~a'" (_ "poll error")
(posix-error-string)))
#f)
((null? ret)
;;(uim-notify-info (N_ "timeout"))
=======================================
--- /branches/1.7/scm/process.scm Thu Jan 6 18:09:56 2011
+++ /branches/1.7/scm/process.scm Wed Jul 6 19:11:32 2011
@@ -82,7 +82,7 @@
(file-close pout-out)
(if (= (process-execute file argv) -1)
- (uim-notify-fatal (format (N_ "cannot execute ~a") file)))
+ (uim-notify-fatal (format (_ "cannot execute ~a") file)))
(set! ret (bitwise-ior ret process-exec-failed))
(file-write-string 1 (number->string ret))
(_exit 1)
@@ -111,7 +111,7 @@
((= 0 pid) ;; child
(daemon 0 1)
(if (= (process-execute file argv) -1)
- (uim-notify-fatal (format (N_ "cannot execute ~a") file)))
+ (uim-notify-fatal (format (_ "cannot execute ~a") file)))
(_exit 1))
(else
pid)))))
=======================================
--- /branches/1.7/uim/dynlib.c Tue Jul 5 09:04:53 2011
+++ /branches/1.7/uim/dynlib.c Wed Jul 6 19:11:32 2011
@@ -146,7 +146,7 @@
library = dlopen(REFER_C_STR(name), RTLD_NOW);
if (library == NULL) {
- uim_notify_fatal(N_("dynlib: %s: Load failed."), dlerror());
+ uim_notify_fatal(_("dynlib: %s: Load failed."), dlerror());
return uim_scm_f();
}
@@ -155,7 +155,7 @@
dynlib_instance_quit
= (void (*)(void))dlfunc(library, "uim_dynlib_instance_quit");
if (!dynlib_instance_init) {
- uim_notify_fatal(N_("dynlib: %s: Initialization failed."),
REFER_C_STR(name));
+ uim_notify_fatal(_("dynlib: %s: Initialization failed."),
REFER_C_STR(name));
return uim_scm_f();
}
=======================================
--- /branches/1.7/uim/skk.c Fri Jan 21 18:16:42 2011
+++ /branches/1.7/uim/skk.c Wed Jul 6 19:11:32 2011
@@ -3693,10 +3693,7 @@
freeaddrinfo(aitop);
if (sock == -1) {
- /* FIXME: gettext here to expand %s in accordance with the
- * locale for the selected notification agent. See also the TODO
- * comment of uim-notify.h -- YamaKen 2008-02-11 */
- uim_notify_fatal(N_("uim-skk: connect to %s port %s failed"),
hostname, port);
+ uim_notify_fatal(_("uim-skk: connect to %s port %s failed"), hostname,
port);
return 0;
}
=======================================
--- /branches/1.7/uim/uim-notify.c Thu Jan 6 18:09:56 2011
+++ /branches/1.7/uim/uim-notify.c Wed Jul 6 19:11:32 2011
@@ -50,7 +50,7 @@
#include "uim-scm-abbrev.h"
#include "uim-internal.h"
#include "uim-notify.h"
-
+#include "gettext.h"
#define NOTIFY_PLUGIN_PATH PKGLIBDIR "/notify"
#define NOTIFY_PLUGIN_PREFIX "libuimnotify-"
@@ -367,7 +367,7 @@
uim_notify_stderr_info(const char *msg)
{
fputs("libuim: [info] ", stderr);
- fputs(msg, stderr);
+ fputs(dgettext(GETTEXT_PACKAGE, msg), stderr);
fputs("\n", stderr);
return UIM_TRUE;
@@ -380,7 +380,7 @@
* exhaustion, printf()s with indirect directives are intentionally
* avoided here. -- YamaKen 2008-02-11 */
fputs("libuim: [fatal] ", stderr);
- fputs(msg, stderr);
+ fputs(dgettext(GETTEXT_PACKAGE, msg), stderr);
fputs("\n", stderr);
return UIM_TRUE;
=======================================
--- /branches/1.7/uim/uim-notify.h Thu Jan 6 18:09:56 2011
+++ /branches/1.7/uim/uim-notify.h Wed Jul 6 19:11:32 2011
@@ -36,12 +36,11 @@
*/
-/* TODO: Add a new API to get the locale for the currently activated
- * notification agent to gettext message strings contain format string
- * such as "uim-canna: Failed to mount dictionary %s." in client
- * side. The locale of the process is not appropriate since it may be
- * ja_JP.eucJP and so on and ordinary notification agents expect
- * UTF-8. -- YamaKen 2008-02-11 */
+/*
+ * It is notification plugin's responsibility to convert messages into
+ * encoding suitable for the notification agents. Messages are assumed to
+ * be tranlated by gettext into the encoding of working locale of the
process.
+ */
#ifndef UIM_NOTIFY_H
#define UIM_NOTIFY_H
=======================================
--- /branches/1.7/uim/uim.c Tue Jul 5 09:04:53 2011
+++ /branches/1.7/uim/uim.c Wed Jul 6 19:11:32 2011
@@ -767,7 +767,7 @@
{
const char *msg = REFER_C_STR(msg_);
- return MAKE_BOOL(uim_notify_info("%s", msg));
+ return MAKE_BOOL(uim_notify_info("%s", dgettext(GETTEXT_PACKAGE, msg)));
}
static uim_lisp
@@ -775,7 +775,7 @@
{
const char *msg = REFER_C_STR(msg_);
- return MAKE_BOOL(uim_notify_fatal("%s", msg));
+ return MAKE_BOOL(uim_notify_fatal("%s", dgettext(GETTEXT_PACKAGE, msg)));
}
void