aboutsummaryrefslogtreecommitdiffstats
path: root/crowdin/upload
diff options
context:
space:
mode:
authorkoem <koem@petoria.de>2013-07-25 08:50:14 +0200
committerkoem <koem@petoria.de>2013-07-29 16:41:18 +0200
commitc4529fea894a3f2dc28c3d13f4cbfcd7e6466bf4 (patch)
treeab4114e60d62229e9edc8f419ad1474579451e12 /crowdin/upload
parentbc584a347dc1057f0c2a151196a021463b48ab74 (diff)
downloadcgeo-c4529fea894a3f2dc28c3d13f4cbfcd7e6466bf4.zip
cgeo-c4529fea894a3f2dc28c3d13f4cbfcd7e6466bf4.tar.gz
cgeo-c4529fea894a3f2dc28c3d13f4cbfcd7e6466bf4.tar.bz2
Scripts for crowdin integration
Diffstat (limited to 'crowdin/upload')
-rwxr-xr-xcrowdin/upload39
1 files changed, 39 insertions, 0 deletions
diff --git a/crowdin/upload b/crowdin/upload
new file mode 100755
index 0000000..43343ef
--- /dev/null
+++ b/crowdin/upload
@@ -0,0 +1,39 @@
+#/bin/sh
+
+#
+#
+# This script uploads
+# main/res/values-xx/strings.xml
+# and
+# cgeo-calendar/res/values-xx/strings.xml
+# in crowdin by uploading the files from the current branch to crowdin.
+#
+#
+
+# see:
+
+# upload_file uploads the file in parameter 1 to the crowdin file name in parameter 2
+upload_file() {
+ if [ -f "$2" ]; then
+ CROWDIN_LANG=`map_to_crowdin_code "$1"`
+ crowdin_surf \
+ -F \"files[$3]=@$2\" \
+ -F \"language=$CROWDIN_LANG\" \
+ -F \"import_eq_suggestions=1\" \
+ \"http://api.crowdin.net/api/project/cgeo/upload-translation?key=${CROWDIN_APIKEY}\"
+ else
+ debug "$2 not found."
+ fi
+}
+
+. "`dirname $0`/globals"
+
+if [ $# -eq 0 ]; then
+ debug "no languages passed - aborting."
+fi
+
+for i in $@; do
+ upload_file $i main/res/values-$i/strings.xml /cgeo/strings.xml
+ upload_file $i cgeo-calendar/res/values-$i/strings.xml /cgeo-calendar/strings.xml
+done
+