lang-clean.sh 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. #!/bin/sh
  2. #
  3. # clean.sh - multi-language support script
  4. # Remove all language output files from lang folder.
  5. #
  6. result=0
  7. rm_if_exists()
  8. {
  9. if [ -e $1 ]; then
  10. echo -n " removing '$1'..." >&2
  11. if rm $1; then
  12. echo "OK" >&2
  13. else
  14. echo "NG!" >&2
  15. result=1
  16. fi
  17. fi
  18. }
  19. clean_lang()
  20. {
  21. if [ "$1" = "en" ]; then
  22. rm_if_exists lang_$1.tmp
  23. else
  24. rm_if_exists lang_$1.tmp
  25. rm_if_exists lang_en_$1.tmp
  26. rm_if_exists lang_en_$1.dif
  27. rm_if_exists lang_$1.ofs
  28. rm_if_exists lang_$1.txt
  29. fi
  30. rm_if_exists lang_$1_check.dif
  31. rm_if_exists lang_$1.bin
  32. rm_if_exists lang_$1.dat
  33. rm_if_exists lang_$1_1.tmp
  34. rm_if_exists lang_$1_2.tmp
  35. }
  36. echo "lang-clean.sh started" >&2
  37. clean_lang en
  38. clean_lang cz
  39. clean_lang de
  40. clean_lang es
  41. clean_lang fr
  42. clean_lang it
  43. clean_lang pl
  44. #Community language support
  45. #Dutch
  46. clean_lang nl
  47. #Use the 2 lines below as a template and replace 'qr'
  48. ##New language
  49. #clean_lang_qr
  50. echo -n "lang-clean.sh finished" >&2
  51. if [ $result -eq 0 ]; then
  52. echo " with success" >&2
  53. else
  54. echo " with errors!" >&2
  55. fi
  56. case "$-" in
  57. *i*) echo "press enter key" >&2; read ;;
  58. esac
  59. exit $result