]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
update the check-translations script
authorRudolf Polzer <divverent@alientrap.org>
Wed, 27 Apr 2011 04:27:37 +0000 (06:27 +0200)
committerRudolf Polzer <divverent@alientrap.org>
Wed, 27 Apr 2011 04:27:37 +0000 (06:27 +0200)
12 files changed:
check-translations.sh
csprogs.dat.pot
menu.dat.es.po
menu.dat.fi.po
menu.dat.fr.po
menu.dat.hu.po
menu.dat.it.po
menu.dat.nl.po
menu.dat.pot
menu.dat.pt.po
menu.dat.ro.po
menu.dat.ru.po

index 063920c622d42cc57ea31cec3fbe65df5f8401e1..51157a43e2e8853f3ace3680a045da63f2a7b8b3 100755 (executable)
@@ -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 '<LL@li.org>|<EMAIL@ADDRESS>'`
+                       ltm=`grep '^"Language-Team: ' "$X" | cut -d ' ' -f 2- | cut -d '\\' -f 1 | egrep -v '<LL@li.org>|<EMAIL@ADDRESS>'`
+                       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 <<EOF
+Hi,
+
+we need updates to the translations you made for Xonotic.
+
+EOF
+                                                               if [ $nu -gt 0 ]; then
+                                                                       cat <<EOF
+The attached zip file contains a file
+$X.untranslated
+with $nu yet to be translated messages. Please translate them and reply with
+the file containing the translations in the "msgstr" fields.
+
+EOF
+                                                               fi
+                                                               if [ $nf -gt 0 ]; then
+                                                                       cat <<EOF
+The attached zip file contains a file
+$X.fuzzy
+with $nf automatically generated translations. Please verify and/or fix them
+and reply with the file having been verified by you.
+
+EOF
+                                                               fi
+                                                               cat <<EOF
+Thanks in advance,
+
+Team Xonotic
+EOF
+                                                       } | mail \
+                                                               -s "Need update for translations: $X" \
+                                                               -a "$X"-todo.zip \
+                                                               -c "$cc" \
+                                                               -b "divVerent@xonotic.org" \
+                                                               -S from="divVerent@xonotic.org" \
+                                                               "$to"
+EOF
+                                               n)
+                                                       break
+                                                       ;;
+                                       esac
+                               done
+                       fi
                fi
        done
        for X in "$VM".dat.*.po.disabled; do
index ca129ced8861fdcdd04ec051e477a0c288fb0f83..d439c37570fd8a5dd786f37437c7196d32c4e7b7 100644 (file)
@@ -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 <EMAIL@ADDRESS>\n"
 "Language-Team: LANGUAGE <LL@li.org>\n"
index 260cbb742ba279924d8c8ec3d9394e012e1f67c8..16b4ec1c6eeb573962e4ff1be819834544e99e2e 100644 (file)
@@ -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 <ratogenesis@gmail.com>\n"
 "Language: es\n"
 "MIME-Version: 1.0\n"
index a3cba43c1154949fc517a1213a2826b5fa8606de..901903313a484096ace4658087545836318ba890 100644 (file)
@@ -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 <henry.sanmark@gmail.com>\n"
 "Language-Team: LANGUAGE <LL@li.org>\n"
index 3869903df7cd504413309e2441cc6e370a056ad1..27d40d381ec05b7fb2ee91eff7719036c17ba976 100644 (file)
@@ -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 <taximus.micro@gmail.com>\n"
 "Language-Team: French <kde-i18n-doc@kde.org>\n"
index 21326d3af5990fa064354b2ea2cae77383820ad1..caba4123eaee160d5463e26b282203fdecbc6d20 100644 (file)
@@ -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 <EMAIL@ADDRESS>\n"
 "Language-Team: LANGUAGE <LL@li.org>\n"
index f0b2a606f597f61becec04e4c04ddd007af5c729..d817c3705537b61bbe0debf1e7033e98c2d9e6ac 100644 (file)
@@ -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 <piuntn@gmail.com>\n"
 "Language-Team: \n"
index a39ffa56e13218f63b2b77b37e646432ac1163e0..15a6898f65d0d5c196353e534400a1a01038d7a6 100644 (file)
@@ -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 <EMAIL@ADDRESS>\n"
 "Language-Team: LANGUAGE <LL@li.org>\n"
index 063d6ab67c13319b9b379fabe49a090d60308d7f..b663bc5617d5a3eb29e368ebbfdfbf867ac8297d 100644 (file)
@@ -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 <EMAIL@ADDRESS>\n"
 "Language-Team: LANGUAGE <LL@li.org>\n"
index 01ea0e654ed5efcbb99ea50e195db04d4c141606..20c128403da8a8c54c7f03da838daf27308e45e4 100644 (file)
@@ -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 <ricardo.mccs@gmail.com>\n"
 "Language-Team: LANGUAGE <LL@li.org>\n"
index 5077df0f5b6e7c5d5256eca37d394ee4da10bc39..f10626da839f0783a9cd57ba24abfbdd789d3fbc 100644 (file)
@@ -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 <sonichedgehog_hyperblast00@yahoo.com>\n"
 "Language-Team: LANGUAGE <LL@li.org>\n"
index 22f3860dccb730bdaa61be57e80fb9785821cee1..b5b375b31693d583ec6dded971a4353da765c9c4 100644 (file)
@@ -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 <nikoli@lavabit.com>\n"
 "Language-Team: LANGUAGE <LL@li.org>\n"