2008-02-09 Marcus Brinkmann <marcus@g10code.de>
[gnupg.git] / scripts / mail-to-translators
blob3df59ad7bc688b14147160f00f5df8ef59abaf59
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 2.0 translation ($ll)
31 Date: $(date -R)
32 Mime-Version: 1.0
33 Content-Type: multipart/mixed; boundary="=-=-="
35 --=-=-=
37 Hi!
39 We are preparing for a new 2.0 release of GnuPG and like you to ask to
40 update your translation.
42 Please find attached the very latest version of the PO file for your
43 GnuPG translation ($file).
45 It is important to have a basic understanding of GnuPG's functionality
46 to do a correct translation. A false translation might lead to
47 security problems. Furthermore the TP Robot is not able to handle
48 more than one version of a project (we maintain 1.4 and 2.0) and thus
49 I'd ask you *not to use the TP Robot* for GnuPG.
51 Output of msgfmt is:
52 $(msgfmt --check --statistics $file 2>&1 | head)
54 If you are not able to continue the translation work, I suggest to
55 pass this message on to another translator and drop a a short note to
56 gnupg-hackers@gnupg.org .
59 Thanks,
61 Werner
64 --=-=-=
65 Content-Type: application/octet-stream
66 Content-Disposition: attachment; filename=gnupg-${file}.bz2
67 Content-Transfer-Encoding: base64
69 EOF
71 bzip2 <$file | mimencode
73 echo ""
74 echo "--=-=-=--"
75 echo ""
76 ) | $SENDMAIL -oi "$addr"
78 done