From: Bruno Haible Date: Fri, 11 Oct 2024 10:55:42 +0000 (+0200) Subject: its: Allow a specific XML namespace for .metainfo.xml / .appdata.xml files. X-Git-Tag: v0.23~73 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=70c654cec7890690a96c4bef72d5adfe8c550c47;p=thirdparty%2Fgettext.git its: Allow a specific XML namespace for .metainfo.xml / .appdata.xml files. Reported by Claude Paroz at . * gettext-tools/its/metainfo.its: Duplicate the rules for XML instances that use the metainfo namespace. * gettext-tools/tests/xgettext-appdata-3: New file, based on gettext-tools/tests/xgettext-appdata-2. * gettext-tools/tests/Makefile.am (TESTS): Add it. --- diff --git a/gettext-tools/its/metainfo.its b/gettext-tools/its/metainfo.its index ec0fb7df6..3923614c5 100644 --- a/gettext-tools/its/metainfo.its +++ b/gettext-tools/its/metainfo.its @@ -18,6 +18,7 @@ --> + + + + diff --git a/gettext-tools/tests/Makefile.am b/gettext-tools/tests/Makefile.am index cad3a3d77..b0afd45ce 100644 --- a/gettext-tools/tests/Makefile.am +++ b/gettext-tools/tests/Makefile.am @@ -84,7 +84,7 @@ TESTS = gettext-1 gettext-2 \ xgettext-13 xgettext-14 xgettext-15 xgettext-16 xgettext-17 \ xgettext-18 \ xgettext-combine-1 xgettext-combine-2 xgettext-combine-3 \ - xgettext-appdata-1 xgettext-appdata-2 \ + xgettext-appdata-1 xgettext-appdata-2 xgettext-appdata-3 \ xgettext-awk-1 xgettext-awk-2 xgettext-awk-3 \ xgettext-awk-stackovfl-1 xgettext-awk-stackovfl-2 \ xgettext-c-2 xgettext-c-3 xgettext-c-4 xgettext-c-5 xgettext-c-6 \ diff --git a/gettext-tools/tests/xgettext-appdata-3 b/gettext-tools/tests/xgettext-appdata-3 new file mode 100755 index 000000000..5e4b29658 --- /dev/null +++ b/gettext-tools/tests/xgettext-appdata-3 @@ -0,0 +1,80 @@ +#!/bin/sh +. "${srcdir=.}/init.sh"; path_prepend_ . ../src + +# Test of AppData support: use of a specific namespace. + +cat <<\EOF > xg-gs-3-empty.appdata.xml + + +EOF + +: ${XGETTEXT=xgettext} +${XGETTEXT} -o xg-gs-3.pot xg-gs-3-empty.appdata.xml 2>/dev/null +test $? = 0 || { + echo "Skipping test: xgettext was built without AppData support" + Exit 77 +} + +cat <<\EOF > xg-gs-3.appdata.xml + + + org.gnome.Characters.desktop + GNOME Characters + Character map application + CC0 + +

+ Characters is a simple utility application to find and insert + unusual characters. It allows you to quickly find the character + you are looking for by searching for keywords. +

+
+ https://wiki.gnome.org/Design/Apps/CharacterMap + dueno_at_src.gnome.org +
+EOF + +: ${XGETTEXT=xgettext} +${XGETTEXT} --add-comments -o xg-gs-3.tmp xg-gs-3.appdata.xml || Exit 1 +func_filter_POT_Creation_Date xg-gs-3.tmp xg-gs-3.pot + +cat <<\EOF > xg-gs-3.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" + +#: xg-gs-3.appdata.xml:4 +msgid "GNOME Characters" +msgstr "" + +#: xg-gs-3.appdata.xml:5 +msgid "Character map application" +msgstr "" + +#: xg-gs-3.appdata.xml:8 +msgid "" +"Characters is a simple utility application to find and insert unusual " +"characters. It allows you to quickly find the character you are looking for " +"by searching for keywords." +msgstr "" +EOF + +: ${DIFF=diff} +${DIFF} xg-gs-3.ok xg-gs-3.pot +result=$? + +exit $result