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:
@@ -469,3 +469,14 @@ function compress_manual_po_files {
|
|||||||
mv "${i}.tmp" "$i"
|
mv "${i}.tmp" "$i"
|
||||||
done
|
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
|
||||||
|
}
|
||||||
|
@@ -31,14 +31,8 @@ setup_loglevel_vars
|
|||||||
# Project specific transifex setup for log translations.
|
# Project specific transifex setup for log translations.
|
||||||
setup_loglevel_project "$PROJECT"
|
setup_loglevel_project "$PROJECT"
|
||||||
|
|
||||||
# Download new files that are at least 75 % translated.
|
# Pull updated translations from Transifex.
|
||||||
# Also downloads updates for existing files that are at least 75 %
|
pull_from_transifex
|
||||||
# translated.
|
|
||||||
tx pull -a -f --minimum-perc=75
|
|
||||||
|
|
||||||
# Pull upstream translations of all downloaded files but do not
|
|
||||||
# download new files.
|
|
||||||
tx pull -f
|
|
||||||
|
|
||||||
# Extract all messages from project, including log messages.
|
# Extract all messages from project, including log messages.
|
||||||
extract_messages_log "$PROJECT"
|
extract_messages_log "$PROJECT"
|
||||||
|
@@ -25,14 +25,8 @@ setup_translation
|
|||||||
|
|
||||||
setup_django_openstack_auth
|
setup_django_openstack_auth
|
||||||
|
|
||||||
# Download new files that are at least 75 % translated.
|
# Pull updated translations from Transifex.
|
||||||
# Also downloads updates for existing files that are at least 75 %
|
pull_from_transifex
|
||||||
# translated.
|
|
||||||
tx pull -a -f --minimum-perc=75
|
|
||||||
|
|
||||||
# Pull upstream translations of all downloaded files but do not
|
|
||||||
# download new files.
|
|
||||||
tx pull -f
|
|
||||||
|
|
||||||
# Update the .pot file
|
# Update the .pot file
|
||||||
python setup.py extract_messages
|
python setup.py extract_messages
|
||||||
|
@@ -20,14 +20,8 @@ setup_review
|
|||||||
setup_translation
|
setup_translation
|
||||||
setup_horizon
|
setup_horizon
|
||||||
|
|
||||||
# Download new files that are at least 75 % translated.
|
# Pull updated translations from Transifex.
|
||||||
# Also downloads updates for existing files that are at least 75 %
|
pull_from_transifex
|
||||||
# translated.
|
|
||||||
tx pull -a -f --minimum-perc=75
|
|
||||||
|
|
||||||
# Pull upstream translations of all downloaded files but do not
|
|
||||||
# download new files.
|
|
||||||
tx pull -f
|
|
||||||
|
|
||||||
# Invoke run_tests.sh to update the po files
|
# Invoke run_tests.sh to update the po files
|
||||||
# Or else, "../manage.py makemessages" can be used.
|
# Or else, "../manage.py makemessages" can be used.
|
||||||
|
Reference in New Issue
Block a user