From 017c4505b4ab7d28887cb2cc86397fa4580726ec Mon Sep 17 00:00:00 2001 From: Andreas Jaeger Date: Fri, 9 May 2014 10:15:32 +0200 Subject: [PATCH] Only download nearly finished translated files The daily "Imported Translations from Transifex" patch includes all po files, even the ones that are completely untranslated or only have a partial translation. There's no real need for these files. Therefore, only download files that are at least 75 per cent translated. There is one exception: For openstack-manuals the common directory contains many files where only a few need to be translated - so allow here 8 per cent translation. This currently downloads the Japanese and French files and thus covers the languages that we need. Partial-Bug: #1317794 Change-Id: I763c21768e3876aaaf4734bf2d769de20b49ff42 --- .../slave_scripts/propose_translation_update.sh | 6 ++++-- .../propose_translation_update_horizon.sh | 5 +++-- .../propose_translation_update_manuals.sh | 14 ++++++++++++-- 3 files changed, 19 insertions(+), 6 deletions(-) diff --git a/modules/jenkins/files/slave_scripts/propose_translation_update.sh b/modules/jenkins/files/slave_scripts/propose_translation_update.sh index c06772396f..78e0d325c3 100755 --- a/modules/jenkins/files/slave_scripts/propose_translation_update.sh +++ b/modules/jenkins/files/slave_scripts/propose_translation_update.sh @@ -46,8 +46,10 @@ if [ ! -d .tx ] ; then fi tx set --auto-local -r ${PROJECT}.${PROJECT}-translations "${PROJECT}/locale//LC_MESSAGES/${PROJECT}.po" --source-lang en --source-file ${PROJECT}/locale/${PROJECT}.pot -t PO --execute -# Pull all upstream translations -tx pull -a -f +# Pull upstream translations of files that are at least 75 % +# translated +tx pull -a -f --minimum-perc=75 + # Update the .pot file python setup.py extract_messages PO_FILES=`find ${PROJECT}/locale -name '*.po'` diff --git a/modules/jenkins/files/slave_scripts/propose_translation_update_horizon.sh b/modules/jenkins/files/slave_scripts/propose_translation_update_horizon.sh index 1e9e246f9e..62259b8557 100755 --- a/modules/jenkins/files/slave_scripts/propose_translation_update_horizon.sh +++ b/modules/jenkins/files/slave_scripts/propose_translation_update_horizon.sh @@ -58,8 +58,9 @@ tx set --auto-local -r ${PROJECT}.openstack-dashboard-translations \ "openstack_dashboard/locale//LC_MESSAGES/django.po" --source-lang en \ --source-file openstack_dashboard/locale/en/LC_MESSAGES/django.po -t PO --execute -# Pull all upstream translations -tx pull -a -f +# Pull upstream translations of files that are at least 75 % +# translated +tx pull -a -f --minimum-perc=75 # Invoke run_tests.sh to update the po files # Or else, "../manage.py makemessages" can be used. diff --git a/modules/jenkins/files/slave_scripts/propose_translation_update_manuals.sh b/modules/jenkins/files/slave_scripts/propose_translation_update_manuals.sh index 30ae6fe390..14d077c2a2 100755 --- a/modules/jenkins/files/slave_scripts/propose_translation_update_manuals.sh +++ b/modules/jenkins/files/slave_scripts/propose_translation_update_manuals.sh @@ -82,8 +82,18 @@ do fi done -# Pull all upstream translations -tx pull -a -f +# 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 + for FILE in ${DocFolder}/* do