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 618983 - g_get_real_name l10n issue ...
g_get_real_name l10n issue ...
Product: glib
Classification: Platform
Component: general
Other Linux
: Normal normal
: ---
Assigned To: gtkdev
Depends on:
Reported: 2010-05-18 13:47 UTC by Michael Meeks
Modified: 2018-05-24 12:18 UTC
See Also:
GNOME target: ---
GNOME version: ---

Implement g_get_real_name_for_display (2.46 KB, patch)
2010-06-16 10:38 UTC, Christian Dywan
none Details | Review

Description Michael Meeks 2010-05-18 13:47:46 UTC
I just got a bug filed because the Evo. account dialog uses:

g_get_real_name ()

to pre-fill the user's real name [ as you do ;-].

Unfortunately, if it can't work out the real name, it returns an un-translated string:

  if (!g_user_name)
    g_user_name = g_strdup ("somebody");
  if (!g_real_name)
    g_real_name = g_strdup ("Unknown");

Feature or bug ? I'd prefer to see either a NULL return for unknown, or (more safely) an additional _() there :-) Same problem for user_name I guess - though that is far less likely to fail.

Comment 1 Christian Dywan 2010-05-18 14:08:44 UTC
The encoding of the returned string is undefined. If anything, you want a new g_get_real_name_for_display () which is locaized and UTF-8. I think that was proposed somewhere already but not followed up on.
Comment 2 Matthias Clasen 2010-05-19 12:35:36 UTC
g_get_real_name_for_display would make some sense
Comment 3 Christian Dywan 2010-06-16 10:05:13 UTC
Found it, bug 542058 is what I had been thinking of, with proposed g_get_user_name_for_display. So I think we should be going for both. I'll write up g_get_real_name_for_display.
Comment 4 Christian Dywan 2010-06-16 10:38:42 UTC
Created attachment 163798 [details] [review]
Implement g_get_real_name_for_display

The _for_display variant always returns UTF-8. If the real name can't be determined a localized "Unknown" is returned.
Comment 5 GNOME Infrastructure Team 2018-05-24 12:18:28 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to GNOME's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: