#! /bin/bash
# FIXME:
TMPDIR=$PWD
TEMP=$TMPDIR/msgdiff.po-cut$1
#set -x
function format_string ()
{
echo "$2" |
if $1 ; then
sed 's%&%\&%g;s%<%\<%g;s%>%\>%g;s%$%
%g'
else
sed 's%&%\&%g;s%<%\<%g;s%>%\>%g;s%$%\
%g'
fi |
if test "${2%
}" = "$2" ; then if $1 ; then sed '$s%
$%%' ; else sed '$s%
$%%' ; fi ; else cat ; fi | tr -d '\n'
}
STARTING_STRING=true
STARTING_PLURAL=false
RUNNING_PLURAL=false
if test -f $TMPDIR/msgdiff.plural-in-progress$1 ; then
if test "${MSGEXEC_MSGID_PLURAL+yes}" = "yes" -a "$MSGEXEC_PLURAL_FORM" != 0 ; then
RUNNING_PLURAL=true
STARTING_STRING=false
else
rm $TMPDIR/msgdiff.plural-in-progress$1
echo ''
fi
fi
if test "${MSGEXEC_MSGID_PLURAL+yes}" = "yes" -a "$MSGEXEC_PLURAL_FORM" = 0 ; then
STARTING_PLURAL=true
RUNNING_PLURAL=true
touch $TMPDIR/msgdiff.plural-in-progress$1
fi
if $STARTING_STRING ; then
echo '
Context:
' echo -n '' format_string true "$MSGEXEC_MSGCTXT" echo -n '' fi echo '
English string:
' echo -n '' format_string true "$MSGEXEC_MSGID" echo -n '' if $STARTING_PLURAL ; then echo '
Plural form of English string:
' echo -n '' format_string true "$MSGEXEC_MSGID_PLURAL" echo -n '' fi fi if test -n "$MSGEXEC_PLURAL_FORM" ; then echo '' echo '' if ! $RUNNING_PLURAL ; then echo '