From b472406112565dc9d6e4682db0a4560d9ef063d1 Mon Sep 17 00:00:00 2001 From: Rudolf Polzer Date: Wed, 27 Apr 2011 06:27:37 +0200 Subject: [PATCH] update the check-translations script --- check-translations.sh | 89 +++++++++++++++++++++++++++++++++++++++---- csprogs.dat.pot | 2 +- menu.dat.es.po | 2 +- menu.dat.fi.po | 2 +- menu.dat.fr.po | 2 +- menu.dat.hu.po | 2 +- menu.dat.it.po | 2 +- menu.dat.nl.po | 2 +- menu.dat.pot | 2 +- menu.dat.pt.po | 2 +- menu.dat.ro.po | 2 +- menu.dat.ru.po | 2 +- 12 files changed, 93 insertions(+), 18 deletions(-) diff --git a/check-translations.sh b/check-translations.sh index 063920c62..51157a43e 100755 --- a/check-translations.sh +++ b/check-translations.sh @@ -17,14 +17,89 @@ for VM in menu csprogs; do for X in "$VM".dat.*.po; do [ -f "$X" ] || continue msgmerge -F -U "$X" "$VM".dat.pot >&2 - todo=$( - msgattrib --untranslated "$X" | grep -A 2147483647 "^#:" - msgattrib --fuzzy "$X" | grep -A 2147483647 "^#:" - ) - if [ -n "$todo" ]; then + msgattrib --untranslated "$X" | grep . > "$X".untranslated || rm -f "$X".untranslated + msgattrib --fuzzy "$X" | grep . > "$X".fuzzy || rm -f "$X".fuzzy + nu=$((`grep -c ^#: "$X".untranslated` + 0)) + nf=$((`grep -c ^#: "$X".fuzzy` + 0)) + n=$(($nu + $nf)) + if [ $n -gt 0 ]; then echo "TODO for translation $X:" - echo "$todo" - echo + echo "Untranslated: $nu" + echo "Fuzzy: $nf" + ltr=`grep '^"Last-Translator: ' "$X" | cut -d ' ' -f 2- | cut -d '\\' -f 1 | egrep -v '|'` + ltm=`grep '^"Language-Team: ' "$X" | cut -d ' ' -f 2- | cut -d '\\' -f 1 | egrep -v '|'` + echo "Translators: $ltr, $ltm" + case "$ltr" in + '') + to=$ltm + cc= + ;; + *) + to=$ltr + if [ x"$ltr" = x"$ltm" ]; then + cc= + else + cc=$ltm + fi + ;; + esac + if [ -n "$to" ]; then + echo "To: $to" + fi + if [ -n "$cc" ]; then + echo "Cc: $cc" + fi + if [ -n "$to" ]; then + while :; do + echo "Send mail? [y/n]" + read -r yesno + case "$yesno" in + y) + zip -9r "$X"-todo.zip "$X".untranslated "$X".fuzzy + { + cat <\n" "Language-Team: LANGUAGE \n" diff --git a/menu.dat.es.po b/menu.dat.es.po index 260cbb742..16b4ec1c6 100644 --- a/menu.dat.es.po +++ b/menu.dat.es.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Xonotic 0.1preview\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-04-27 06:05+0200\n" +"POT-Creation-Date: 2011-04-27 06:17+0200\n" "Last-Translator: Rodrigo Mouton Laudin \n" "Language: es\n" "MIME-Version: 1.0\n" diff --git a/menu.dat.fi.po b/menu.dat.fi.po index a3cba43c1..901903313 100644 --- a/menu.dat.fi.po +++ b/menu.dat.fi.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: 0.1preview\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-04-27 06:05+0200\n" +"POT-Creation-Date: 2011-04-27 06:17+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: Henry 'Exitium' Sanmark \n" "Language-Team: LANGUAGE \n" diff --git a/menu.dat.fr.po b/menu.dat.fr.po index 3869903df..27d40d381 100644 --- a/menu.dat.fr.po +++ b/menu.dat.fr.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Xonotic 0.1preview\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-04-27 06:05+0200\n" +"POT-Creation-Date: 2011-04-27 06:17+0200\n" "PO-Revision-Date: 2011-03-09 15:48-0500\n" "Last-Translator: Maxime Paradis \n" "Language-Team: French \n" diff --git a/menu.dat.hu.po b/menu.dat.hu.po index 21326d3af..caba4123e 100644 --- a/menu.dat.hu.po +++ b/menu.dat.hu.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-04-27 06:05+0200\n" +"POT-Creation-Date: 2011-04-27 06:17+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/menu.dat.it.po b/menu.dat.it.po index f0b2a606f..d817c3705 100644 --- a/menu.dat.it.po +++ b/menu.dat.it.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: 0.1preview\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-04-27 06:05+0200\n" +"POT-Creation-Date: 2011-04-27 06:17+0200\n" "PO-Revision-Date: 2011-03-27 18:47+0100\n" "Last-Translator: Antonio 'terencehill' Piu \n" "Language-Team: \n" diff --git a/menu.dat.nl.po b/menu.dat.nl.po index a39ffa56e..15a6898f6 100644 --- a/menu.dat.nl.po +++ b/menu.dat.nl.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-04-27 06:05+0200\n" +"POT-Creation-Date: 2011-04-27 06:17+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/menu.dat.pot b/menu.dat.pot index 063d6ab67..b663bc561 100644 --- a/menu.dat.pot +++ b/menu.dat.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-04-27 06:05+0200\n" +"POT-Creation-Date: 2011-04-27 06:17+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/menu.dat.pt.po b/menu.dat.pt.po index 01ea0e654..20c128403 100644 --- a/menu.dat.pt.po +++ b/menu.dat.pt.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Xontoic 0.1preview\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-04-27 06:05+0200\n" +"POT-Creation-Date: 2011-04-27 06:17+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: Ricardo 'Hellgardia' Silva \n" "Language-Team: LANGUAGE \n" diff --git a/menu.dat.ro.po b/menu.dat.ro.po index 5077df0f5..f10626da8 100644 --- a/menu.dat.ro.po +++ b/menu.dat.ro.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Xonotic 0.1preview\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-04-27 06:05+0200\n" +"POT-Creation-Date: 2011-04-27 06:17+0200\n" "PO-Revision-Date: 2011-01-18 11:53+0100\t\n" "Last-Translator: MirceaKitsune \n" "Language-Team: LANGUAGE \n" diff --git a/menu.dat.ru.po b/menu.dat.ru.po index 22f3860dc..b5b375b31 100644 --- a/menu.dat.ru.po +++ b/menu.dat.ru.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: 0.1preview\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-04-27 06:05+0200\n" +"POT-Creation-Date: 2011-04-27 06:17+0200\n" "PO-Revision-Date: 2011-01-20 13:16+0300\n" "Last-Translator: Nikoli \n" "Language-Team: LANGUAGE \n" -- 2.39.2