bugGNU gettext - Bugs: bug #54472, appdata.xml string extraction...

 
 

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

bug #54472: appdata.xml string extraction broken when root component has namespace

Submitter:  Claude Paroz <claudep>
Submitted:  Wed 08 Aug 2018 09:09:12 PM UTC
   
 
Category:  AppData Severity:  3 - Normal
Item Group:  None Status:  None
Privacy:  Public Assigned to:  None
Open/Closed:  Open

Wed 31 Jul 2019 05:24:52 AM UTC, comment #3: 

This sounds like a general question about XPath, not a deficiency in gettext itself.

If the upstream schema mandates a namespace, all the conforming data files should have an explicit xmlns.

If namespace is optional like metainfo, you can prepare the ITS rules to match against local names only:
https://stackoverflow.com/questions/5239685/xml-namespace-breaking-my-xpath

Daiki Ueno <ueno>
Group administrator
Mon 29 Jul 2019 09:04:51 PM UTC, comment #2: 

We have the same issue in Inkscape, where we want to extract translatable strings from the simple XML format that is used to describe the GUI-parts of Inkscape extensions (*.inx file format).

They use the XML namespace "http://www.inkscape.org/namespace/inkscape/extension" and look like the following:


<?xml version="1.0" encoding="UTF-8"?>
<inkscape-extension xmlns="http://www.inkscape.org/namespace/inkscape/extension">
...
</inkscape-extension>


It's obviously neither a metainfo nor an appdata file format, but I had hoped xgettext would aim to support ITS rules in a more general way?

Patrick Storz <ede123>
Wed 08 Aug 2018 09:43:25 PM UTC, comment #1: 

The specification of the metainfo and appdata file format, https://www.freedesktop.org/software/appstream/docs/chap-Metadata.html#sect-Metadata-GenericComponent, says:

"The XML in metainfo files does not need any XML namespace, and adding one should generally be avoided. If you want to use a namespace though (maybe in case you want to embed the data in other contexts), the xmlns should be https://specifications.freedesktop.org/metainfo/1.0."

So, it should use https://specifications.freedesktop.org/metainfo/1.0 as the default namespace.

Bruno Haible <haible>
Group administrator
Wed 08 Aug 2018 09:09:12 PM UTC, original submission:  

Simply change gettext/gettext-tools/tests/xgettext-appdata-1:
-<component type="desktop">
+<component type="desktop" xmlns="https://specifications.freedesktop.org/metainfo/1.0">

and you'll see that ITS rules will no longer apply to string extraction (ie. all strings are extracted instead of a selection).

This was discovered in https://gitlab.gnome.org/GNOME/gucharmap/issues/11

Claude Paroz <claudep>

 

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

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by ueno (Posted a comment)
  • -email is unavailable- added by ede123 (Posted a comment)
  • -email is unavailable- added by haible (Posted a comment)
  • -email is unavailable- added by claudep (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.

     

    No changes have been made to this item

    Back to the top

    Powered by Savane 3.13-f8d8.
    Corresponding source code