From 26a4961cfb36a7dd47387122d1138468a5ce672a Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Fri, 12 Jun 2015 10:31:20 +0100 Subject: [PATCH] Some support for Zanata translations. --- .gitignore | 1 + hacks/zanata_upload.sh | 19 +++++++++++++++++++ wscript | 9 +++++++++ zanata.xml | 21 +++++++++++++++++++++ 4 files changed, 50 insertions(+) create mode 100644 hacks/zanata_upload.sh create mode 100644 zanata.xml diff --git a/.gitignore b/.gitignore index 6be4e4c89..96a8eb70b 100644 --- a/.gitignore +++ b/.gitignore @@ -31,3 +31,4 @@ GSYMS GTAGS TAGS .*.swp +.zanata-cache diff --git a/hacks/zanata_upload.sh b/hacks/zanata_upload.sh new file mode 100644 index 000000000..c67f18959 --- /dev/null +++ b/hacks/zanata_upload.sh @@ -0,0 +1,19 @@ +#!/bin/bash +ZANATA=/opt/zanata-cli-3.6.0/bin/zanata-cli +dir=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) +tmp=/tmp/zanata.$$ +cd $dir/.. +./waf pot +mkdir -p $tmp/source $tmp/translated +cp build/src/lib/*.pot build/src/wx/*.pot build/src/tools/*.pot $tmp/source +for f in src/lib/po/*.po; do + cp $f $tmp/translated/lib_$f +done +for f in src/wx/po/*.po; do + cp $f $tmp/translated/wx_$f +done +for f in src/tools/po/*.po; do + cp $f $tmp/translated/tools_$f +done +$ZANATA push --push-type both -s $tmp/source -t $tmp/translated +rm -rf $tmp diff --git a/wscript b/wscript index 9d191b725..e04ebe83e 100644 --- a/wscript +++ b/wscript @@ -20,6 +20,7 @@ import subprocess import os import shlex import sys +import glob import distutils import distutils.spawn from waflib import Logs @@ -469,3 +470,11 @@ def pot_merge(bld): def tags(bld): os.system('etags src/lib/*.cc src/lib/*.h src/wx/*.cc src/wx/*.h src/tools/*.cc src/tools/*.h') + +def zanata_pull(bld): + os.system('zanata-cli -B -q pull -t .') + for f in glob.glob('src/lib/po/*.po'): + l = os.path.basename(f) + os.rename('dcpomatic_%s' % l, 'src/tools/po/%s' % l) + os.rename('libdcpomatic_%s' % l, 'src/lib/po/%s' % l) + os.rename('libdcpomatic-wx_%s' % l, 'src/wx/po/%s' % l) diff --git a/zanata.xml b/zanata.xml new file mode 100644 index 000000000..a32c50b8f --- /dev/null +++ b/zanata.xml @@ -0,0 +1,21 @@ + + + https://translate.zanata.org/zanata/ + dcpomatic + 2.0 + gettext + + + fr + de-DE + nl + sv + it + es-ES + + + + {filename}_{locale_with_underscore}.po + + + -- 2.30.2