GNOME Bugzilla – Bug 549243
intltool-merge ignores .desktop keys with a dash ('-') in them
Last modified: 2008-08-25 03:06:23 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-".
Created attachment 117329 [details] [review] patch to fix issue This may not be the best fix, but it works for me.
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.