Matrix Docker Ansible eploy
Du kannst nicht mehr als 25 Themen auswählen Themen müssen entweder mit einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.
 
 

37 Zeilen
1.6 KiB

  1. #!/bin/bash
  2. # SPDX-FileCopyrightText: 2024 Slavi Pantaleev <slavi@devture.com>
  3. # This script extracts translation templates (original English strings) into the `translation-templates/` directory.
  4. # These templates are later used to generate locale files for each language in the `locales/` directory.
  5. #
  6. # By default `sphinx-build` extracts the templates into a `build/gettext` directory, while we'd like to have them in the `translation-templates/` directory.
  7. # To avoid the `POT-Creation-Date` information in templates being updated every time we extract them,
  8. # we restore the `translation-templates/` directory to the `build/gettext` directory before running the script.
  9. set -euxo pipefail
  10. base_path="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"
  11. # Restore the `translation-templates/` directory to the `build/gettext` directory
  12. if [ -d ${base_path}/i18n/build ]; then
  13. rm -rf ${base_path}/i18n/build
  14. fi
  15. mkdir -p ${base_path}/i18n/build
  16. cp -r ${base_path}/i18n/translation-templates ${base_path}/i18n/build/gettext
  17. # Extract translation templates from the documentation into the `build/gettext` directory
  18. sphinx-build -M gettext ${base_path} ${base_path}/i18n/build
  19. # Clean up the build directory
  20. rm -rf ${base_path}/i18n/build/gettext/.doctrees
  21. # Update the `translation-templates/` directory with the new templates
  22. if [ -d ${base_path}/i18n/translation-templates ]; then
  23. rm -rf ${base_path}/i18n/translation-templates
  24. fi
  25. mv ${base_path}/i18n/build/gettext ${base_path}/i18n/translation-templates
  26. # Get rid of the `build` directory
  27. rmdir ${base_path}/i18n/build