From 6f714fd19e6e5a24e5f4c6818a45c49de8450626 Mon Sep 17 00:00:00 2001
From: str4d <str4d@mail.i2p>
Date: Sun, 21 Jul 2013 22:15:24 +0000
Subject: [PATCH] Enable extraction, update and compilation of a single gettext
 domain

---
 compile-messages.sh   | 11 ++++++++---
 extract-messages.sh   | 13 +++++++++++--
 update-existing-po.sh | 11 ++++++++---
 3 files changed, 27 insertions(+), 8 deletions(-)

diff --git a/compile-messages.sh b/compile-messages.sh
index 42bf63265..18b88163e 100755
--- a/compile-messages.sh
+++ b/compile-messages.sh
@@ -1,6 +1,11 @@
 #!/bin/sh
 . ./translation.vars
 
-for domain in $(ls $BABELCFG); do
-    TZ=UTC env/bin/pybabel compile -D $domain -d $TRANSDIR
-done
+if [ $# -ge 1 ]
+then
+    TZ=UTC env/bin/pybabel compile -D $1 -d $TRANSDIR
+else
+    for domain in $(ls $BABELCFG); do
+        TZ=UTC env/bin/pybabel compile -D $domain -d $TRANSDIR
+    done
+fi
diff --git a/extract-messages.sh b/extract-messages.sh
index 62e3dc81e..bfedfc275 100755
--- a/extract-messages.sh
+++ b/extract-messages.sh
@@ -5,10 +5,19 @@ if [ ! -e $POTDIR ]; then
     mkdir $POTDIR
 fi
 
-for domain in $(ls $BABELCFG); do
+if [ $# -ge 1 ]
+then
     TZ=UTC ./pybabel extract --msgid-bugs-address="http://trac.i2p2.de" \
+                               --project=$PROJECT \
+                               --version=$VERSION \
+                               -F $BABELCFG/$1 \
+                               -o $POTDIR/$1.pot $PROJDIR
+else
+    for domain in $(ls $BABELCFG); do
+        TZ=UTC ./pybabel extract --msgid-bugs-address="http://trac.i2p2.de" \
                                --project=$PROJECT \
                                --version=$VERSION \
                                -F $BABELCFG/$domain \
                                -o $POTDIR/$domain.pot $PROJDIR
-done
+    done
+fi
diff --git a/update-existing-po.sh b/update-existing-po.sh
index fc43574a7..52888732a 100755
--- a/update-existing-po.sh
+++ b/update-existing-po.sh
@@ -1,6 +1,11 @@
 #!/bin/sh
 . ./translation.vars
 
-for domain in $(ls $BABELCFG); do
-    TZ=UTC env/bin/pybabel update -D $domain -i $POTDIR/$domain.pot -d $TRANSDIR
-done
+if [ $# -ge 1 ]
+then
+    TZ=UTC env/bin/pybabel update -D $1 -i $POTDIR/$1.pot -d $TRANSDIR
+else
+    for domain in $(ls $BABELCFG); do
+        TZ=UTC env/bin/pybabel update -D $domain -i $POTDIR/$domain.pot -d $TRANSDIR
+    done
+fi
-- 
GitLab