update_pot.sh 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. # run this script from the root directory to re-generate the .pot file
  2. #
  3. # ./data/po/update_pot.sh
  4. CPP_FILE_LIST="`find ./src \
  5. -name '*.cpp' -or \
  6. -name '*.c' -or \
  7. -name '*.hpp' -or \
  8. -name "*.h" \
  9. `"
  10. XML_FILE_LIST="`find ./data ../stk-assets/tracks ../stk-assets/karts \
  11. -name 'achievements.xml' -or \
  12. -name 'kart.xml' -or \
  13. -name 'track.xml' -or \
  14. -name 'scene.xml' -or \
  15. -name '*.challenge' -or \
  16. -name '*.grandprix' -or \
  17. -name '*.stkgui' \
  18. `"
  19. ANGELSCRIPT_FILE_LIST="`find ./data ../stk-assets/tracks -name '*.as'`"
  20. echo "--------------------"
  21. echo " Source Files :"
  22. echo "--------------------"
  23. echo $CPP_FILE_LIST
  24. echo $ANGELSCRIPT_FILE_LIST
  25. echo "--------------------"
  26. echo " XML Files :"
  27. echo "--------------------"
  28. echo $XML_FILE_LIST
  29. # XML Files
  30. python ./data/po/extract_strings_from_XML.py $XML_FILE_LIST
  31. echo "---------------------------"
  32. echo " Generating .pot file..."
  33. # XML Files
  34. xgettext -d supertuxkart --keyword=_ --add-comments="I18N:" \
  35. -p ./data/po -o supertuxkart.pot \
  36. --no-location --from-code=UTF-8 ./data/po/gui_strings.h \
  37. --package-name=supertuxkart
  38. # C++ Files
  39. xgettext -j -d supertuxkart --keyword=_ --keyword=N_ --keyword=_LTR \
  40. --keyword=_C:1c,2 --keyword=_P:1,2 \
  41. --keyword=_CP:1c,2,3 --add-comments="I18N:" \
  42. -p ./data/po -o supertuxkart.pot $CPP_FILE_LIST \
  43. --package-name=supertuxkart
  44. # Angelscript files (xgettext doesn't support AS so pretend it's c++)
  45. xgettext -j -d supertuxkart --keyword="translate" --add-comments="I18N:" \
  46. -p ./data/po -o supertuxkart.pot $ANGELSCRIPT_FILE_LIST \
  47. --package-name=supertuxkart --language=c++
  48. echo " Done"
  49. echo "---------------------------"