translations: Do not merge untranslated pot files
Do not storate pot files that are not translated currently, remove them from any proposals. Change-Id: I9ded8b892a4034bccf27c43d0d3721a97eab6bb0
This commit is contained in:
parent
aa8aba5522
commit
0af0f35a2a
@ -489,7 +489,29 @@ function cleanup_po_files {
|
|||||||
for i in $(find $modulename/locale -name *.po) ; do
|
for i in $(find $modulename/locale -name *.po) ; do
|
||||||
check_po_file "$i"
|
check_po_file "$i"
|
||||||
if [ $RATIO -lt 20 ]; then
|
if [ $RATIO -lt 20 ]; then
|
||||||
git rm -f $i
|
git rm -f --ignore-unmatch $i
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
# Remove obsolete files pot files, let's not store a pot file if it
|
||||||
|
# has no translations at all.
|
||||||
|
function cleanup_pot_files {
|
||||||
|
local modulename=$1
|
||||||
|
|
||||||
|
for i in $(find $modulename/locale -name *.pot) ; do
|
||||||
|
local bi
|
||||||
|
local bi_po
|
||||||
|
local count_po
|
||||||
|
|
||||||
|
bi=$(basename $i)
|
||||||
|
bi_po="${bi%.pot}.po"
|
||||||
|
count_po=$(find $modulename/locale -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
|
fi
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
@ -87,6 +87,7 @@ function propose_python {
|
|||||||
|
|
||||||
# Remove obsolete files.
|
# Remove obsolete files.
|
||||||
cleanup_po_files "$modulename"
|
cleanup_po_files "$modulename"
|
||||||
|
cleanup_pot_files "$modulename"
|
||||||
|
|
||||||
# Compress downloaded po files, this needs to be done after
|
# Compress downloaded po files, this needs to be done after
|
||||||
# cleanup_po_files since that function needs to have information the
|
# cleanup_po_files since that function needs to have information the
|
||||||
|
Loading…
Reference in New Issue
Block a user