Matrix Docker Ansible eploy
Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.
 
 

66 linhas
3.3 KiB

  1. # SPDX-FileCopyrightText: 2024 Slavi Pantaleev <slavi@devture.com>
  2. # SPDX-FileCopyrightText: 2024 Suguru Hirahara <acioustick@noreply.codeberg.org>
  3. #
  4. # SPDX-License-Identifier: AGPL-3.0-or-later
  5. # Shows help
  6. default:
  7. @just --list --justfile {{ justfile() }}
  8. # Extracts original English strings (translation templates) into the `translation-templates/` directory
  9. extract-translation-templates: _venv
  10. @echo "Extracting translation templates…"
  11. PATH={{ justfile_directory() }}/.venv/bin:$PATH {{ justfile_directory() }}/bin/extract-translation-templates.sh
  12. # Syncs the translation templates (affects `translation-templates/`) and strings (affects `locales/*`) for all published languages (`PUBLISHED_LANGUAGES`)
  13. sync-for-all-published-languages: _venv
  14. #!/bin/sh
  15. cat {{ justfile_directory() }}/PUBLISHED_LANGUAGES | while read language ; do
  16. {{ just_executable() }} sync-for-language $language
  17. done
  18. # Syncs the translation templates (affects `translation-templates/`) and strings for all known languages (`KNOWN_LANGUAGES`)
  19. sync-for-all-known-languages:
  20. #!/bin/sh
  21. find {{ justfile_directory() }}/locales -mindepth 1 -maxdepth 1 -type d | while read path ; do
  22. language=$(basename "$path")
  23. echo "Syncing for language $language…"
  24. {{ just_executable() }} sync-for-language $language
  25. done
  26. # Updates the translation templates (affects `translation-templates/`) and syncs the translation strings for a given language (affects `locales/{{ language }}`)
  27. sync-for-language language: extract-translation-templates (_sync-translation-templates-to-locales-for-language language)
  28. # Updates `locales/{{ language }}` files based on the original template strings from `translation-templates/`
  29. _sync-translation-templates-to-locales-for-language language: _venv
  30. PATH={{ justfile_directory() }}/.venv/bin:$PATH {{ justfile_directory() }}/bin/sync-translation-templates-to-locales.sh {{ language }}
  31. # Builds the translated result for a given language into the `translations/{{ language }}` directory
  32. build-for-language language: _venv
  33. PATH={{ justfile_directory() }}/.venv/bin:$PATH {{ justfile_directory() }}/bin/build-translated-result.sh {{ language }}
  34. # Builds the translated result for all published languages into the `translations/` directory
  35. build-for-all-published-languages:
  36. #!/bin/sh
  37. cat {{ justfile_directory() }}/PUBLISHED_LANGUAGES | while read language ; do
  38. {{ just_executable() }} build-for-language $language
  39. done
  40. # Builds the translated result for all known languages into the `translations/` directory
  41. build-for-all-known-languages:
  42. #!/bin/sh
  43. find {{ justfile_directory() }}/locales -mindepth 1 -maxdepth 1 -type d | while read path ; do
  44. language=$(basename "$path")
  45. echo "Building for language $language…"
  46. {{ just_executable() }} build-for-language $language
  47. done
  48. # Creates the virtual environment and installs the required Python packages
  49. _venv:
  50. #!/bin/sh
  51. if [ ! -f {{ justfile_directory() }}/.venv/bin/sphinx-build ]; then
  52. echo "No sphinx-build found, creating virtual environment and installing requirements…"
  53. uv venv {{ justfile_directory() }}/.venv
  54. VIRTUAL_ENV={{ justfile_directory() }}/.venv uv pip install -r {{ justfile_directory() }}/requirements.txt
  55. fi