lang-community.sh 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  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. #exiting function
  28. finish()
  29. {
  30. if [ $1 -eq 0 ]; then
  31. echo "lang-community.sh finished with success" >&2
  32. else
  33. echo "lang-community.sh finished with errors!" >&2
  34. fi
  35. echo
  36. exit $1
  37. }
  38. finish 0