Fix translation compress for manuals
Not all manual repositories have a doc directory, adjust the paths. Not all files should be compressed, we need to exclude in all repositories - besides openstack-manuals - the glossary. Change-Id: I358db42585699b05e893b66e1ac6d2927fb43ee3
This commit is contained in:
parent
06d413a78d
commit
9ee5653f21
@ -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
|
||||
}
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user