#!/bin/bash

# FIXME:
TMPDIR=$PWD
TEMP=$TMPDIR/msgdiff.po-cut$$

#set -x

cat <<EOF
<?xml version="1.0"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>message differences</title>
<link href="msgdiff.css" rel="stylesheet" type="text/css" />
</head>
<body>

<h1>message differences</h1>

EOF

#/msgdiff --web-backend cs.po csn.po add.po fix.po fixr.po

#exec 3<fix.po
#exec 4<fixr.po

msgexec -i add.po ./msgdiff-cgi-dump $$ false
if test -f $TMPDIR/msgdiff.plural-in-progress$$ ; then
	echo '</div>'
	rm $TMPDIR/msgdiff.plural-in-progress$$
fi

msgexec -i fixr.po ./msgdiff-po-cut $$
echo 0 >$TEMP/CNT
msgexec -i fix.po ./msgdiff-cgi-dump $$ true
if test -f $TMPDIR/msgdiff.plural-in-progress$$ ; then
	echo '</div>'
	rm $TMPDIR/msgdiff.plural-in-progress$$
fi
rm -rf $TMPDIR/msgdiff.po-cut$$

cat <<EOF
<div class="footer">
<p>Send any notes to: <a href="mailto:sbrabec@suse.cz">Stanislav Brabec</a></p>
</div>
</body>
</html>
EOF
