Refactor pulling translations into a common func

In preperation for switching projects one at a time to pulling
translations from Zanata, refactor the two calls to tx pull into
a common function.

Change-Id: I21051fbdcf7bd210606333ba46e5abb0c64e7540
This commit is contained in:
Steve Kowalik
2015-07-09 16:45:42 +10:00
parent 3887a7b2a4
commit 85f99e2d18
4 changed files with 17 additions and 24 deletions

View File

@@ -469,3 +469,14 @@ function compress_manual_po_files {
mv "${i}.tmp" "$i"
done
}
function pull_from_transifex {
# Download new files that are at least 75 % translated.
# Also downloads updates for existing files that are at least 75 %
# translated.
tx pull -a -f --minimum-perc=75
# Pull upstream translations of all downloaded files but do not
# download new files.
tx pull -f
}

View File

@@ -31,14 +31,8 @@ setup_loglevel_vars
# Project specific transifex setup for log translations.
setup_loglevel_project "$PROJECT"
# Download new files that are at least 75 % translated.
# Also downloads updates for existing files that are at least 75 %
# translated.
tx pull -a -f --minimum-perc=75
# Pull upstream translations of all downloaded files but do not
# download new files.
tx pull -f
# Pull updated translations from Transifex.
pull_from_transifex
# Extract all messages from project, including log messages.
extract_messages_log "$PROJECT"

View File

@@ -25,14 +25,8 @@ setup_translation
setup_django_openstack_auth
# Download new files that are at least 75 % translated.
# Also downloads updates for existing files that are at least 75 %
# translated.
tx pull -a -f --minimum-perc=75
# Pull upstream translations of all downloaded files but do not
# download new files.
tx pull -f
# Pull updated translations from Transifex.
pull_from_transifex
# Update the .pot file
python setup.py extract_messages

View File

@@ -20,14 +20,8 @@ setup_review
setup_translation
setup_horizon
# Download new files that are at least 75 % translated.
# Also downloads updates for existing files that are at least 75 %
# translated.
tx pull -a -f --minimum-perc=75
# Pull upstream translations of all downloaded files but do not
# download new files.
tx pull -f
# Pull updated translations from Transifex.
pull_from_transifex
# Invoke run_tests.sh to update the po files
# Or else, "../manage.py makemessages" can be used.