#/bin/bash

tmpFiles=/tmp/tmpFiles

echo "-> create list of files"
find ../../* -type f -print|grep -v "\.htaccess"|grep -v "\.repo"|grep -v "\.svn"|grep -v "\.git"|grep -v "\.swp"|grep -v "/scripts.org/"|grep -v "/scripts/"|grep -v "/scripts.20160403/"|grep -v CVS |grep -v "/locale/"|grep -v "/images/"|grep -v "/pdf/"> $tmpFiles

cat $tmpFiles

echo "-> create new website.pot"
LANG=C /usr/bin/xgettext -f $tmpFiles -o website.pot

echo "-> merge website.pot to all po files and create mo file"
for f in *.po; do
  if [ -f $f ]; then
    file=`echo $f|sed "s/\.po//g"`
    echo "   -> $f = $file"
    ./pomerge $file
    ./po2mo $file
  fi
done

rm $tmpFiles

