[Libreoffice-commits] dev-tools.git: release/extractPootle.sh
jan iversen
jani at documentfoundation.org
Mon Apr 4 12:28:53 UTC 2016
release/extractPootle.sh | 44 ++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 44 insertions(+)
New commits:
commit 7ace4f1e4f00f512f2cab81a8ee5baafa8a18de5
Author: jan iversen <jani at documentfoundation.org>
Date: Mon Apr 4 14:26:32 2016 +0200
added script to simplify pootle extract
This script extracts the po files and generates tar.bz2 files.
The script takes a single parameter (e.g 51) identifying libo??_{ui|help}
diff --git a/release/extractPootle.sh b/release/extractPootle.sh
new file mode 100755
index 0000000..d392952
--- /dev/null
+++ b/release/extractPootle.sh
@@ -0,0 +1,44 @@
+#!/bin/bash
+
+echo "********** POOTLE EXTRACT SCRIPT **********"
+echo "*** This script will generate 2 files:"
+echo "*** /tmp/ui.tar.bz2 (all ui po files)"
+echo "*** /tmp/help.tar.bz2 (all help po files)"
+
+# prompt for input if no arguments
+if [ $# -eq 1 ]
+then
+ ver=$1
+else
+ echo -n "Input project version (e.g 51) to extract ? "
+ read ver
+fi
+ver="libo${ver}"
+echo ">>>>>>>>>> extracting projects ${ver}_[ui|help]"
+
+file="/var/www/sites/translations.documentfoundation.org"
+if [ ! -d "${file}" ]; then
+ echo ">>>>>>>>>> cannot locate site directory (${file})!"
+ exit -1
+fi
+tran="${file}/translations/${ver}"
+if [ ! -d "${tran}_ui" -o ! -d "${tran}_help" ]; then
+ echo ">>>>>>>>>> cannot locate project ui!"
+ exit -1
+fi
+
+echo ">>>>>>>>>> setup pootle environment"
+cd $file
+pwd
+source ./env/bin/activate
+
+echo ">>>>>>>>> Sync pootle db with files"
+python src/manage.py list_languages --project=${ver}_ui |xargs -P 14 -I onelang python src/manage.py sync_stores --force --overwrite --project=${ver}_ui --language=onelang -v 1
+python src/manage.py list_languages --project=${ver}_help |xargs -P 14 -I onelang python src/manage.py sync_stores --force --overwrite --project=${ver}_help --language=onelang -v 1
+
+
+echo ">>>>>>>>> backup po files"
+rm /tmp/*bz2
+tar cjf /tmp/ui.tar.bz2 translations/${ver}_ui/ && tar cjf /tmp/help.tar.bz2 translations/${ver}_help/
+
+echo ">>>>>>>>> finished"
More information about the Libreoffice-commits
mailing list