#!/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 &> /dev/null
[ -f missing ] && echo "Check po/missing!" && exit 1

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

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