check_l7n_source 729 B

1234567891011121314151617181920212223242526272829303132333435
  1. #!/bin/bash
  2. set +o pipefail
  3. output() {
  4. # Markdown output for Github Actions Summary
  5. [ "" == "$GITHUB_STEP_SUMMARY" ] || echo "$1" >> "$GITHUB_STEP_SUMMARY"
  6. echo "$1"
  7. }
  8. output "Check source localized app strings vs base localization"
  9. ## Check base localization of strings in the app source
  10. temp=$(mktemp)
  11. rg -IN -o '".*?".l7n' CutBox/CutBox/Source | sort -u | sed 's/.l7n//' | while read a; do
  12. if rg -q "$a" CutBox/Localization/en.lproj/Localizable.strings; then
  13. continue
  14. else
  15. output "- [✗] $a // not localised"
  16. fi
  17. done > "$temp"
  18. sort -u < "$temp"
  19. errors=$(< "$temp")
  20. rm "$temp"
  21. if [ "" == "$errors" ]; then
  22. output "- [✓] App.l7n strings - Ok"
  23. exit 0
  24. else
  25. exit 1
  26. fi