1 dnl Copyright © 2011 Nick Bowler
3 dnl Computes the set of .po and .mo files based on the LINGUAS environment
4 dnl variable. The variable POFILES is set to the complete list of .po files,
5 dnl according to the LINGUAS file in the po directory. The variable MOFILES
6 dnl is set to the list of .mo files that the user has requested be installed.
7 dnl Both POFILES and MOFILES are AC_SUBSTed.
9 dnl License WTFPL2: Do What The Fuck You Want To Public License, version 2.
10 dnl This is free software: you are free to do what the fuck you want to.
11 dnl There is NO WARRANTY, to the extent permitted by law.
13 AC_DEFUN([DX_LINGUAS], [dnl
14 AC_REQUIRE([AM_GNU_GETTEXT])
19 if test -f "$srcdir/po/LINGUAS"; then
20 ALL_LINGUAS=`sed 's/#.*$//' "$srcdir/po/LINGUAS"`
23 if test x"$LINGUAS" != x"all"; then
24 # Replicate la_CC-style codes as la.
25 LINGUAS=`printf '%s\n' "$LINGUAS" \
26 | [sed 's/\([^_[:space:]]*\)_[^[:space:]]*/& \1/g']`
28 printf '%s\n' $ALL_LINGUAS | sort > conftest.LINGUAS
29 LINGUAS=`printf '%s\n' $LINGUAS | sort \
30 | join - conftest.LINGUAS`
35 # Note: $srcdir is not used here because these variables are for make.
36 set x $ALL_LINGUAS; shift
39 *) POFILES=`printf "po/%s.po\n" "${@}"` ;;
42 if test x"$USE_NLS" = x"yes"; then
46 *) MOFILES=`printf "po/%s.mo\n" "${@}"` ;;