summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorA. Wilcox <AWilcox@Wilcox-Tech.com>2022-11-26 19:55:12 -0600
committerA. Wilcox <AWilcox@Wilcox-Tech.com>2022-11-26 19:55:12 -0600
commitf0610dec6dafa550c87809d39ea1c43701af4f31 (patch)
tree3dd44ddd7710e00de5f7ca98c2f728d18ed145f2 /src
parentaf50859ed95d2fe6d5a46792b4b7666a3d02e6f3 (diff)
downloadcracklib-f0610dec6dafa550c87809d39ea1c43701af4f31.tar.gz
util: Call bindtextdomain to initialise gettext
This fixes localised message output in the following cases: * non-standard PREFIX on GNU systems GNU systems wouldn't be able to find the message catalog files. * musl systems musl relies on bindtextdomain being called; it has no default catalog path.
Diffstat (limited to 'src')
-rw-r--r--src/util/Makefile.am2
-rw-r--r--src/util/check.c1
2 files changed, 2 insertions, 1 deletions
diff --git a/src/util/Makefile.am b/src/util/Makefile.am
index 4649416..409dc29 100644
--- a/src/util/Makefile.am
+++ b/src/util/Makefile.am
@@ -6,7 +6,7 @@ dist_sbin_SCRIPTS = create-cracklib-dict cracklib-format
LDADD = ../lib/libcrack.la
-AM_CPPFLAGS = -I. -I.. -I$(top_srcdir)/lib '-DDEFAULT_CRACKLIB_DICT="$(DEFAULT_CRACKLIB_DICT)"' -Wall
+AM_CPPFLAGS = -I. -I.. -I$(top_srcdir)/lib '-DDEFAULT_CRACKLIB_DICT="$(DEFAULT_CRACKLIB_DICT)"' '-DLOCALEDIR="$(localedir)"' -Wall
cracklib_check_SOURCES = check.c
cracklib_check_LDADD = $(LDADD) $(LTLIBINTL)
diff --git a/src/util/check.c b/src/util/check.c
index 7db0c88..bb8fff5 100644
--- a/src/util/check.c
+++ b/src/util/check.c
@@ -24,6 +24,7 @@ main(int argc, char **argv)
setlocale(LC_ALL, "");
#ifdef ENABLE_NLS
+ bindtextdomain(PACKAGE, LOCALEDIR);
textdomain(PACKAGE);
#endif