]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
Test for Glade file extraction with comments.
authorBruno Haible <bruno@clisp.org>
Sat, 16 May 2009 21:08:37 +0000 (21:08 +0000)
committerBruno Haible <bruno@clisp.org>
Tue, 23 Jun 2009 10:16:05 +0000 (12:16 +0200)
gettext-tools/tests/xgettext-glade-4 [new file with mode: 0755]

diff --git a/gettext-tools/tests/xgettext-glade-4 b/gettext-tools/tests/xgettext-glade-4
new file mode 100755 (executable)
index 0000000..21971ad
--- /dev/null
@@ -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 <<EOF > xg-gl-4.glade
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!DOCTYPE glade-interface SYSTEM "glade-2.0.dtd">
+<!--Generated with glade3 3.4.3 on Sat May 16 19:53:48 2009 -->
+<glade-interface>
+  <widget class="GtkWindow" id="mainWindow">
+    <child>
+      <widget class="GtkButton" id="FormButton">
+        <property name="visible">True</property>
+        <property name="can_focus">True</property>
+        <property name="receives_default">True</property>
+        <property name="label" translatable="yes" comments="Form means shape here">Form</property>
+        <property name="response_id">0</property>
+      </widget>
+    </child>
+  </widget>
+</glade-interface>
+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 <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"
+
+#. 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