#!/bin/sh # Test of Glade support, in particular ISO-8859-1 to UTF-8 conversion # and ASCII entities (< > "). tmpfiles="" trap 'rm -fr $tmpfiles' 1 2 3 15 tmpfiles="$tmpfiles empty.glade" cat < empty.glade EOF tmpfiles="$tmpfiles xg-gl-2.pot" : ${XGETTEXT=xgettext} ${XGETTEXT} -o xg-gl-2.pot empty.glade 2>/dev/null test $? = 0 || { echo "Skipping test: xgettext was built without Glade support" rm -fr $tmpfiles; exit 77 } tmpfiles="$tmpfiles simple.glade" cat <<\EOF > simple.glade GtkWindow HelloWindow 5 destroy gtk_main_quit Hello GTK_WINDOW_TOPLEVEL GTK_WIN_POS_NONE True True False GtkButton Hello World True clicked gtk_widget_destroy HelloWindow This <button> displays "Hello World". EOF tmpfiles="$tmpfiles xg-gl-2.tmp xg-gl-2.pot" : ${XGETTEXT=xgettext} ${XGETTEXT} --add-comments -o xg-gl-2.tmp simple.glade test $? = 0 || { rm -fr $tmpfiles; exit 1; } # Don't simplify this to "grep ... < xg-gl-2.tmp", otherwise OpenBSD 4.0 grep # only outputs "Binary file (standard input) matches". cat xg-gl-2.tmp | grep -v 'POT-Creation-Date' > xg-gl-2.pot tmpfiles="$tmpfiles xg-gl-2.ok" cat <<\EOF > xg-gl-2.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=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" #: simple.glade:13 msgid "Hello" msgstr "" #. Der übliche Programm-Gruß #: simple.glade:30 msgid "Hello World" msgstr "" #: simple.glade:31 msgid "This