My Marlin configs for Fabrikator Mini and CTC i3 Pro B
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

findMissingTranslations.sh 1.1KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. #!/usr/bin/env bash
  2. #
  3. # findMissingTranslations.sh
  4. #
  5. # Locate all language strings needing an update based on English
  6. #
  7. # Usage: findMissingTranslations.sh [language codes]
  8. #
  9. # If no language codes are specified then all languages will be checked
  10. #
  11. [ -d "Marlin" ] && cd "Marlin"
  12. FILES=$(ls language_*.h | grep -v -E "(_en|_test)\.h" | sed -E 's/language_([^\.]+)\.h/\1/')
  13. declare -A STRING_MAP
  14. # Get files matching the given arguments
  15. TEST_LANGS=$FILES
  16. if [[ -n $@ ]]; then
  17. TEST_LANGS=""
  18. for K in "$@"; do
  19. for F in $FILES; do
  20. [[ "$F" != "${F%$K*}" ]] && TEST_LANGS="$TEST_LANGS $F"
  21. done
  22. done
  23. fi
  24. echo -n "Building list of missing strings..."
  25. for i in $(awk '/#ifndef/{print $2}' language_en.h); do
  26. [[ $i == "LANGUAGE_EN_H" ]] && continue
  27. LANG_LIST=""
  28. for j in $TEST_LANGS; do
  29. [[ $(grep -c " ${i} " language_${j}.h) -eq 0 ]] && LANG_LIST="$LANG_LIST $j"
  30. done
  31. [[ -z $LANG_LIST ]] && continue
  32. STRING_MAP[$i]=$LANG_LIST
  33. done
  34. echo
  35. for K in $( printf "%s\n" "${!STRING_MAP[@]}" | sort ); do
  36. printf "%-35s :%s\n" "$K" "${STRING_MAP[$K]}"
  37. done