sort_strings.sh 1.2 KB

12345678910111213141516171819202122232425262728293031323334
  1. #!/bin/zsh
  2. set -eu
  3. type xsltproc >/dev/null
  4. type xmllint >/dev/null
  5. set -euo pipefail
  6. SCRIPT_PATH=$(readlink -f "$0")
  7. SCRIPT_DIR=$(dirname "$SCRIPT_PATH")
  8. (
  9. set -euo pipefail
  10. cd "$SCRIPT_DIR" || exit
  11. sort_xml_file() {
  12. xsltproc --output "$1" android_strings_format.xslt "$1"
  13. export XMLLINT_INDENT=" "
  14. xmllint --format --encode "utf-8" --output "$1" "$1"
  15. }
  16. sort_xml_file "../ffupdater/src/main/res/values/strings.xml"
  17. sort_xml_file "../ffupdater/src/main/res/values-bg/strings.xml"
  18. sort_xml_file "../ffupdater/src/main/res/values-cs/strings.xml"
  19. sort_xml_file "../ffupdater/src/main/res/values-de/strings.xml"
  20. sort_xml_file "../ffupdater/src/main/res/values-fr/strings.xml"
  21. sort_xml_file "../ffupdater/src/main/res/values-it/strings.xml"
  22. sort_xml_file "../ffupdater/src/main/res/values-ja/strings.xml"
  23. sort_xml_file "../ffupdater/src/main/res/values-pl/strings.xml"
  24. sort_xml_file "../ffupdater/src/main/res/values-pt-rBR/strings.xml"
  25. sort_xml_file "../ffupdater/src/main/res/values-ru/strings.xml"
  26. sort_xml_file "../ffupdater/src/main/res/values-tr/strings.xml"
  27. sort_xml_file "../ffupdater/src/main/res/values-uk/strings.xml"
  28. )