new file: po/pull-from-transifex.sh
authorDaniel Albers <daniel@lbe.rs>
Sun, 22 Jan 2012 23:12:38 +0000 (00:12 +0100)
committerDaniel Albers <daniel@lbers.com>
Mon, 23 Jan 2012 20:01:45 +0000 (21:01 +0100)
Updates translations via `tx` and commits

po/pull-from-transifex.sh [new file with mode: 0755]

diff --git a/po/pull-from-transifex.sh b/po/pull-from-transifex.sh
new file mode 100755 (executable)
index 0000000..cbefc82
--- /dev/null
@@ -0,0 +1,16 @@
+#!/bin/bash
+
+tx pull &&
+git add po/*.po && (
+  translators=$(while read mode pofile; do
+    translator=$(perl -ne 's/^"Last-Translator: (.*?)(?:\\n)?"$/\1/ && print $1;' ${pofile})
+    lang=${pofile%.po}
+    lang=${lang#po/}
+    echo " - ${lang}: ${translator}"
+  done < <(git status --porcelain po/*.po | egrep '^[AM]  '))
+
+  git commit -m "Update translations from Transifex
+
+Many thanks to:
+${translators}" po/*.po
+)