aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/mail-to-translators
blob: be7291f86e8d9152762605f9ea26f1dd7dac5d5c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
#!/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"

LC_ALL=C
LC_CTYPE=C

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" >&2
    ( 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.  Unfortunately there is not much time left;
we can only include updates we receive by XXXXXXXXXXXXXX UTC.

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.  Please do *not to use the TP Robot* for GnuPG.

A release candidate for 2.0.xx is available at:

  ftp://ftp.gnupg.org/gcrypt/alpha/gnupg/
  ftp://ftp.gnupg.org/gcrypt/alpha/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 short note to
[email protected] .


Happy hacking,

  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