After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 549243 - intltool-merge ignores .desktop keys with a dash ('-') in them
intltool-merge ignores .desktop keys with a dash ('-') in them
Status: RESOLVED FIXED
Product: intltool
Classification: Deprecated
Component: general
0.37.x
Other Linux
: Normal normal
: ---
Assigned To: intltool maintainers
intltool maintainers
Depends on:
Blocks:
 
 
Reported: 2008-08-25 01:40 UTC by Brian Tarricone
Modified: 2008-08-25 03:06 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
patch to fix issue (325 bytes, patch)
2008-08-25 01:47 UTC, Brian Tarricone
rejected Details | Review

Description Brian Tarricone 2008-08-25 01:40:44 UTC
I've created a .desktop.in file that contains a line like this:

_X-XfceSettingsName=Keyboard

intltool-extract (or maybe that's -prepare?) correctly extracts "Keyboard" as a translatable string an places it in the .pot file.  However, when building the .desktop file, intltool-merge does not correctly recognise this as a line that needs to be transformed, so I'm left with the underscore-prefixed line as-is in the output .desktop file, with no translated lines added.  If I remove the dash character from the key name (that is, change the line to read "_XXfceSettingsName=Keyboard"), it all works properly as expected.

The dash character is required by the .desktop spec, as all non-standard keys must be prefixed with "X-".
Comment 1 Brian Tarricone 2008-08-25 01:47:36 UTC
Created attachment 117329 [details] [review]
patch to fix issue

This may not be the best fix, but it works for me.
Comment 2 Rodney Dawes 2008-08-25 03:06:23 UTC
The patch is incorrect, yes. In fact, we shouldn't be using \w here anyway. The desktop spec clearly states that A-Za-z0-9 and - are the only allowed characters. As _ is not an allowed character, we should not be using _ which automatically adds it. Instead I've made a patch which fixes the regex without using embedded grouping, and adheres to the allowed characters as per the desktop spec, along with a test case for the merging, as the test cases only checked extraction previously. I've already committed my patch to SVN. Thanks for the bug report.