|
From: <dwa...@us...> - 2011-08-09 14:31:28
|
Revision: 10402
http://zaf.svn.sourceforge.net/zaf/?rev=10402&view=rev
Author: dwaynebailey
Date: 2011-08-09 14:31:21 +0000 (Tue, 09 Aug 2011)
Log Message:
-----------
Add push and pull scripts for getting and putting translations
Added Paths:
-----------
trunk/po/fftb/get-from-pootle.sh
trunk/po/fftb/push-to-pootle.sh
Added: trunk/po/fftb/get-from-pootle.sh
===================================================================
--- trunk/po/fftb/get-from-pootle.sh (rev 0)
+++ trunk/po/fftb/get-from-pootle.sh 2011-08-09 14:31:21 UTC (rev 10402)
@@ -0,0 +1,58 @@
+#!/bin/bash
+
+project=firefox
+langs=$*
+user=pootlesync
+local_copy=.pootle_tmp
+
+if [ $# -lt 1 ]; then
+ echo "$(basename $0) [lang(s)]"
+ exit
+fi
+
+if [ $# -eq 1 ]; then
+ bashlangs=$langs
+else
+ bashlangs="{$(echo $langs | sed "s/ /,/g")}"
+fi
+
+for lang in $langs
+do
+ option_langs="$option_langs --language=$lang"
+done
+
+option_project="--project=$project"
+
+sync_command="python /var/www/sites/pootle/Pootle/manage.py sync_stores $option_project $option_langs"
+pootle_dir=/var/www/sites/pootle/podirectory/$project
+
+# Sync project
+ssh $us...@po... $sync_command
+
+# Copy files across and disassemble phases
+mkdir -p $local_copy/$project
+rsync -az --delete --exclude=".translation_index" $us...@po...:$pootle_dir/$bashlangs $local_copy/$project/ || exit
+
+svndir=$(pwd)
+cd $local_copy/$project
+for lang in $langs
+do
+ echo "Language: $lang"
+ cd $lang
+ for phase in $(ls)
+ do
+ cd $phase
+ echo "Phase: $phase"
+ for po in $(find . -name "*.po")
+ do
+ mkdir -p $svndir/$lang/$(dirname $po)
+ mv $po $svndir/$lang/$po
+ done
+ cd ..
+ done
+ cd ..
+done
+cd ../..
+
+# Cleanup
+./cleanup-msgcat.sh $langs
Added: trunk/po/fftb/push-to-pootle.sh
===================================================================
--- trunk/po/fftb/push-to-pootle.sh (rev 0)
+++ trunk/po/fftb/push-to-pootle.sh 2011-08-09 14:31:21 UTC (rev 10402)
@@ -0,0 +1,55 @@
+#!/bin/bash
+
+project=firefox
+langs=$*
+user=pootlesync
+local_copy=.pootle_phases_tmp
+phaselist=ff4.phaselist
+
+if [ $# -lt 1 ]; then
+ echo "$(basename $0) [lang(s)]"
+ exit
+fi
+
+if [ $# -eq 1 ]; then
+ bashlangs=$langs
+else
+ bashlangs="{$(echo $langs | sed "s/ /,/g")}"
+fi
+
+for lang in $langs
+do
+ option_langs="$option_langs --language=$lang"
+done
+
+option_project="--project=$project"
+
+sync_command="python /var/www/sites/pootle/Pootle/manage.py sync_stores $option_project $option_langs"
+update_command="python /var/www/sites/pootle/Pootle/manage.py update_stores $option_project"
+pootle_dir=/var/www/sites/pootle/podirectory/$project
+
+# Sync project
+ssh $us...@po... $sync_command
+
+read -p "Do you wish to proceed? Do not if new translations have sync'd for your language." -N1 answer
+if [ "$answer" != "y" ]; then
+ exit
+fi
+
+# Copy files across and disassemble phases
+for lang in $langs
+do
+ rm -rf $local_copy/$lang
+ cat $phaselist | while read phase file
+ do
+ mkdir -p $local_copy/$lang/$phase/$(dirname $file)
+ cp -p $lang/$file $local_copy/$lang/$phase/$file
+ done
+done
+
+
+for lang in $langs
+do
+ rsync -az --include="*.po" --delete $local_copy/$lang $us...@po...:$pootle_dir/
+ ssh $us...@po... "$update_command --language=$lang"
+done
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|