update-translations.sh 470 B

12345678910111213141516171819202122
  1. #!/bin/sh
  2. TEMPLATE=af_img_phash.pot
  3. xgettext -k__ -kT_sprintf -L PHP -o $TEMPLATE *.php
  4. xgettext -k__ -L Java -j -o $TEMPLATE *.js
  5. update_lang() {
  6. if [ -f $1.po ]; then
  7. msgmerge --no-wrap --width 1 -U $1.po $TEMPLATE
  8. msgfmt --statistics $1.po -o $1.mo
  9. else
  10. echo "Usage: $0 [-p|<basename>]"
  11. fi
  12. }
  13. LANGS=`find locale -name 'af_img_phash.po'`
  14. for lang in $LANGS; do
  15. echo Updating $lang...
  16. PO_BASENAME=`echo $lang | sed s/.po//`
  17. update_lang $PO_BASENAME
  18. done