makepot.sh 962 B

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