3 if [ -e gforge/translations/gforge.pot ] ; then # We're in the parent dir
5 elif [ -e translations/gforge.pot ] ; then # probably in gforge/ (or a renamed gforge/)
6 cd . # do nothing, but shell syntax requires an instruction in a then-block
7 elif [ -e ../gforge/translations/gforge.pot ] ; then # in tools/ or tests/ or something
9 elif [ -e ../translations/gforge.pot ] ; then # In a subdir of gforge/
12 echo "Couldn't find translations directory..."
16 locales=$(ls translations/*.po \
17 | xargs -n1 -iFILE basename FILE .po \
18 | egrep '^[a-z][a-z](_[A-Z][A-Z]$)?' \
22 for l in $(echo $locales | xargs -n 1 | sort) ; do
24 msgfmt --statistics -o /dev/null translations/$l.po
33 rm translations/gforge.pot
35 find -type f -\( -name \*.php -or -name users -or -name projects -\) \
36 | grep -v -e {arch} -e svn-base \
37 | grep -v ^./plugins/wiki \
39 | xargs xgettext -d gforge -o translations/gforge.pot -L PHP --from-code=iso-8859-1
41 for l in $locales ; do
42 echo "Processing $l..."
43 msgmerge -U translations/$l.po translations/gforge.pot
47 for l in $locales ; do
48 mkdir -p locales/$l/LC_MESSAGES
49 msgfmt -o locales/$l/LC_MESSAGES/gforge.mo translations/$l.po
53 echo "Unknown operation"