makepot.sh 666 B

1234567891011121314151617
  1. #!/bin/sh
  2. # Prepare script files for inclusion in tinygettext
  3. for LEVELSET in $(ls src); do
  4. SCRIPT_FILES=$(find src/$LEVELSET -name "*.nut")
  5. for SCRIPT_FILE in $SCRIPT_FILES; do
  6. name=$(basename ${SCRIPT_FILE})
  7. name=${name/.nut/}
  8. python ./extract_strings.py ${SCRIPT_FILE} src/$LEVELSET/scripts_${name}.txt
  9. done
  10. done
  11. for LEVELSET in $(ls src); do
  12. find src/$LEVELSET "(" -name "*.stl" -or -name "*.stwm" -or -name "*.txt" ")" -print0 | xargs -0 xgettext --keyword='_:1' --language=Lisp --sort-by-file --output translations/$LEVELSET.pot
  13. sed -i -e 's/\\r\\n/\\n/g' translations/$LEVELSET.pot
  14. rm -f src/$LEVELSET/scripts_*.txt 2> /dev/null
  15. done