#!/bin/sh
for trans in `ls locale/`; do
    for string in `ls po/*.pot | sed 's/^po\///' | sed 's/.pot$//'` ; do
	if [ -f locale/${trans}/LC_MESSAGES/${string}.po ]; then
    	    msgfmt locale/${trans}/LC_MESSAGES/${string}.po \
		-c -o locale/${trans}/LC_MESSAGES/${string}.mo
	fi
    done
done

for trans in `ls locale/`; do
    for string in `ls po/plugins/*.pot | sed 's/^po\/plugins\///' | sed 's/.pot$//'` ; do
	if [ -f locale/${trans}/LC_MESSAGES/plugins/${string}.po ]; then
    	    msgfmt locale/${trans}/LC_MESSAGES/plugins/${string}.po \
		-c -o locale/${trans}/LC_MESSAGES/plugins/${string}.mo
	fi
    done
done

for trans in `ls locale/`; do
    for string in `ls po/extra/*.pot | sed 's/^po\/extra\///' | sed 's/.pot$//'` ; do
	if [ -f locale/${trans}/LC_MESSAGES/extra/${string}.po ]; then
    	    msgfmt locale/${trans}/LC_MESSAGES/extra/${string}.po \
		-c -o locale/${trans}/LC_MESSAGES/extra/${string}.mo
	fi
    done
done
