summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2022-11-09 13:19:21 -0800
committerAlan Coopersmith <alan.coopersmith@oracle.com>2022-11-09 13:19:21 -0800
commitf286ef347dc9e87c6d5b5b8bce22afdeb82af4ed (patch)
treec04f47f0e67b8456283e87e3c7b9fb0dce6449de /configure.ac
parent57f670195bb1854edbea97b672ae966343965bb7 (diff)
Use gettext() to localize messages if available
Originally fixed for Solaris in August 2000 by Jay Hobson under Sun bug 4256527 "Internationalize xfontsel" Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac20
1 files changed, 20 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index 2b5b9b5..51f410f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -47,6 +47,26 @@ AC_ARG_WITH(appdefaultdir,
[appdefaultdir="$withval"], [appdefaultdir="${xt_appdefaultdir}"])
AC_SUBST(appdefaultdir)
+# 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>],
+ [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