1.1 --- a/tools/i18n_messages.sh Thu Nov 05 20:00:51 2015 +0100
1.2 +++ b/tools/i18n_messages.sh Fri Nov 06 00:00:55 2015 +0100
1.3 @@ -1,14 +1,23 @@
1.4 #!/bin/sh
1.5
1.6 -find imiptools imipweb -type f -name '*.py' | xargs xgettext -d imip-agent --no-location
1.7 +# Obtain messages from the Python files.
1.8 +
1.9 + find imiptools imipweb -type f -name '*.py' \
1.10 +| xargs xgettext -d imip-agent --sort-by-file \
1.11 + --copyright-holder="Paul Boddie <paul@boddie.org.uk>" \
1.12 + --package-name="imip-agent" --package-version=`hg id | cut -d ' ' -f 1`
1.13 +
1.14 +# Set the default charset.
1.15
1.16 - sed "s/SOME DESCRIPTIVE TITLE/Translations for imip-agent/" imip-agent.po \
1.17 -| sed "s/YEAR THE PACKAGE'S COPYRIGHT HOLDER/2015 Paul Boddie <paul@boddie.org.uk>/" \
1.18 -| sed "s/FIRST AUTHOR <EMAIL@ADDRESS>, YEAR/Paul Boddie <paul@boddie.org.uk>, 2015/" \
1.19 -| sed "s/PACKAGE VERSION/`hg id | cut -d ' ' -f 1`/" \
1.20 -| sed "s/PACKAGE/imip-agent/" \
1.21 + sed "s/CHARSET/iso-8859-1/" imip-agent.po \
1.22 > imip-agent.pot
1.23
1.24 +# Remove the original file.
1.25 +
1.26 +rm imip-agent.po
1.27 +
1.28 +# Merge messages with the existing translations.
1.29 +
1.30 for FILENAME in messages/*.po ; do
1.31 msgmerge --update "$FILENAME" imip-agent.pot
1.32 done