* gpg.c (reopen_std): New function to reopen fd 0, 1, or 2 if we are
[gnupg.git] / scripts / mail-to-translators
blob7aac1606b62a8e311218de2ac628ab06b89a942d
1 #!/bin/sh
2 # mail a compressed version of the current translation to the Last-Translator
5 # remove the colon to armor this script.
6 SENDMAIL=": /usr/sbin/sendmail"
8 for file in *.po; do
9 addr=$(head -100 $file | awk '/^# ?Designated-Translator:/ { printf "%s", $0; exit 0}' | sed 's/.*\(<.*>\).*/\1/')
10 if [ -z "$addr" ]; then
11 addr=$(awk '/Last-Translator:/ { printf "%s", $0; exit 0}' $file | sed 's/.*\(<.*>\).*/\1/')
13 ll=$(basename $file .po)
15 if ! msgfmt -vc $file 2>&1| egrep -q 'fuzzy|untranslated|error'; then
16 echo "$file: okay" >&2
17 continue;
18 fi
20 if ! echo "$addr" | grep -q @ ; then
21 echo "$file: no translator known" >&2
22 continue;
25 echo "$file: sending to $addr"
26 ( cat <<EOF
27 From: translations@gnupg.org
28 To: $addr
29 Mail-Followup-To: translations@gnupg.org
30 Subject: GnuPG translation ($ll)
31 Mime-Version: 1.0
32 Content-Type: multipart/mixed; boundary="=-=-="
34 --=-=-=
36 Hi!
38 We are preparing for a new 1.4 release of GnuPG and like you to ask to
39 update your translation.
41 Please find attached the very latest version of the PO file for your
42 GnuPG translation ($file).
44 IMHO it is important to have a basic understanding of GnuPG's
45 functionality to do a correct translation. A false translation might
46 lead to security problems. Furthermore the TP Robot is not able to
47 handle more than one version of a project (we have 1.2, 1.4 and also
48 1.9) and thus I'd ask you *not to use the TP Robot* for GnuPG.
50 Output of msgfmt is:
51 $(msgfmt --check --statistics $file 2>&1 | head)
53 If you are not able to continue the translation work, I suggest to
54 pass this message on to another translator and drop a a short note to
55 gnupg-hackers@gnupg.org .
58 Thanks,
60 Werner
63 --=-=-=
64 Content-Type: application/octet-stream
65 Content-Disposition: attachment; filename=gnupg-${file}.gz
66 Content-Transfer-Encoding: base64
68 EOF
70 gzip <$file | mimencode
72 echo ""
73 echo "--=-=-=--"
74 echo ""
75 ) | $SENDMAIL -oi "$addr"
77 done