#!/bin/sh
. "${srcdir=.}/init.sh"; path_prepend_ . ../src

# Test of Desktop Entry support.

cat <<EOF > xg.desktop
[Desktop Entry]
Type=Application
Name =Foo
Comment= \sThis is a \nmultiline\t comment; for testing
Comment[foo]=Already translated comment
Keywords=Keyword1;Keyword2;Key\;word3;
EOF

: ${XGETTEXT=xgettext}
${XGETTEXT} --add-comments -o - xg.desktop | grep -v 'POT-Creation-Date' > xg-desktop.pot || exit 1

cat <<\EOF > xg-desktop.ok
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=CHARSET\n"
"Content-Transfer-Encoding: 8bit\n"

#: xg.desktop:4
msgid "Foo"
msgstr ""

#: xg.desktop:5
msgid ""
" This is a \n"
"multiline\t comment; for testing"
msgstr ""

#: xg.desktop:7
msgid "Keyword1;Keyword2;Key\\;word3;"
msgstr ""
EOF

: ${DIFF=diff}
${DIFF} xg-desktop.ok xg-desktop.pot
result=$?

exit $result
