[build] Use the the AS_ALL_LINGUAS build script
This removes the need to update po/LINGUAS by hand as the configure script will will handle that with the po files present in the po directory. A list a po files we want to skip (because the translation is a WIP for instance) can be written in po/LINGUAS.skip
This commit is contained in:
parent
38300de80f
commit
c514a9eb8d
15
configure.ac
15
configure.ac
|
@ -194,13 +194,17 @@ AC_SUBST([catalogdir])
|
|||
dnl ***************************************************************************
|
||||
dnl Internationalization
|
||||
dnl ***************************************************************************
|
||||
AS_ALL_LINGUAS
|
||||
IT_PROG_INTLTOOL([0.35.0])
|
||||
|
||||
GETTEXT_PACKAGE="mx-$MX_API_VERSION"
|
||||
AC_SUBST(GETTEXT_PACKAGE)
|
||||
AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE", [GETTEXT package name])
|
||||
ALL_LINGUAS="`grep -v '^#' "$srcdir/po/LINGUAS" | tr '\n' ' '`"
|
||||
AM_GLIB_GNU_GETTEXT
|
||||
AC_DEFINE_UNQUOTED([GETTEXT_PACKAGE],
|
||||
["$GETTEXT_PACKAGE"],
|
||||
[Gettext domain name])
|
||||
GLIB_DEFINE_LOCALEDIR(LOCALEDIR)
|
||||
# IT_PROG_INTLTOOL([0.35.0])
|
||||
AM_GLIB_GNU_GETTEXT
|
||||
|
||||
|
||||
AM_PROG_LIBTOOL
|
||||
|
||||
|
@ -212,7 +216,7 @@ GTK_DOC_CHECK([1.9])
|
|||
|
||||
GOBJECT_INTROSPECTION_CHECK([0.6.4])
|
||||
|
||||
AC_CONFIG_FILES([
|
||||
AC_OUTPUT([
|
||||
Makefile
|
||||
mx.pc
|
||||
mx-gtk.pc
|
||||
|
@ -229,4 +233,3 @@ AC_CONFIG_FILES([
|
|||
tests/Makefile
|
||||
])
|
||||
|
||||
AC_OUTPUT
|
||||
|
|
|
@ -0,0 +1,24 @@
|
|||
# Set ALL_ALL_LINGUAS based on the .po files present. Optional argument is the
|
||||
# name of the po directory. $podir/LINGUAS.ignore can be used to ignore a
|
||||
# subset of the po files.
|
||||
|
||||
AC_DEFUN([AS_ALL_LINGUAS],
|
||||
[
|
||||
AC_MSG_CHECKING([for linguas])
|
||||
podir="m4_default([$1],[$srcdir/po])"
|
||||
linguas=`cd $podir && ls *.po 2>/dev/null | awk 'BEGIN { FS="."; ORS=" " } { print $[]1 }'`
|
||||
if test -f "$podir/LINGUAS.ignore"; then
|
||||
ALL_LINGUAS="";
|
||||
ignore_linguas=`sed -n -e 's/^\s\+\|\s\+$//g' -e '/^#/b' -e '/\S/!b' \
|
||||
-e 's/\s\+/\n/g' -e p "$podir/LINGUAS.ignore"`;
|
||||
for lang in $linguas; do
|
||||
if ! echo "$ignore_linguas" | grep -q "^${lang}$"; then
|
||||
ALL_LINGUAS="$ALL_LINGUAS $lang";
|
||||
fi;
|
||||
done;
|
||||
else
|
||||
ALL_LINGUAS="$linguas";
|
||||
fi;
|
||||
AC_SUBST([ALL_LINGUAS])
|
||||
AC_MSG_RESULT($ALL_LINGUAS)
|
||||
])
|
26
po/LINGUAS
26
po/LINGUAS
|
@ -1,26 +0,0 @@
|
|||
# please keep this list sorted alphabetically
|
||||
#
|
||||
ca
|
||||
de
|
||||
eo
|
||||
es
|
||||
fi
|
||||
fr
|
||||
hu
|
||||
id
|
||||
it
|
||||
ja
|
||||
jp
|
||||
ko
|
||||
lo
|
||||
nl
|
||||
pa
|
||||
pl
|
||||
pt_BR
|
||||
ro
|
||||
sv
|
||||
th
|
||||
tr
|
||||
uk
|
||||
zh_CN
|
||||
zh_TW
|
Loading…
Reference in New Issue