pull-from-transifex.sh: pull newly added languages as well
authorDaniel Albers <daniel@lbe.rs>
Tue, 10 Apr 2012 19:21:17 +0000 (21:21 +0200)
committerDaniel Albers <daniel@lbe.rs>
Sun, 24 Jun 2012 18:53:48 +0000 (20:53 +0200)
new file:   scripts/tx-sync.sh

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

index 8c97692..44b9766 100755 (executable)
@@ -1,7 +1,10 @@
 #!/bin/bash
 
-tx pull $* > /dev/null &&
-git add po/*.po && (
+tx pull -a $* > /dev/null &&
+for po in po/*.po; do
+  basename "${po%.po}"
+done | sort > po/LINGUAS &&
+git add po/*.po po/LINGUAS && (
   translators=$(while read mode pofile; do
     translator=$(git diff --cached -- ${pofile} | perl -le '
       while (<>) {
@@ -21,5 +24,5 @@ git add po/*.po && (
   git commit -em "Update translations from Transifex
 
 Many thanks to:
-${translators}" po/*.po
+${translators}"
 )
diff --git a/scripts/tx-sync.sh b/scripts/tx-sync.sh
new file mode 100755 (executable)
index 0000000..c60d6af
--- /dev/null
@@ -0,0 +1,11 @@
+#!/usr/bin/env bash
+quasselsrc=/usr/src/quassel
+localpobranch=i18n-tx-sync
+
+pushd "$quasselsrc" && ( 
+  currb=$(git name-rev --name-only HEAD)
+  git checkout -q $localpobranch && (
+    EDITOR=/bin/true VISUAL=/usr/bin/editor "$quasselsrc"/po/pull-from-transifex.sh -f &&
+      git push -q
+  ); git checkout -q "$currb"
+); popd