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
This commit is contained in:
Andreas Jaeger 2016-09-18 18:20:02 +02:00
parent b98481072f
commit 1c5f830a40
2 changed files with 7 additions and 38 deletions

View File

@ -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

View File

@ -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