Merge "Decrease PO files for imports (horizon+friends)"

This commit is contained in:
Jenkins 2015-05-07 19:01:36 +00:00 committed by Gerrit Code Review
commit ee71a44768
3 changed files with 25 additions and 0 deletions

@ -414,3 +414,21 @@ function compress_manual_po_files {
mv "${i}.tmp" "$i"
done
}
# Reduce size of po files. This reduces the amount of content imported
# and makes for fewer imports.
# Some projects have no pot files (see function compress_po_files) but
# use the English po file as source. For these projects we should not
# touch the English po file. This way we can reconstruct the po files
# using "msgmerge EnglishPOTFILE POFILE -o COMPLETEPOFILE".
function compress_non_en_po_files {
local directory=$1
for i in `find $directory -name *.po `; do
if [[ $i =~ "/locale/en/LC_MESSAGES/" ]] ; then
continue
fi
msgattrib --translated --no-location "$i" --output="${i}.tmp"
mv "${i}.tmp" "$i"
done
}

@ -39,6 +39,9 @@ if [ -n "$PO_FILES" ]; then
python setup.py update_catalog --no-fuzzy-matching --ignore-obsolete=true
fi
# Compress downloaded po files
compress_po_files "openstack_auth"
# Add all changed files to git
git add openstack_auth/locale/*

@ -33,6 +33,10 @@ tx pull -f
# Or else, "../manage.py makemessages" can be used.
./run_tests.sh --makemessages -V
# Compress downloaded po files
compress_non_en_po_files "horizon"
compress_non_en_po_files "openstack_dashboard"
# Add all changed files to git
git add horizon/locale/* openstack_dashboard/locale/*