diff --git a/jenkins/scripts/common_translation_update.sh b/jenkins/scripts/common_translation_update.sh index 260e7b2d56..8622351cce 100644 --- a/jenkins/scripts/common_translation_update.sh +++ b/jenkins/scripts/common_translation_update.sh @@ -389,3 +389,23 @@ function compress_po_files { mv "${i}.tmp" "$i" done } + +# Reduce size of po files. This reduces the amount of content imported +# and makes for fewer imports. +# This does not touch the pot files. This way we can reconstruct the po files +# using "msgmerge POTFILE POFILE -o COMPLETEPOFILE". +# Give directory name to not touch files for example under .tox. +# Pass glossary flag to not touch the glossary. +function compress_manual_po_files { + local directory=$1 + local glossary=$2 + for i in `find $directory -name *.po `; do + if [ "$glossary" -eq "0" ] ; then + if [[ $i =~ "/glossary/" ]] ; then + continue + fi + fi + msgattrib --translated --no-location "$i" --output="${i}.tmp" + mv "${i}.tmp" "$i" + done +} diff --git a/jenkins/scripts/propose_translation_update_manuals.sh b/jenkins/scripts/propose_translation_update_manuals.sh index 97c5397cc0..bef136748c 100755 --- a/jenkins/scripts/propose_translation_update_manuals.sh +++ b/jenkins/scripts/propose_translation_update_manuals.sh @@ -42,7 +42,25 @@ tx pull -a -f tx pull -f --minimum-perc=50 # Compress downloaded po files -compress_po_files "doc" +# Only touch glossary in openstack-manuals but not in any other +# repository. +case "$project" in + openstack-manuals) + compress_manual_po_files "doc" 1 + ;; + api-site) + compress_manual_po_files "api-ref-guides" 0 + compress_manual_po_files "api-quick-start" 0 + compress_manual_po_files "api-ref" 0 + compress_manual_po_files "openstack-firstapp" 0 + ;; + ha-guide|operations-guide) + compress_manual_po_files "doc" 0 + ;; + security-doc) + compress_manual_po_files "security-guide" 0 + ;; +esac # Add imported upstream translations to git for FILE in ${DocFolder}/*; do