#!/bin/sh
#
# Compile language file
# Copyright 2005-2006 Florian Daeumling <jam@qv90.de>, Jaballa Software
# Licensed under the GNU GPL. For full terms see the file COPYING.
#

if [ -z "$1" ]; then
 echo "USAGE: compilepo [localename]"
 exit 1
fi

WORKDIR=../../locale
LOCALEDIR=$WORKDIR/$1

if [ ! -d $LOCALEDIR ]; then
 # lessee if it's been renamed.
 DCOUNT=`find $WORKDIR/ -name $1* | wc -l` 
 if [ $DCOUNT -eq 1 ]; then 
  # aha
  LOCALEDIR=`find $WORKDIR/ -name $1*`
 elif [ $DCOUNT -gt 1 ]; then
  # err out
  echo "More than one locale matching this name found:"
  find $WORKDIR/ -name $1*
  echo "You have to be more specific."
  exit 1
 fi
fi

LOCALEDIR=$LOCALEDIR/LC_MESSAGES

cp ./expire.po $LOCALEDIR/expire.po

echo "Compiling $LOCALEDIR/expire.po"
msgfmt -o $LOCALEDIR/expire.mo $LOCALEDIR/expire.po

