6 usage: $0 <ADDON_DIR> <OUTPUT_FILE>
9 -a [DIR] export the .pot files for all web addons found
10 at target path (default: ./addons)
34 if [ "x$(which msgcat)" = "x" ]
36 echo "The msgcat command from the gettext tools is required in the PATH."
37 echo "On a Debian/Ubuntu system you may install gettext via 'sudo apt-get install gettext'"
41 echo "Extracting all web addons translations"
43 target_dir=${1:-./addons}
44 echo "Using target dir: ${target_dir}"
45 for mod in $(find ${target_dir} -type d -name 'static' -exec sh -c 'basename $(dirname {})' \;); do
47 mod_pot=${target_dir}/${mod}/i18n/${mod}.pot
48 web_pot=${mod_pot}.web
49 mkdir -p $(dirname ${web_pot})
50 $executable ${target_dir}/${mod} ${web_pot}
51 if [ -f "${mod_pot}" ]; then
52 echo "Merging with existing PO file: ${mod_pot}"
53 msgcat --force-po -o "${mod_pot}.tmp" ${mod_pot} ${web_pot}
54 mv ${mod_pot}.tmp ${mod_pot}
57 echo "Renaming to final PO file: ${mod_pot}"
58 mv ${web_pot} ${mod_pot}
63 ./npybabel.py extract -F babel.cfg -o $2 -k _t -k _lt --no-default-keywords $1