Translated using Weblate (Portuguese)
[phpmyadmin.git] / bin / generate-mo
blob1a1a046e6704264d2fa14afca4cb6cdf282167bc
1 #!/bin/sh
2 # Do not run as CGI
3 if [ -n "$GATEWAY_INTERFACE" ] ; then
4 echo 'Can not invoke as CGI!'
5 exit 1
6 fi
8 if [ "$1" = --quiet ] ; then
9 stats=""
10 shift
11 else
12 stats="--statistics"
15 compile() {
16 lang=$(echo "$1" | sed 's@resources/po/\(.*\)\.po@\1@')
17 if [ -n "$stats" ] ; then
18 printf "%s: " "$lang"
20 mkdir -p resources/locale/"$lang"/LC_MESSAGES
21 msgfmt $stats --check -o resources/locale/"$lang"/LC_MESSAGES/phpmyadmin.mo "$1"
22 return $?
25 if [ -n "$1" ] ; then
26 compile resources/po/"$1".po
27 exit $?
30 result=0
31 for x in resources/po/*.po ; do
32 compile "$x"
33 ret=$?
34 if [ $ret != 0 ] ; then
35 echo Error when compiling "$x" >&2
36 result=$ret
38 done
40 exit $result