make_lang_en_es.sh 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. #!/bin/sh
  2. # make_lang_en_es.sh - create en_es dictionary from msgs
  3. echo "make_lang_en_es.sh"
  4. echo "please wait..."
  5. cat msgs_en_used_once.txt msgs_en_used_more.txt |\
  6. sed "s/\bCUSTOM_MENDEL_NAME\b/\"Prusa i3 MK3\"/g" |\
  7. sed "s/\" \"//g" |\
  8. sed 's/\\"/\\x22/g' |\
  9. sed 's/\\xF8/\\xf8/g' > msgs_en_.txt
  10. cat msgs_es.txt |\
  11. sed "s/\bCUSTOM_MENDEL_NAME\b/\"Prusa i3 MK3\"/g" |\
  12. sed "s/\" \"//g" |\
  13. sed 's/\\"/\\x22/g' |\
  14. sed 's/\\xF8/\\xf8/g' > msgs_es_.txt
  15. cat lang_en.txt | sed "/^$/d;/^#/d" | sed "s/\\\/\\\\\\\/g" |\
  16. while read text; do
  17. msg=''
  18. msg=$(grep -a -m 1 -h -w -F "$text" msgs_en_.txt)
  19. if [ -z "$msg" ]; then
  20. echo "#???"
  21. echo "$text"
  22. echo '"\x00"'
  23. echo
  24. else
  25. name=$(echo $msg | cut -f1 -d' ')
  26. cols=$(echo $msg | cut -f2 -d' ')
  27. rows=$(echo $msg | cut -f3 -d' ')
  28. echo "#$name $cols $rows"
  29. echo "$text"
  30. msg_es=$(grep -a -m 1 -h "^$name " msgs_es_.txt)
  31. if [ -z "$msg_es" ]; then
  32. echo '"\x00"'
  33. echo
  34. else
  35. text_es=$(echo $msg_es | cut -f2- -d' ')
  36. echo "$text_es"
  37. echo
  38. fi
  39. fi
  40. done > lang_en_es.txt
  41. rm msgs_en_.txt
  42. rm msgs_es_.txt
  43. echo "finished... press any key"
  44. read
  45. exit
  46. #not found in msgs_es:
  47. # MSG_EXTRUDER_CORRECTION_OFF " [off"
  48. # MSG_MEASURED_OFFSET "[0;0] point offset"
  49. # MSG_EXTRUDER_CORRECTION "E-correct"
  50. # MSG_PRUSA3D_FORUM "forum.prusa3d.com"
  51. # MSG_PRUSA3D_HOWTO "howto.prusa3d.com"
  52. # MSG_PRINTER_DISCONNECTED "Printer disconnected"
  53. # MSG_PRUSA3D "prusa3d.com"
  54. # MSG_TEMP_CAL_WARNING "Stable ambient temperature 21-26C is needed a rigid stand is required."