Merge "Do not store source translation files in git"
This commit is contained in:
@@ -493,25 +493,16 @@ function cleanup_po_files {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
# Remove obsolete files pot files, let's not store a pot file if it
|
# Remove all pot files, we publish them to
|
||||||
# has no translations at all.
|
# http://tarballs.openstack.org/translation-source/{name}/VERSION ,
|
||||||
|
# let's not store them in git at all.
|
||||||
function cleanup_pot_files {
|
function cleanup_pot_files {
|
||||||
local modulename=$1
|
local modulename=$1
|
||||||
|
|
||||||
for i in $(find $modulename -name *.pot) ; do
|
for i in $(find $modulename -name *.pot) ; do
|
||||||
local bi
|
# Remove file, it might be a new file unknown to git.
|
||||||
local bi_po
|
rm $i
|
||||||
local count_po
|
git rm -f --ignore-unmatch $i
|
||||||
|
|
||||||
# Get basename and remove .pot suffix from file name
|
|
||||||
bi=$(basename $i .pot)
|
|
||||||
bi_po="${bi}.po"
|
|
||||||
count_po=$(find $modulename -name "${bi_po}" | wc -l)
|
|
||||||
if [ $count_po -eq 0 ] ; then
|
|
||||||
# Remove file, it might be a new file unknown to git.
|
|
||||||
rm $i
|
|
||||||
git rm -f --ignore-unmatch $i
|
|
||||||
fi
|
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -33,18 +33,25 @@ function propose_manuals {
|
|||||||
# repository.
|
# repository.
|
||||||
case "$PROJECT" in
|
case "$PROJECT" in
|
||||||
openstack-manuals)
|
openstack-manuals)
|
||||||
|
cleanup_pot_files "doc"
|
||||||
compress_manual_po_files "doc" 1
|
compress_manual_po_files "doc" 1
|
||||||
;;
|
;;
|
||||||
api-site)
|
api-site)
|
||||||
|
cleanup_pot_files "api-ref-guides"
|
||||||
compress_manual_po_files "api-ref-guides" 0
|
compress_manual_po_files "api-ref-guides" 0
|
||||||
|
cleanup_pot_files "api-quick-start"
|
||||||
compress_manual_po_files "api-quick-start" 0
|
compress_manual_po_files "api-quick-start" 0
|
||||||
|
cleanup_pot_files "api-ref"
|
||||||
compress_manual_po_files "api-ref" 0
|
compress_manual_po_files "api-ref" 0
|
||||||
|
cleanup_pot_files "openstack-firstapp"
|
||||||
compress_manual_po_files "openstack-firstapp" 0
|
compress_manual_po_files "openstack-firstapp" 0
|
||||||
;;
|
;;
|
||||||
ha-guide|operations-guide)
|
ha-guide|operations-guide)
|
||||||
|
cleanup_pot_files "doc"
|
||||||
compress_manual_po_files "doc" 0
|
compress_manual_po_files "doc" 0
|
||||||
;;
|
;;
|
||||||
security-doc)
|
security-doc)
|
||||||
|
cleanup_pot_files "security-guide"
|
||||||
compress_manual_po_files "security-guide" 0
|
compress_manual_po_files "security-guide" 0
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
@@ -67,6 +74,8 @@ function propose_training_guides {
|
|||||||
# Pull updated translations from Zanata.
|
# Pull updated translations from Zanata.
|
||||||
pull_from_zanata "$PROJECT"
|
pull_from_zanata "$PROJECT"
|
||||||
|
|
||||||
|
# Remove pot files
|
||||||
|
cleanup_pot_files "doc/upstream-training"
|
||||||
# Compress downloaded po files
|
# Compress downloaded po files
|
||||||
compress_po_files "doc/upstream-training"
|
compress_po_files "doc/upstream-training"
|
||||||
|
|
||||||
@@ -123,6 +132,8 @@ function handle_python_django {
|
|||||||
pull_from_zanata "$project"
|
pull_from_zanata "$project"
|
||||||
propose_releasenotes "$ZANATA_VERSION"
|
propose_releasenotes "$ZANATA_VERSION"
|
||||||
for modulename in $module_names; do
|
for modulename in $module_names; do
|
||||||
|
# Note that we need to generate the pot files so that we
|
||||||
|
# can calculate how many strings are translated.
|
||||||
case "$kind" in
|
case "$kind" in
|
||||||
django)
|
django)
|
||||||
# Update the .pot file
|
# Update the .pot file
|
||||||
@@ -147,6 +158,9 @@ function propose_releasenotes {
|
|||||||
# they get pushed to the translation server.
|
# they get pushed to the translation server.
|
||||||
|
|
||||||
if [[ "$version" == "master" && -f releasenotes/source/conf.py ]]; then
|
if [[ "$version" == "master" && -f releasenotes/source/conf.py ]]; then
|
||||||
|
|
||||||
|
# Note that we need to generate these so that we can calculate
|
||||||
|
# how many strings are translated.
|
||||||
extract_messages_releasenotes
|
extract_messages_releasenotes
|
||||||
|
|
||||||
# Remove obsolete files.
|
# Remove obsolete files.
|
||||||
|
|||||||
Reference in New Issue
Block a user