#!/bin/sh
# Update the pot-file and all existing po-files with new strings.
# Requires gettext and intltool.

DIRNAME=$(dirname "$0")
cd "$DIRNAME/../po" || exit 1

echo "Checking for missing source files..."
intltool-update -m || exit 1
sleep 3 && [ -f missing ] && exit 1

echo "Updating gaupol.pot..."
intltool-update -p -g gaupol -x || exit 1

for FNAME in *.po; do
    echo "Updating $FNAME..."
    msgmerge -U -N -v "$FNAME" gaupol.pot
done
