Translated using Weblate (Slovenian)
[phpmyadmin.git] / scripts / generate-mo
blob3dc88f6199125bccba4ce168ed894112de82b12c
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 [ x$1 = x--quiet ] ; then
9 stats=""
10 shift
11 else
12 stats="--statistics"
15 compile() {
16 lang=`echo $1 | sed 's@po/\(.*\)\.po@\1@'`
17 if [ ! -z "$stats" ] ; then
18 echo -n "$lang: "
20 mkdir -p locale/$lang/LC_MESSAGES
21 msgfmt $stats --check -o locale/$lang/LC_MESSAGES/phpmyadmin.mo $1
22 return $?
25 if [ ! -z "$1" ] ; then
26 compile po/$1.po
27 exit $?
30 result=0
31 for x in po/*.po ; do
32 compile $x
33 ret=$?
34 if [ $ret != 0 ] ; then
35 tput setf 4 >&2
36 echo Error when compiling $x >&2
37 tput sgr0 >&2
38 result=$ret
40 done
42 exit $result