From bffba18da240521ec75691bd458d21a772028ad4 Mon Sep 17 00:00:00 2001 From: Maximilian Moser <maximilian.moser@tuwien.ac.at> Date: Thu, 19 Sep 2024 18:24:26 +0200 Subject: [PATCH] Add wrapper script for pybabel * because we moved away from setuptools which had wrappers --- babel.sh | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100755 babel.sh diff --git a/babel.sh b/babel.sh new file mode 100755 index 0000000..5acd7dd --- /dev/null +++ b/babel.sh @@ -0,0 +1,34 @@ +#!/bin/bash + +if [[ $# -lt 1 ]]; then + echo >&2 "error: expected at least one argument" +fi + +case "${1}" in + init) + pybabel init \ + --input-file "invenio_utilities_tuw/translations/messages.pot" \ + --output-dir "invenio_utilities_tuw/translations/" + ;; + compile) + pybabel compile \ + --directory "invenio_utilities_tuw/translations/" + ;; + extract) + pybabel extract \ + --copyright-holder "TU Wien" \ + --msgid-bugs-address "tudata@tuwien.ac.at" \ + --mapping-file "babel.ini" \ + --output-file "invenio_utilities_tuw/translations/messages.pot" \ + --add-comments "NOTE" + ;; + update) + pybabel update \ + --input-file "invenio_utilities_tuw/translations/messages.pot" \ + --output-dir "invenio_utilities_tuw/translations/" + ;; + *) + echo >&2 "unknown command: ${1}" + exit 1 + ;; +esac -- GitLab