2 if [ -e src/translations/gforge.pot ] ; then # We're in the parent dir
4 elif [ -e translations/gforge.pot ] ; then # probably in src/ (or a renamed src/)
5 cd . # do nothing, but shell syntax requires an instruction in a then-block
6 elif [ -e ../src/translations/gforge.pot ] ; then # in tools/ or tests/ or something
8 elif [ -e ../translations/gforge.pot ] ; then # In a subdir of src/
11 echo "Couldn't find translations directory..."
15 locales=$(ls translations/*.po \
16 | xargs -n1 -iFILE basename FILE .po \
17 | egrep '^[a-z][a-z](_[A-Z][A-Z]$)?' \
21 for l in $(echo $locales | xargs -n 1 | sort) ; do
23 msgfmt --statistics -o /dev/null translations/$l.po
28 for l in $(echo $locales | xargs -n 1 | sort) ; do
29 msgfmt -c -o /dev/null translations/$l.po
41 rm translations/gforge.pot
43 find . -type f \( -name \*.php -or -name users -or -name projects \) \
44 | grep -v -e {arch} -e svn-base \
45 | grep -v ^./plugins/wiki \
47 | xargs xgettext -d gforge -o translations/gforge.pot -L PHP --from-code=iso-8859-1
49 for l in $locales ; do
50 echo "Processing $l..."
51 msgmerge -U translations/$l.po translations/gforge.pot
55 for l in $locales ; do
56 mkdir -p locales/$l/LC_MESSAGES
57 msgfmt -o locales/$l/LC_MESSAGES/gforge.mo translations/$l.po
61 echo "Unknown operation"