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 631615 - egg_set_desktop_file() does not return translated value from desktop file
egg_set_desktop_file() does not return translated value from desktop file
Status: RESOLVED FIXED
Product: libegg
Classification: Other
Component: other
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Libegg maintenance
Libegg maintenance
Depends on:
Blocks: 631612
 
 
Reported: 2010-10-07 14:55 UTC by Gabor Kelemen
Modified: 2011-04-04 10:03 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Quick and dirty, but working hack to really return the localized Name from desktop files (938 bytes, patch)
2010-10-07 15:00 UTC, Gabor Kelemen
rejected Details | Review

Description Gabor Kelemen 2010-10-07 14:55:35 UTC
egg_set_desktop_file() says that it returns translated value from .desktop file, but it in fact does not: http://git.gnome.org/browse/libegg/tree/libegg/smclient/eggdesktopfile.c#n1442
This can lead to bugs like[1].

[1]: https://bugzilla.gnome.org/show_bug.cgi?id=631612
Comment 1 Gabor Kelemen 2010-10-07 15:00:27 UTC
Created attachment 171904 [details] [review]
Quick and dirty, but working hack to really return the localized Name from desktop files

Just a quick POC, something like this should do the trick. Probably the same should happen in egg_desktop_file_get_name().
Comment 2 Vincent Untz 2010-10-07 15:06:18 UTC
Isn't the issue that desktop_file->name is not localized? It should just be initialized with g_key_file_get_locale_string() instead of g_key_file_get_string()...
Comment 3 Murray Cumming 2010-10-29 10:25:44 UTC
Gabor, could you respond to Vincent, please?
Comment 4 Gabor Kelemen 2010-10-29 13:17:56 UTC
Ooops, sorry Vincent, I think I didn't noticed your comment. Yes, the problem is this, in the sense that the translation is present in the desktop file, but the function does not retrieve that value. I have no real deep knowledge of libegg, so the implementation details are not my strength here :). As egg_desktop_file_get_locale_string calls g_key_file_get_locale_string, I thought it may be what we need here, but calling it directly will be good too.
Comment 5 David King 2011-04-04 10:00:07 UTC
Fix as suggested in comment 2 pushed as commit e7433931d414bf523d800dead8e7df2fe4bd7644.