Browse Source

translations: Remove glossary handling

There's no separate glossary directory anymore, remove special handling
for it.

This also allows to remove the compress_manual_po_files function that
was only needed to skip the glossary.

Change EXCLUDE line, we don't need to ignore source/common anymore since
we do not save pot files there anymore unless needed.

Change-Id: Icbda5521c97eb8d89a055250fbce045250ba6d55
changes/40/372140/2
Andreas Jaeger 6 years ago
parent
commit
1c5f830a40
  1. 35
      jenkins/scripts/common_translation_update.sh
  2. 10
      jenkins/scripts/propose_translation_update.sh

35
jenkins/scripts/common_translation_update.sh

@ -168,11 +168,7 @@ function setup_manuals {
ZANATA_RULES=
# List of directories to skip
if [ "$project" == "openstack-manuals" ]; then
EXCLUDE='.*/**,**/source/common/**'
else
EXCLUDE='.*/**,**/source/common/**,**/glossary/**'
fi
EXCLUDE='.*/**'
# Generate pot one by one
for FILE in ${DocFolder}/*; do
@ -185,10 +181,6 @@ function setup_manuals {
if [[ "$DOCNAME" =~ ^(www|tools|generated|publish-docs)$ ]]; then
continue
fi
# Skip glossary in all repos besides openstack-manuals.
if [ "$project" != "openstack-manuals" -a "$DOCNAME" == "glossary" ]; then
continue
fi
IS_RST=0
if [ ${SPECIAL_BOOKS["${DOCNAME}"]+_} ] ; then
case "${SPECIAL_BOOKS["${DOCNAME}"]}" in
@ -554,27 +546,6 @@ function compress_po_files {
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 --sort-output "$i" \
--output="${i}.tmp"
mv "${i}.tmp" "$i"
done
}
function pull_from_zanata {
local project=$1
@ -586,13 +557,13 @@ function pull_from_zanata {
for i in $(find . -name '*.po' ! -path './.*' -prune | cut -b3-); do
check_po_file "$i"
# We want new files to be >75% translated. The glossary and
# We want new files to be >75% translated. The
# common documents in openstack-manuals have that relaxed to
# >8%.
percentage=75
if [ $project = "openstack-manuals" ]; then
case "$i" in
*glossary*|*common*)
*common*)
percentage=8
;;
esac

10
jenkins/scripts/propose_translation_update.sh

@ -31,22 +31,20 @@ function propose_manuals {
pull_from_zanata "$PROJECT"
# Compress downloaded po files
# Only touch glossary in openstack-manuals but not in any other
# repository.
case "$PROJECT" in
openstack-manuals)
cleanup_pot_files "doc"
compress_manual_po_files "doc" 1
compress_po_files "doc"
;;
api-site)
cleanup_pot_files "api-quick-start"
compress_manual_po_files "api-quick-start" 0
compress_po_files "api-quick-start"
cleanup_pot_files "firstapp"
compress_manual_po_files "firstapp" 0
compress_po_files "firstapp"
;;
security-doc)
cleanup_pot_files "security-guide"
compress_manual_po_files "security-guide" 0
compress_po_files "security-guide"
;;
esac

Loading…
Cancel
Save