summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorpsykose <alice@ayaya.dev>2023-03-15 16:07:35 +0000
committerpsykose <alice@ayaya.dev>2023-03-15 17:07:35 +0100
commit2e0f854bada720ff4fbd13aed4f87087d466274d (patch)
tree087a44bbdfa4eb6af32ba9b8f20b470d94c443d8 /src
parent8de082058385a8694d444bb6623a5c170272395c (diff)
downloadcracklib-2e0f854bada720ff4fbd13aed4f87087d466274d.tar.gz
python: ensure to call bindtextdomain before textdomain
same reasoning as in f0610dec6dafa550c87809d39ea1c43701af4f31 : 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/python/Makefile.am1
-rw-r--r--src/python/_cracklib.c1
2 files changed, 2 insertions, 0 deletions
diff --git a/src/python/Makefile.am b/src/python/Makefile.am
index 98a89f8..40e387e 100644
--- a/src/python/Makefile.am
+++ b/src/python/Makefile.am
@@ -2,6 +2,7 @@ if BUILD_PYTHON
python_PYTHON = cracklib.py test_cracklib.py
pyexec_LTLIBRARIES = _cracklib.la
AM_CFLAGS = -I$(top_srcdir)/lib -Wall
+AM_CPPFLAGS = '-DLOCALEDIR="$(localedir)"'
_cracklib_la_LDFLAGS = -module -avoid-version $(top_builddir)/lib/libcrack.la
DEFS += '-DDEFAULT_CRACKLIB_DICT="$(DEFAULT_CRACKLIB_DICT)"'
DEFS += '-DPYTHON_H="python@PYTHON_VERSION@/Python.h"'
diff --git a/src/python/_cracklib.c b/src/python/_cracklib.c
index d81e615..2d8440e 100644
--- a/src/python/_cracklib.c
+++ b/src/python/_cracklib.c
@@ -135,6 +135,7 @@ _cracklib_FascistCheck(PyObject *self, PyObject *args, PyObject *kwargs)
setlocale(LC_ALL, "");
#ifdef ENABLE_NLS
+ bindtextdomain(PACKAGE, LOCALEDIR);
textdomain("cracklib");
#endif