Add catalog update to tx-sync.sh.
authorDaniel Albers <daniel@lbe.rs>
Thu, 11 Feb 2016 00:17:08 +0000 (01:17 +0100)
committerDaniel Albers <daniel@lbe.rs>
Thu, 11 Feb 2016 00:51:25 +0000 (01:51 +0100)
Transifex now offers automatic fetching of source files. Let tx-sync.sh
regenerate and commit quassel.pot automatically to make use of that.

po/README.Translations
scripts/tx-sync.sh

index 29a6d9c..d495525 100644 (file)
@@ -32,5 +32,12 @@ NOTE: You'll need lupdate, lconvert, lrelease installed with your Qt in
       order to generate translation files. Some distributions don't
       package that tool; in that case you won't get translations.
 
       order to generate translation files. Some distributions don't
       package that tool; in that case you won't get translations.
 
-
-The .pot file can be regenerated with `./update-pot.sh`
+The .pot file is regenerated using `./update-pot.sh` and can be pushed
+to Transifex via `tx push -s`.
+Note that as of Feb 2016 this is done automatically by nightly runs of
+scripts/tx-sync.sh which pushes an updated quassel.pot to a location
+that is fetched by Transifex on regular intervals. This location is
+currently configured as
+<https://github.com/quassel/quassel-i18n/raw/tx-sync/po/quassel.pot> and
+can be updated at https://www.transifex.com/ald/quassel/content/ → "Auto
+update resources".
index 47b931c..33289ab 100755 (executable)
@@ -1,12 +1,19 @@
 #!/usr/bin/env bash
 #!/usr/bin/env bash
+set -u
 quasselsrc=/usr/src/quassel
 localpobranch=i18n-tx-sync
 quasselsrc=/usr/src/quassel
 localpobranch=i18n-tx-sync
+remote=origin
+branch=master
 
 pushd "$quasselsrc" && ( 
   currb=$(git name-rev --name-only HEAD)
   git checkout -q $localpobranch && (
 
 pushd "$quasselsrc" && ( 
   currb=$(git name-rev --name-only HEAD)
   git checkout -q $localpobranch && (
-    git pull -q
-    EDITOR=/bin/true VISUAL=/usr/bin/editor "$quasselsrc"/po/pull-from-transifex.sh -f &&
-      git push -q
+    git pull -q --no-edit $remote $branch &&
+    pushd po/ &&
+    ./update-pot.sh &&
+    git commit -qm 'Update quassel.pot' ${quasselsrc}/po/quassel.pot
+    popd &&
+    "$quasselsrc"/po/pull-from-transifex.sh -f &&
+    git push -q
   ); git checkout -q "$currb"
 ); popd
   ); git checkout -q "$currb"
 ); popd