bugGNU gettext - Bugs: bug #56455, metainfo ITS rules not used for...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #56455: metainfo ITS rules not used for appdata files

Submitter:  Will Thompson <wjt>
Submitted:  Fri 07 Jun 2019 10:02:06 AM UTC
   
 
Category:  XML Severity:  3 - Normal
Item Group:  None Status:  Fix Released
Privacy:  Public Assigned to:  ueno
Open/Closed:  Closed

Sun 10 May 2020 07:33:33 AM UTC, comment #3: 


> It would have been useful if `xgettext --debug` could have given me more information about which ITS file is being used, and why. I also wonder whether gettext should stop shipping its own metainfo ITS rules, to avoid this confusion?


Thanks for the suggestion. I've implemented it as:
https://git.savannah.gnu.org/cgit/gettext.git/commit/?id=71a3e81eafa9a70dacf403bb97fbf1a739283ccd

Daiki Ueno <ueno>
Group administrator
Fri 07 Jun 2019 01:50:33 PM UTC, comment #2: 

I missed the distinction between /usr/share/gettext and /usr/share/gettext-0.20.

I've found https://savannah.gnu.org/bugs/index.php?56383 which is essentially the inverse of this bug. I agree with the resolution there. The appstream change is documented at https://github.com/ximion/appstream/pull/186.

It would have been useful if `xgettext --debug` could have given me more information about which ITS file is being used, and why. I also wonder whether gettext should stop shipping its own metainfo ITS rules, to avoid this confusion?

Will Thompson <wjt>
Fri 07 Jun 2019 11:07:38 AM UTC, comment #1: 

See also https://savannah.gnu.org/bugs/?56383

> If I strace xgettext I can see it reading /usr/share/gettext/its/metainfo.its so I'm not sure why it's not being applied.


Note that files under /usr/share/gettext/its/ are not maintained by gettext.  It is the location where other tools install their own extraction rules.  This is analogous to /usr/share/aclocal vs /usr/share/aclocal-X.Y; only the latter is maintained by automake, while the former is provided for extensibility.

So on Fedora, I see:
$ rpm -qf /usr/share/gettext/its/metainfo.its
appstream-0.12.2-2.fc29.x86_64
and the file does contain the rule to extract <releases>.

I am not sure whether or not <releases> should be extracted, but you might want to contact the developers of the package (appstream).

Daiki Ueno <ueno>
Group administrator
Fri 07 Jun 2019 10:02:06 AM UTC, original submission:  

Given the attached appdata file, the strings from the <releases> element are extracted:


$ /tmp/gettext/bin/xgettext  -o - ~/example.appdata.xml
# 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"
"POT-Creation-Date: 2019-06-07 10:55+0100\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"

#: /home/wjt/example.appdata.xml:6
msgid "Name should be extracted"
msgstr ""

#: /home/wjt/example.appdata.xml:7
msgid "Summary should be extracted"
msgstr ""

#: /home/wjt/example.appdata.xml:9
msgid "Description should be extracted."
msgstr ""

#: /home/wjt/example.appdata.xml:16
msgid "Caption should be extracted."
msgstr ""

#: /home/wjt/example.appdata.xml:22
msgid "Release notes should NOT be extracted."
msgstr ""


If I explicitly pass '--its=/tmp/gettext/share/gettext-0.20/its/metainfo.its`' then the release notes are correctly ignored:


$ /tmp/gettext/bin/xgettext --its=/tmp/gettext/share/gettext-0.20/its/metainfo.its -o - ~/example.appdata.xml
# 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"
"POT-Creation-Date: 2019-06-07 10:57+0100\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"

#: /home/wjt/example.appdata.xml:6
msgid "Name should be extracted"
msgstr ""

#: /home/wjt/example.appdata.xml:7
msgid "Summary should be extracted"
msgstr ""

#: /home/wjt/example.appdata.xml:9
msgid "Description should be extracted."
msgstr ""

#: /home/wjt/example.appdata.xml:16
msgid "Caption should be extracted."
msgstr ""


I can reproduce this with 0.20.1 (compiled locally), with Fedora's 0.19.8.1 and with Endless OS's 0.19.8.1 (which comes from Debian Buster).

If I strace xgettext I can see it reading /usr/share/gettext/its/metainfo.its so I'm not sure why it's not being applied.

Will Thompson <wjt>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attached Files
file #47050:  example.appdata.xml added by wjt (857B - text/xml)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by haible (Updated the item)
  • -email is unavailable- added by ueno (Posted a comment)
  • -email is unavailable- added by wjt (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    Follow 6 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2023-01-04 haible StatusFixed Fix Released
    2020-05-10 ueno StatusNone Fixed
        Open/ClosedOpen Closed
    2019-06-07 haible CategoryNone XML
        Assigned toNone ueno
    2019-06-07 wjt Attached File- Added example.appdata.xml, #47050

    Back to the top

    Powered by Savane 3.13-758e.
    Corresponding source code