From 167ad7fa3a339da96798da49d05c3125045a87c2 Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Mon, 7 Nov 2022 16:03:47 -0800 Subject: Use gettext() to localize messages if available Originally fixed for Solaris in May 2000 by Steve Swales under Sun bug 4256527 "xhost messages not internationalized" Signed-off-by: Alan Coopersmith --- configure.ac | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index b9c8a9c..d69ebab 100644 --- a/configure.ac +++ b/configure.ac @@ -45,6 +45,27 @@ esac # Checks for library functions. AC_CHECK_FUNCS([inet_aton]) +# Internationalization & localization support +AC_SEARCH_LIBS([gettext], [intl], [USE_GETTEXT="yes"], [USE_GETTEXT="no"]) +AC_MSG_CHECKING([where to install localized messages]) +AC_ARG_WITH([localedir], AS_HELP_STRING([--with-localedir=], + [Path to install message files in (default: datadir/locale)]), + [LOCALEDIR=${withval}], [LOCALEDIR=${datadir}/locale]) +if test "x$LOCALEDIR" = "xno" -o "x$USE_GETTEXT" = "xno" ; then + AC_MSG_RESULT([nowhere]) + USE_GETTEXT="no" +else + AC_SUBST([LOCALEDIR]) + AC_MSG_RESULT([$LOCALEDIR]) +fi + +if test "x$USE_GETTEXT" = "xyes" ; then + AC_DEFINE([USE_GETTEXT], 1, + [Define to 1 if you want to use the gettext() function.]) +fi +AM_CONDITIONAL(USE_GETTEXT, test "x$USE_GETTEXT" = "xyes") + + AC_CONFIG_FILES([ Makefile man/Makefile]) -- cgit v1.2.3