summaryrefslogtreecommitdiff
path: root/m4macros
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2020-06-02 13:58:07 +0200
committerRomain Bouvier <skunnyk@alteroot.org>2020-06-04 19:54:45 +0200
commitbc9a62e08bdbd1460917e2eb44577ad472026738 (patch)
tree0fcac6801142fee30476c098b7e69880745aa767 /m4macros
parent0628ba009c530cb0a0d1440ea4ebb551a6425103 (diff)
downloadxfce4-dev-tools-bc9a62e08bdbd1460917e2eb44577ad472026738.tar.gz
Let XDT_I18N automatically find the po/*.po as default
Make the LINGUAS argument optional and let it be auto generated from po/*.po if is not specified.
Diffstat (limited to 'm4macros')
-rw-r--r--m4macros/xdt-i18n.m410
1 files changed, 8 insertions, 2 deletions
diff --git a/m4macros/xdt-i18n.m4 b/m4macros/xdt-i18n.m4
index b296647..4335dd6 100644
--- a/m4macros/xdt-i18n.m4
+++ b/m4macros/xdt-i18n.m4
@@ -23,10 +23,13 @@ dnl Internalization M4 macros.
dnl
-dnl XDT_I18N(LINGUAS [, PACKAGE])
+dnl XDT_I18N([LINGUAS][, PACKAGE])
dnl
dnl This macro takes care of setting up everything for i18n support.
dnl
+dnl If LINGUAS isn't specified, it will automatically extract the linguas
+dnl from po/*.po.
+dnl
dnl If PACKAGE isn't specified, it defaults to the package tarname; see
dnl the description of AC_INIT() for an explanation of what makes up
dnl the package tarname. Normally, you don't need to specify PACKAGE,
@@ -40,7 +43,10 @@ AC_DEFUN([XDT_I18N],
AC_SUBST([GETTEXT_PACKAGE])
dnl gettext and stuff
- ALL_LINGUAS="$1"
+ ALL_LINGUAS="m4_ifblank(
+ [$1],
+ [esyscmd([echo $(for i in po/*.po; do test -e "$i" && basename -- "$i" .po; done) | tr -d '\n'])],
+ [$1])"
AM_GLIB_GNU_GETTEXT()
dnl This is required on some Linux systems