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:
parent
b98481072f
commit
1c5f830a40
|
@ -168,11 +168,7 @@ function setup_manuals {
|
||||||
ZANATA_RULES=
|
ZANATA_RULES=
|
||||||
|
|
||||||
# List of directories to skip
|
# List of directories to skip
|
||||||
if [ "$project" == "openstack-manuals" ]; then
|
EXCLUDE='.*/**'
|
||||||
EXCLUDE='.*/**,**/source/common/**'
|
|
||||||
else
|
|
||||||
EXCLUDE='.*/**,**/source/common/**,**/glossary/**'
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Generate pot one by one
|
# Generate pot one by one
|
||||||
for FILE in ${DocFolder}/*; do
|
for FILE in ${DocFolder}/*; do
|
||||||
|
@ -185,10 +181,6 @@ function setup_manuals {
|
||||||
if [[ "$DOCNAME" =~ ^(www|tools|generated|publish-docs)$ ]]; then
|
if [[ "$DOCNAME" =~ ^(www|tools|generated|publish-docs)$ ]]; then
|
||||||
continue
|
continue
|
||||||
fi
|
fi
|
||||||
# Skip glossary in all repos besides openstack-manuals.
|
|
||||||
if [ "$project" != "openstack-manuals" -a "$DOCNAME" == "glossary" ]; then
|
|
||||||
continue
|
|
||||||
fi
|
|
||||||
IS_RST=0
|
IS_RST=0
|
||||||
if [ ${SPECIAL_BOOKS["${DOCNAME}"]+_} ] ; then
|
if [ ${SPECIAL_BOOKS["${DOCNAME}"]+_} ] ; then
|
||||||
case "${SPECIAL_BOOKS["${DOCNAME}"]}" in
|
case "${SPECIAL_BOOKS["${DOCNAME}"]}" in
|
||||||
|
@ -554,27 +546,6 @@ function compress_po_files {
|
||||||
done
|
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 {
|
function pull_from_zanata {
|
||||||
|
|
||||||
local project=$1
|
local project=$1
|
||||||
|
@ -586,13 +557,13 @@ function pull_from_zanata {
|
||||||
|
|
||||||
for i in $(find . -name '*.po' ! -path './.*' -prune | cut -b3-); do
|
for i in $(find . -name '*.po' ! -path './.*' -prune | cut -b3-); do
|
||||||
check_po_file "$i"
|
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
|
# common documents in openstack-manuals have that relaxed to
|
||||||
# >8%.
|
# >8%.
|
||||||
percentage=75
|
percentage=75
|
||||||
if [ $project = "openstack-manuals" ]; then
|
if [ $project = "openstack-manuals" ]; then
|
||||||
case "$i" in
|
case "$i" in
|
||||||
*glossary*|*common*)
|
*common*)
|
||||||
percentage=8
|
percentage=8
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
|
@ -31,22 +31,20 @@ function propose_manuals {
|
||||||
pull_from_zanata "$PROJECT"
|
pull_from_zanata "$PROJECT"
|
||||||
|
|
||||||
# Compress downloaded po files
|
# Compress downloaded po files
|
||||||
# Only touch glossary in openstack-manuals but not in any other
|
|
||||||
# repository.
|
|
||||||
case "$PROJECT" in
|
case "$PROJECT" in
|
||||||
openstack-manuals)
|
openstack-manuals)
|
||||||
cleanup_pot_files "doc"
|
cleanup_pot_files "doc"
|
||||||
compress_manual_po_files "doc" 1
|
compress_po_files "doc"
|
||||||
;;
|
;;
|
||||||
api-site)
|
api-site)
|
||||||
cleanup_pot_files "api-quick-start"
|
cleanup_pot_files "api-quick-start"
|
||||||
compress_manual_po_files "api-quick-start" 0
|
compress_po_files "api-quick-start"
|
||||||
cleanup_pot_files "firstapp"
|
cleanup_pot_files "firstapp"
|
||||||
compress_manual_po_files "firstapp" 0
|
compress_po_files "firstapp"
|
||||||
;;
|
;;
|
||||||
security-doc)
|
security-doc)
|
||||||
cleanup_pot_files "security-guide"
|
cleanup_pot_files "security-guide"
|
||||||
compress_manual_po_files "security-guide" 0
|
compress_po_files "security-guide"
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue