#!/bin/sh -e
#
# This is a build script for all *.xml data used by Makefile
# This is smart enough
#  * to skip po data for untranslated and
#  * to use fall back translation for zh-cn/zh-tw
#
# List of translation languges as arguments
LANGPO="$*"
# Directory holding po data based on debian-reference.en.xmlt (persistent)
DPO="po"
DBIN="bin"
# The threshold should be 80 if translation is completed.
MSGCAT="/usr/bin/msgcat"
# current debian-reference package verison in Debian
DVERSION=`dpkg-parsechangelog -S Version`

echo "I: build English source"
make debian-reference.en.xml
echo "I: build English source (less non-translating strings to reduce po size)"
make debian-reference.en.xmlt
# since po/debian-reference.pot is commited to git repo, no need to do this any more.
#touch -t 200001010000.00 po/debian-reference.pot
# set up po4a.cfg for po
sed -e "s/@LANGPO@/${LANGPO}/" -e "s/@DVERSION@/${DVERSION}/" po4a.cfg.in > po4a.cfg
echo "I: update po/*.po based on debian-reference.en.xmlt"
po4a po4a.cfg



