lang-community.sh 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. #!/bin/sh
  2. #
  3. # lang-community.sh - Community language support script
  4. # Check community languages are defined in `config.h`
  5. #
  6. # Root path
  7. if [ -z "$ROOT_PATH" ]; then
  8. export ROOT_PATH=".."
  9. fi
  10. # Check community language NL = Dutch
  11. COMMUNITY_LANG_NL=$(grep --max-count=1 "^#define COMMUNITY_LANG_NL" $ROOT_PATH/Firmware/config.h| cut -d '_' -f3 |cut -d ' ' -f1)
  12. export NL=$COMMUNITY_LANG_NL
  13. # Use the lines below as a template and replace 'QR' and 'new language'
  14. # Check comminity language QR = new language
  15. #COMMUNITY_LANG_QR=$(grep --max-count=1 "^#define COMMUNITY_LANG_QR" $ROOT_PATH/Firmware/config.h| cut -d '_' -f3 |cut -d ' ' -f1)
  16. #export QR=$COMMUNITY_LANG_QR
  17. #startup message
  18. echo "lang-community.sh started" >&2
  19. echo -n " Source code path: " >&2
  20. if [ -e $ROOT_PATH ]; then echo 'OK' >&2; else echo 'NG!' >&2; _err=1; fi
  21. echo " Found: " >&2
  22. if [ "$COMMUNITY_LANG_NL" = "NL" ]; then
  23. echo " $COMMUNITY_LANG_NL" >&2
  24. echo
  25. ./lang-build.sh nl
  26. fi
  27. # Use the 5 lines below as a template and replace 'QR' and 'qr'
  28. #if [ "$COMMUNITY_LANG_QR" = "QR" ]; then
  29. # echo " $COMMUNITY_LANG_QR" >&2
  30. # echo
  31. # ./lang-build.sh qr
  32. #fi
  33. #exiting function
  34. finish()
  35. {
  36. if [ $1 -eq 0 ]; then
  37. echo "lang-community.sh finished with success" >&2
  38. else
  39. echo "lang-community.sh finished with errors!" >&2
  40. fi
  41. echo
  42. exit $1
  43. }
  44. finish 0