#!/bin/sh

find imiptools imipweb -type f -name '*.py' | xargs xgettext -d imip-agent --no-location

  sed "s/SOME DESCRIPTIVE TITLE/Translations for imip-agent/" imip-agent.po \
| sed "s/YEAR THE PACKAGE'S COPYRIGHT HOLDER/2015 Paul Boddie <paul@boddie.org.uk>/" \
| sed "s/FIRST AUTHOR <EMAIL@ADDRESS>, YEAR/Paul Boddie <paul@boddie.org.uk>, 2015/" \
| sed "s/PACKAGE VERSION/`hg id | cut -d ' ' -f 1`/" \
| sed "s/PACKAGE/imip-agent/" \
> imip-agent.pot

for FILENAME in messages/*.po ; do
    msgmerge --update "$FILENAME" imip-agent.pot
done
