PWN translator

This script is intended to make life easier for PWN translators.
See: http://www.postgresql.org/community/weeklynews/


######################################################################
# Usage:

The pwn mail is feeded into stdin.

example:
translate_pwn_into_german.pl < pwn.mail

This script requires three parameters:

  - config file
  - translation file for local news
  - translation file for product news



######################################################################
# Output:

The output is sent to the email address configured on the
configfile. The parameter name is: "email_receiver".
It is possible to add more than one receiver, split them
by ", ".



######################################################################
# Debugging:

The very first parameter may be "-d" to enable the debugging mode.
In this case, no email is sent, but instead the output is written
into /tmp/pwn-header.txt and /tmp/pwn-body.txt.
Please make sure, this files does not exist prior to debugging.



######################################################################
# Automatic usage:

Another common way to use this script is procmail:

# handle PostgreSQL weekly newsletter
:0 cw
{
  :0
  * ^Subject:.*ANNOUNCE.*PostgreSQL Weekly News
  * ^From:.*david@fetter.org
  * > 5000
  | /home/ads/bin/translate_pwn_into_german.pl /home/ads/pwn.config
  :0
  * ^Subject:.*ANNOUNCE.*PostgreSQL Weekly News
  * ^From:.*davidfetter@postgresql.org
  * > 5000
  | /home/ads/bin/translate_pwn_into_german.pl /home/ads/pwn.config
  # skip anything else
  :0
  /dev/null
}


######################################################################
# Format of config file:

The configfile consists of key/value pairs, separated by "=".
See the included file "pwn.config", which contains all possible keys.



######################################################################
# Format of translation file:

Each translation consists of two parts, "source" and "translation".
The source part starts with a line containing "----- source -----",
the translation part starts with "----- translation -----". No end
marker is required, a new source part ends the previous translation.

The source text is used as-is as a regex. Parts of the text may
consist of regexp functionality, as example to skip text (".+")
or to match text ("(text)"). The first 5 matches are available
in the translation, the placeholders __MATCH_1__ to __MATCH_5__
are replaced with the matches.

See "pwn.product_news" for examples.

Attention:
The literal characters "+", "(" and ")" in the source part must
be escaped by using a \ in front of the character!



######################################################################
# Contact:

For any questions contact me by email:

Andreas 'ads' Scherbaum <ads@pgug.de>
