From afd09c57d7920eade18bb35c1708f50d495eba8c Mon Sep 17 00:00:00 2001
From: Maximilian Moser <maximilian.moser@tuwien.ac.at>
Date: Tue, 1 Oct 2024 17:29:44 +0200
Subject: [PATCH] Add `babel.sh` script as replacement for the setuptools
 integration

---
 babel.sh | 40 ++++++++++++++++++++++++++++++++++++++++
 1 file changed, 40 insertions(+)
 create mode 100755 babel.sh

diff --git a/babel.sh b/babel.sh
new file mode 100755
index 0000000..a1dec61
--- /dev/null
+++ b/babel.sh
@@ -0,0 +1,40 @@
+#!/bin/bash
+# -*- coding: utf-8 -*-
+#
+# Copyright (C) 2024 TU Wien.
+#
+# Invenio-Config-TUW is free software; you can redistribute it and/or modify
+# it under the terms of the MIT License; see LICENSE file for more details.
+
+if [[ $# -lt 1 ]]; then
+    echo >&2 "error: expected at least one argument"
+fi
+
+case "${1}" in
+    init)
+        pybabel init \
+            --input-file "invenio_config_tuw/translations/messages.pot" \
+            --output-dir "invenio_config_tuw/translations/"
+        ;;
+    compile)
+        pybabel compile \
+            --directory "invenio_config_tuw/translations/"
+        ;;
+    extract)
+        pybabel extract \
+            --copyright-holder "TU Wien" \
+            --msgid-bugs-address "tudata@tuwien.ac.at" \
+            --mapping-file "babel.ini" \
+            --output-file "invenio_config_tuw/translations/messages.pot" \
+            --add-comments "NOTE"
+        ;;
+    update)
+        pybabel update \
+            --input-file "invenio_config_tuw/translations/messages.pot" \
+            --output-dir "invenio_config_tuw/translations/"
+        ;;
+    *)
+        echo >&2 "unknown command: ${1}"
+        exit 1
+        ;;
+esac
-- 
GitLab