Fix last change
[gnupg.git] / scripts / mail-to-translators
blobc01e89e59cd25b4a5aac344daaad4f085cd92ef0
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 LC_ALL=C
9 LC_CTYPE=C
11 for file in *.po; do
12 addr=$(head -100 $file | awk '/^# ?Designated-Translator:/ { printf "%s", $0; exit 0}' | sed 's/.*\(<.*>\).*/\1/')
13 if [ -z "$addr" ]; then
14 addr=$(awk '/Last-Translator:/ { printf "%s", $0; exit 0}' $file | sed 's/.*\(<.*>\).*/\1/')
16 ll=$(basename $file .po)
18 if ! msgfmt -vc $file 2>&1| egrep -q 'fuzzy|untranslated|error'; then
19 echo "$file: okay" >&2
20 continue;
21 fi
23 if ! echo "$addr" | grep -q @ ; then
24 echo "$file: no translator known" >&2
25 continue;
28 echo "$file: sending to $addr"
29 ( cat <<EOF
30 From: translations@gnupg.org
31 To: $addr
32 Mail-Followup-To: translations@gnupg.org
33 Subject: GnuPG 2.0 translation ($ll)
34 Date: $(date -R)
35 Mime-Version: 1.0
36 Content-Type: multipart/mixed; boundary="=-=-="
38 --=-=-=
40 Hi!
42 We are preparing for a new 2.0 release of GnuPG and like you to ask to
43 update your translation.
45 Please find attached the very latest version of the PO file for your
46 GnuPG translation ($file).
48 It is important to have a basic understanding of GnuPG's functionality
49 to do a correct translation. A false translation might lead to
50 security problems. Furthermore the TP Robot is not able to handle
51 more than one version of a project (we maintain 1.4 and 2.0) and thus
52 I'd ask you *not to use the TP Robot* for GnuPG.
54 The release candidate for 2.0.10 is available at:
56 ftp://ftp.gnupg.org/gcrypt/alpha/gnupg/gnupg-2.0.10rc1.tar.bz2
57 ftp://ftp.gnupg.org/gcrypt/alpha/gnupg/gnupg-2.0.10rc1.tar.bz2.sig
59 Output of msgfmt is:
60 $(msgfmt --check --statistics $file 2>&1 | head)
62 If you are not able to continue the translation work, I suggest to
63 pass this message on to another translator and drop a short note to
64 gnupg-hackers@gnupg.org .
67 Happy hacking,
69 Werner
72 --=-=-=
73 Content-Type: application/octet-stream
74 Content-Disposition: attachment; filename=gnupg-${file}.bz2
75 Content-Transfer-Encoding: base64
77 EOF
79 bzip2 <$file | mimencode
81 echo ""
82 echo "--=-=-=--"
83 echo ""
84 ) | $SENDMAIL -oi "$addr"
86 done