phpmyadmin/scripts/generate-mo
Michal Čihař 05985783b6 Propagate error code
Signed-off-by: Michal Čihař <michal@cihar.com>
2014-04-22 14:04:28 +02:00

30 lines
501 B
Bash
Executable File

#!/bin/sh
if [ x$1 = x--quiet ] ; then
stats=""
shift
else
stats="--statistics"
fi
compile() {
lang=`echo $1 | sed 's@po/\(.*\)\.po@\1@'`
if [ ! -z "$stats" ] ; then
echo -n "$lang: "
fi
mkdir -p locale/$lang/LC_MESSAGES
msgfmt $stats --check -o locale/$lang/LC_MESSAGES/phpmyadmin.mo $1
return $?
}
if [ ! -z "$1" ] ; then
compile po/$1.po
exit $?
fi
for x in po/*.po ; do
compile $x
if [ $? != 0 ] ; then
return $?
fi
done