diff options
Diffstat (limited to 'scripts/mail-to-translators')
-rwxr-xr-x | scripts/mail-to-translators | 79 |
1 files changed, 79 insertions, 0 deletions
diff --git a/scripts/mail-to-translators b/scripts/mail-to-translators new file mode 100755 index 000000000..3df59ad7b --- /dev/null +++ b/scripts/mail-to-translators @@ -0,0 +1,79 @@ +#!/bin/sh +# mail a compressed version of the current translation to the Last-Translator +# + +# remove the colon to armor this script. +SENDMAIL=": /usr/sbin/sendmail" + +for file in *.po; do + addr=$(head -100 $file | awk '/^# ?Designated-Translator:/ { printf "%s", $0; exit 0}' | sed 's/.*\(<.*>\).*/\1/') + if [ -z "$addr" ]; then + addr=$(awk '/Last-Translator:/ { printf "%s", $0; exit 0}' $file | sed 's/.*\(<.*>\).*/\1/') + fi + ll=$(basename $file .po) + + if ! msgfmt -vc $file 2>&1| egrep -q 'fuzzy|untranslated|error'; then + echo "$file: okay" >&2 + continue; + fi + + if ! echo "$addr" | grep -q @ ; then + echo "$file: no translator known" >&2 + continue; + fi + + echo "$file: sending to $addr" + ( cat <<EOF +From: [email protected] +To: $addr +Mail-Followup-To: [email protected] +Subject: GnuPG 2.0 translation ($ll) +Date: $(date -R) +Mime-Version: 1.0 +Content-Type: multipart/mixed; boundary="=-=-=" + +--=-=-= + +Hi! + +We are preparing for a new 2.0 release of GnuPG and like you to ask to +update your translation. + +Please find attached the very latest version of the PO file for your +GnuPG translation ($file). + +It is important to have a basic understanding of GnuPG's functionality +to do a correct translation. A false translation might lead to +security problems. Furthermore the TP Robot is not able to handle +more than one version of a project (we maintain 1.4 and 2.0) and thus +I'd ask you *not to use the TP Robot* for GnuPG. + +Output of msgfmt is: +$(msgfmt --check --statistics $file 2>&1 | head) + +If you are not able to continue the translation work, I suggest to +pass this message on to another translator and drop a a short note to + + +Thanks, + + Werner + + +--=-=-= +Content-Type: application/octet-stream +Content-Disposition: attachment; filename=gnupg-${file}.bz2 +Content-Transfer-Encoding: base64 + +EOF + +bzip2 <$file | mimencode + +echo "" +echo "--=-=-=--" +echo "" + ) | $SENDMAIL -oi "$addr" + +done + |