#!/bin/sh
#
# $Id: mail_pos,v 1.3 2001/06/12 19:35:33 nerijus Exp $
#
# A simple script to automatically mail the .po files to the last
# translators and ask them to update them.

make msgcat && make mergecat
if [ $? != 0 ]
then
	echo Something is wrong...
	exit 1
fi

for po in *.po
do
	translator=`fgrep Last-Translator $po | \
		sed "1,$ s/\"Last-Translator://g" | \
		sed '1,$ s/\\\\n"//g'`

cat >/tmp/mail_pos$$ <<__EOF__
Hello,

you have done translation work for the Mahogany client.
The translation files should need some checking and
updating by now. If possible, please have a look at the
included .pos file and, when done, mail it back to
karsten@phy.hw.ac.uk .

You should find two different .po files included here:
    - the existing xx.po for Mahogany translations to your
      language as you submitted it earlier, but amended to
      include new strings

    - a xx.po file for wxWindows which will either be an	
      existing translation for your language, or the German
      one to be used as a starting point

While the wxWindows translations are not that important,
they are needed to have Mahogany completely translated.
    
To help you with the work, this mail will first include
a list of untranslated messages, generated by a test
script. You should also look for any messages marked as
"fuzzy" and, after translation, remove the "fuzzy" marker
to ignore them in the future.

If possible, try to test the file yourself.

This message has been auto-generated by a script. If you
have any questions or comments, please get in touch with
me personally.

Regards and thanks again for your help,
Karsten Ballueder <karsten@phy.hw.ac.uk>

*Note: You might not be able to reply to this mail directly,
depending from where it originated. Please use my generic mail
address karsten@phy.hw.ac.uk instead.
-----------------------------------------------------------
__EOF__

./poempty.pl $po >> /tmp/mail_pos$$
echo ----------------------------------------------------------- >>/tmp/mail_pos$$
cat $po >> /tmp/mail_pos$$
#echo ------wxstd.po for wxWindows: ----------------------------- >>/tmp/mail_pos$$
#if [ -f wxstd/$po ]
#then
#    cat wxstd/$po >>/tmp/mail_pos$$
#else
#    echo "(There is no wxstd.po for your language yet, including the German one as a starting point.)" >>/tmp/mail_pos$$
#    cat wxstd/de.po >>/tmp/mail_pos$$
#fi
echo ----------------------------------------------------------- >>/tmp/mail_pos$$

cat /tmp/mail_pos$$ | mail -s "Mahogany translation update" "$translator"
rm /tmp/mail_pos$$

done

