1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-07-31 16:09:28 +02:00

Improve locale_diagnostics.sh

Signed-off-by: Emily Mabrey <emabrey@tenacityaudio.org>
This commit is contained in:
Emily Mabrey 2021-07-31 13:03:41 -04:00 committed by Sol Fisher Romanoff
parent 5d8be178b5
commit 8b0bf908af
No known key found for this signature in database
GPG Key ID: 0E0ACA5D1C244E1F

View File

@ -3,15 +3,15 @@
# Report how complete each translation catalog is
# How many messages in total?
total=$(grep -c '^msgid' "${BASH_SOURCE[0]}/../tenacity.pot")
total=$(grep -c '^msgid' "../tenacity.pot")
declare -i badlines
for po_file in "${BASH_SOURCE[0]}/../"*.po; do
for po_file in ../*.po; do
# If there are errors from msgcmp, then the last line on standard error
# contains a count of problematic messages; else it won't match the
# pattern in awk, so assume no errors
errors=$(msgcmp "$po_file" "${BASH_SOURCE[0]}/../tenacity.pot" 2>&1 | awk '/msgcmp: found [0-9]* fatal error/ { nn = $3 } END {print 0+nn}')
errors=$(msgcmp "$po_file" "../tenacity.pot" 2>&1 | awk '/msgcmp: found [0-9]* fatal error/ { nn = $3 } END {print 0+nn}')
complete=$((total-errors))
# detect whether this sequence occurs in any .po file. It will break msgfmt on Windows.