gettext 적용
authorChoe Hwanjin <choe.hwanjin@gmail.com>
Wed, 29 Dec 2010 13:38:28 +0000 (22:38 +0900)
committerChoe Hwanjin <choe.hwanjin@gmail.com>
Wed, 29 Dec 2010 13:38:28 +0000 (22:38 +0900)
git-svn-id: http://kldp.net/svn/hangul/libhangul/trunk@251 8f00fcd2-89fc-0310-932e-b01be5b65e01

tools/Makefile.am
tools/hangul.c

index ea26175..3a50d0c 100644 (file)
@@ -2,4 +2,5 @@
 bin_PROGRAMS = hangul
 
 hangul_SOURCES = hangul.c
+hangul_CFLAGS = -DLOCALEDIR=\"$(localedir)\"
 hangul_LDADD = ../hangul/libhangul.la
index 699ec28..9fe6bf3 100644 (file)
@@ -14,8 +14,7 @@
 #include <iconv.h>
 
 #include "../hangul/hangul.h"
-
-#define _(x) (x)
+#include "../hangul/hangul-gettext.h"
 
 #ifdef WORDS_BIGENDIAN
 #define UCS4  "UCS-4BE"
@@ -260,6 +259,10 @@ main(int argc, char *argv[])
     HangulInputContext* ic;
     bool strict_order = false;
 
+#ifdef ENABLE_NLS
+    bindtextdomain(GETTEXT_PACKAGE, LOCALEDIR);
+#endif
+
     setlocale(LC_ALL, "");
 
     res = EXIT_SUCCESS;