summaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
Diffstat (limited to 'src/core')
-rw-r--r--src/core/init.c3
-rw-r--r--src/core/nls.h14
2 files changed, 15 insertions, 2 deletions
diff --git a/src/core/init.c b/src/core/init.c
index 7f50935..04a7135 100644
--- a/src/core/init.c
+++ b/src/core/init.c
@@ -45,8 +45,7 @@ aplwc_init_fns(APLWCFunctions *fns)
APLWC *
aplwc_init(APLWCFunctions *fns, void *aux)
{
- char *domdir = bindtextdomain(PACKAGE, LOCALEDIR);
- char *dom = textdomain(PACKAGE);
+ init_nls();
size_t size = sizeof(APLWC) + (APLWC_ALIGNMENT - 1) + WS_START_SIZE + (WS_ALIGNMENT - 1);
intptr_t base = (intptr_t)fns->alloc(aux, size);
diff --git a/src/core/nls.h b/src/core/nls.h
index c1ef405..dfa640d 100644
--- a/src/core/nls.h
+++ b/src/core/nls.h
@@ -1,7 +1,21 @@
#ifndef NLS_H
#define NLS_H
+#if ENABLE_NLS
+
+#include <config.h>
#include <libintl.h>
#define _(S) gettext(S)
+#define init_nls() \
+ do{ \
+ bindtextdomain(PACKAGE, LOCALEDIR); \
+ textdomain(PACKAGE); \
+ }while(0);
+
+#else /* ENABLE_NLS */
+
+#define _(S) S
+#define init_nls() (void)0
+#endif /* ENABLE_NLS */
#endif /* NLS_H */