update-translations.sh 878 B

123456789101112131415161718192021222324252627
  1. #!/bin/sh
  2. TEMPLATE=messages.pot
  3. xgettext -kT_js_decl -kT_sprintf -k_ngettext:1,2 -kT_ngettext:1,2 -k__ -L PHP -o $TEMPLATE *.php include/*.php `find classes -iname '*.php'` `find plugins -iname '*.php'`
  4. xgettext --from-code utf-8 -k__ -kNotify.info -kNotify.error -kNotify.progress -kngettext -L Perl -j -o $TEMPLATE js/*.js `find plugins -iname '*.js'`
  5. xgettext --from-code utf-8 -k__ -kNotify.info -kNotify.error -kNotify.progress -kngettext -L Java -j -o $TEMPLATE js/*.js `find plugins -iname '*.js'`
  6. update_lang() {
  7. if [ -f $1.po ]; then
  8. msgmerge --no-wrap --width 1 -U $1.po $TEMPLATE
  9. msgfmt --statistics $1.po -o $1.mo
  10. else
  11. echo "Usage: $0 [-p|<basename>]"
  12. fi
  13. }
  14. LANGS=`find locale -name 'messages.po'`
  15. for lang in $LANGS; do
  16. echo Updating $lang...
  17. PO_BASENAME=`echo $lang | sed s/.po//`
  18. update_lang $PO_BASENAME
  19. done
  20. #./utils/update-js-translations.sh