Update partially translated glossary

Download partially translated glossary the same way we handle the common
directory, this is good enough for using the glossary as part of manuals.

Refactor the code so that we do not invoke tx pull multiple times (first
for all files, then for the special ones): We now setup the translations
with minimal translation in them and update as appropriate.

Also, skip glossary project in all repos besides openstack-manuals.

Change-Id: Ia50c3a76b0498c85849fa7895fd1d405e5915464
This commit is contained in:
Andreas Jaeger 2014-07-08 08:45:02 +02:00
parent 378734526e
commit 9a1734f493
2 changed files with 24 additions and 12 deletions
modules/openstack_project/files/slave_scripts

@ -78,6 +78,7 @@ function init_manuals ()
# operations-guide) for transifex
function setup_manuals ()
{
local project=$1
# Generate pot one by one
for FILE in ${DocFolder}/*
do
@ -92,6 +93,25 @@ function setup_manuals ()
then
continue
fi
# Skip glossary in all repos besides openstack-manuals.
if [ "$project" != "openstack-manuals" -a "$DOCNAME" == "glossary" ]
then
continue
fi
# Minimum amount of translation done, 75 % by default.
PERC=75
if [ "$project" == "openstack-manuals" ]
then
# The common and glossary directories are used by the
# other guides, let's be more liberal here since teams
# might only translate the files used by a single
# guide. We use 8 % since that downloads the currently
# translated files.
if [ "$DOCNAME" == "common" -o "$DOCNAME" == "glossary" ]
then
PERC=8
fi
fi
# Update the .pot file
./tools/generatepot ${DOCNAME}
if [ -f ${DocFolder}/${DOCNAME}/locale/${DOCNAME}.pot ]
@ -102,6 +122,7 @@ function setup_manuals ()
tx set --auto-local -r openstack-manuals-i18n.${DOCNAME} \
"${DocFolder}/${DOCNAME}/locale/<lang>.po" --source-lang en \
--source-file ${DocFolder}/${DOCNAME}/locale/${DOCNAME}.pot \
--minimum-perc=$PERC \
-t PO --execute
fi
done

@ -28,19 +28,10 @@ setup_git
setup_review "$ORG" "$PROJECT"
setup_translation
setup_manuals
setup_manuals "$PROJECT"
# Pull upstream translations of files that are at least 75 %
# translated
tx pull -a -f --minimum-perc=75
# The common directory is used by the other guides, let's be more
# liberal here since teams might only translate the files used by a
# single guide. We use 8 % since that downloads the currently
# translated files.
if [ $PROJECT = "openstack-manuals" ] ; then
tx pull -f --minimum-perc=8 -r openstack-manuals-i18n.common
fi
# Pull upstream translations of files
tx pull -a -f
# Add imported upstream translations to git
for FILE in ${DocFolder}/*