summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--po/da.po6
-rw-r--r--src/core/init.c3
-rw-r--r--src/core/nls.h14
-rw-r--r--src/tests/Makefile.am2
4 files changed, 19 insertions, 6 deletions
diff --git a/po/da.po b/po/da.po
index 1142e4b..3d0f0c0 100644
--- a/po/da.po
+++ b/po/da.po
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: aplwc 0.0.1\n"
"Report-Msgid-Bugs-To: petermikkelsen10@gmail.com\n"
-"POT-Creation-Date: 2025-11-13 19:45+0100\n"
+"POT-Creation-Date: 2025-11-13 20:02+0100\n"
"PO-Revision-Date: 2025-11-13 19:38+0100\n"
"Last-Translator: Peter Mikkelsen <petermikkelsen10@gmail.com>\n"
"Language-Team: Danish\n"
@@ -19,10 +19,10 @@ msgstr ""
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Generator: Gtranslator 47.1\n"
-#: src/core/init.c:70
+#: src/core/init.c:69
msgid "initialized"
msgstr "initialiseret"
-#: src/core/init.c:77
+#: src/core/init.c:76
msgid "exiting"
msgstr "afslutter"
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 */
diff --git a/src/tests/Makefile.am b/src/tests/Makefile.am
index 8a3efd3..3697f6b 100644
--- a/src/tests/Makefile.am
+++ b/src/tests/Makefile.am
@@ -4,4 +4,4 @@ TESTS = test1
check_PROGRAMS = test1
test1_SOURCES = test1.c
-test1_LDADD = $(top_builddir)/src/core/libaplwc.la
+test1_LDADD = $(top_builddir)/src/core/libaplwc.la $(LIBINTL)