#!/bin/bash

#[ -x "intltool-update" ] || { echo "error: intltool-update not found, run autogen.sh" > /dev/stderr; exit 1; }
which "intltool-update" || { echo "error: intltool-update not found, run autogen.sh" > /dev/stderr; exit 1; }
INTLTOOL_UPDATE="$(which "intltool-update")"


eval $(grep "^[[:space:]]*ALL_LINGUAS[[:space:]]*=[[:space:]]*\".*\"[[:space:]]*$" "configure.ac")

cd po || exit 1;

for PO_LANG in $ALL_LINGUAS
do
	echo "Updating \"$PO_LANG\""
	$INTLTOOL_UPDATE $PO_LANG || exit 1;
	echo
done
