Matrix Docker Ansible eploy
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

35 строки
1.5 KiB

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