5 # Copyright Fusionforge Team
6 # Copyright 2012, Franck Villaume - TrivialDev
8 # This file is part of FusionForge. FusionForge is free software;
9 # you can redistribute it and/or modify it under the terms of the
10 # GNU General Public License as published by the Free Software
11 # Foundation; either version 2 of the Licence, or (at your option)
14 # FusionForge is distributed in the hope that it will be useful,
15 # but WITHOUT ANY WARRANTY; without even the implied warranty of
16 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 # GNU General Public License for more details.
19 # You should have received a copy of the GNU General Public License along
20 # with FusionForge; if not, write to the Free Software Foundation, Inc.,
21 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
24 if [ -e src/translations/fusionforge.pot ] ; then # We're in the parent dir
26 elif [ -e translations/fusionforge.pot ] ; then # probably in src/ (or a renamed src/)
27 cd . # do nothing, but shell syntax requires an instruction in a then-block
28 elif [ -e ../src/translations/fusionforge.pot ] ; then # in tools/ or tests/ or something
30 elif [ -e ../translations/fusionforge.pot ] ; then # In a subdir of src/
33 echo "Couldn't find translations directory..."
37 locales=$(cd translations; ls *.po | sed 's/.po$//' | sort)
40 for l in $(echo $locales | xargs -n 1 | sort) ; do
42 msgfmt --statistics -o /dev/null translations/$l.po
47 for l in $(echo $locales | xargs -n 1 | sort) ; do
48 msgfmt -c -o /dev/null translations/$l.po
53 echo "Usage: $0 stats|check|refresh|build"
64 rm translations/fusionforge.pot
66 find . -type f \( -name \*.php -or -name users -or -name projects \) \
67 | grep -v -e {arch} -e svn-base \
68 | grep -v ^./plugins/wiki/www \
70 | xargs xgettext -d fusionforge -o translations/fusionforge.pot -L PHP --from-code=utf-8
72 for l in $locales ; do
73 echo "Processing $l..."
74 msgmerge -U translations/$l.po translations/fusionforge.pot
78 for l in $locales ; do
79 mkdir -p locales/$l/LC_MESSAGES
80 msgfmt -o locales/$l/LC_MESSAGES/fusionforge.mo translations/$l.po
85 echo "Unknown operation"