From: Bruno Haible Date: Sat, 16 May 2009 21:08:37 +0000 (+0000) Subject: Test for Glade file extraction with comments. X-Git-Tag: v0.18~205 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6c6867a8bfc9e02ca7b7407667afb2325a2e18a4;p=thirdparty%2Fgettext.git Test for Glade file extraction with comments. --- diff --git a/gettext-tools/tests/xgettext-glade-4 b/gettext-tools/tests/xgettext-glade-4 new file mode 100755 index 000000000..21971adec --- /dev/null +++ b/gettext-tools/tests/xgettext-glade-4 @@ -0,0 +1,68 @@ +#!/bin/sh + +# Test of Glade 2 support. + +tmpfiles="" +trap 'rm -fr $tmpfiles' 1 2 3 15 + +tmpfiles="$tmpfiles xg-gl-4.glade" +cat < xg-gl-4.glade + + + + + + + + True + True + True + Form + 0 + + + + +EOF + +tmpfiles="$tmpfiles xg-gl-4.tmp xg-gl-4.pot" +: ${XGETTEXT=xgettext} +${XGETTEXT} -o xg-gl-4.tmp xg-gl-4.glade +test $? = 0 || { rm -fr $tmpfiles; exit 1; } +# Don't simplify this to "grep ... < xg-gl-4.tmp", otherwise OpenBSD 4.0 grep +# only outputs "Binary file (standard input) matches". +cat xg-gl-4.tmp | grep -v 'POT-Creation-Date' > xg-gl-4.pot + +tmpfiles="$tmpfiles xg-gl-4.ok" +cat <<\EOF > xg-gl-4.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 , 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 \n" +"Language-Team: LANGUAGE \n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=CHARSET\n" +"Content-Transfer-Encoding: 8bit\n" + +#. Form means shape here +#: xg-gl-4.glade:11 +msgid "Form" +msgstr "" +EOF + +: ${DIFF=diff} +${DIFF} xg-gl-4.ok xg-gl-4.pot +result=$? + +rm -fr $tmpfiles + +exit $result