phpmyadmin/bin/generate-mo
Maurício Meneghini Fauth 6ad017dfc5
Move po and locale directories to resources
- Related to #18512

Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2023-11-30 12:01:48 -03:00

41 lines
752 B
Bash
Executable File

#!/bin/sh
# Do not run as CGI
if [ -n "$GATEWAY_INTERFACE" ] ; then
echo 'Can not invoke as CGI!'
exit 1
fi
if [ "$1" = --quiet ] ; then
stats=""
shift
else
stats="--statistics"
fi
compile() {
lang=$(echo "$1" | sed 's@resources/po/\(.*\)\.po@\1@')
if [ -n "$stats" ] ; then
printf "%s: " "$lang"
fi
mkdir -p resources/locale/"$lang"/LC_MESSAGES
msgfmt $stats --check -o resources/locale/"$lang"/LC_MESSAGES/phpmyadmin.mo "$1"
return $?
}
if [ -n "$1" ] ; then
compile resources/po/"$1".po
exit $?
fi
result=0
for x in resources/po/*.po ; do
compile "$x"
ret=$?
if [ $ret != 0 ] ; then
echo Error when compiling "$x" >&2
result=$ret
fi
done
exit $result