#!/bin/sh
#
# Plural test for YCP
#

tmpfiles=""
trap 'rm -fr $tmpfiles' 1 2 3 15

tmpfiles="$tmpfiles xg-test17.ycp"
cat <<EOF > xg-test17.ycp
title = sformat (_("%1 package", "%1 packages", num), num);
EOF

tmpfiles="$tmpfiles xg-test17.po"
: ${XGETTEXT=xgettext}
${XGETTEXT} --omit-header --no-location -k:1,2 -d xg-test17 xg-test17.ycp
test $? = 0 || { rm -fr $tmpfiles; exit 1; }

tmpfiles="$tmpfiles xg-test17.ok"
cat <<EOF > xg-test17.ok
#, ycp-format
msgid "%1 package"
msgid_plural "%1 packages"
msgstr[0] ""
msgstr[1] ""
EOF

: ${DIFF=diff}
${DIFF} xg-test17.ok xg-test17.po
result=$?

rm -fr $tmpfiles

exit $result
