summaryrefslogtreecommitdiff
path: root/tools/xgettext.sh
diff options
context:
space:
mode:
Diffstat (limited to 'tools/xgettext.sh')
-rwxr-xr-xtools/xgettext.sh23
1 files changed, 23 insertions, 0 deletions
diff --git a/tools/xgettext.sh b/tools/xgettext.sh
new file mode 100755
index 0000000..6de353c
--- /dev/null
+++ b/tools/xgettext.sh
@@ -0,0 +1,23 @@
+#! /bin/bash
+
+me=$(basename "${BASH_SOURCE[0]}");
+
+if [[ $# -lt 1 ]]; then
+ echo "Usage: $me FILE..." >&2;
+ exit 1;
+fi
+
+mkdir -p locale;
+echo "Generating template..." >&2;
+xgettext --from-code=UTF-8 -kS -kNS:1,2 -k_ \
+ -o locale/template.pot "$@" \
+ || exit;
+
+cd locale;
+
+for file in *.po; do
+ echo "Updating $file..." >&2;
+ msgmerge --update "$file" template.pot;
+done
+
+echo "DONE!" >&2;