GNOME Bugzilla – Bug 130663
Log out 'username'
Last modified: 2015-03-24 13:00:56 UTC
In JDS we have a patch that adds a name to the logout string, attached. It currently looks to see if there is a real name, and then fall backs to the user name. Calum made the point that perhaps we should just use the username by default, and put the real name as a tooltip [this patch doesn't do that, but is trivial to add].
Created attachment 23002 [details] [review] panel logout username patch
The reason for that suggestion, incidentally, is that on some systems the real name is often something like "Joe Bloggs - Software Engineer - Doohickey Department", which would obviously make the menu stupidly wide. Also the user has probably had to type in their username to log in anyway (unless they're using a SunRay or something), so even if it's something obscure like "jb12374x" it should still be reasonably familiar to them, and more consistent into the bargain.
I committed a slightly modified version of the patch (with the tooltip stuff).
awesome, thanks vincent, you rock.
Patch was reverted, so reopening. We need to discuss this with i18n people for 2.8.
This causes problem in translations to many languages. Any kind of string composition with words of unknown properties (such as username) is bad, and when it's as much exposed in the UI like Log Out menu item, it sucks big time. The problem is that "username" may take different gender, plurality, declination depending on particular word (i.e. "gman" might be treated differently from "danilo"). In many languages, the rest of the sentence ("Log Out") needs to change in accordance with these properties. In some languages (eg. Serbian, one I'm best familiar with :), even username would need to take different forms if it resembles a readable word. If entire name is used (like in the tooltip), the problem is even worse, because name *must* go through declinations (with username, you can use something like "Log Out '%s'", but you can't do that with name of the user), gender changes, etc. Btw Vincent, you should probably add "string" keyword to this bug, so one doesn't forget to look into it before the following string freeze.
Added string keyword.
The i18n bug for this that caused this to be reverted was bug 131875.
Created attachment 30030 [details] [review] Log out user1 I would like to contribute a patch for this problem. In US English.. It is working properly. Check it for other zones..
Uhm, how does this solve gender/declinations problem discussed above? "_Log out %s" is the same stuff we had earlier. Also, I believe sprintf is not exactly popular in glib-using programs ;)
So, let's try to move on this. I propose this pseudo algorithm: /* Translators: translate "panel:showusername" to anything * but "1" if "Log out %s" doesn't make any sense in your * language. */ show_username = _("panel:showusername"); if (strcmp (show_username, "1")) { display (_("Log out %s")); } else { display (_("Log out")); } What do you think? Any comments from translators? :-)
I guess one more message for translators is not too much for this eye candy for some languages ;-) If only msgfmt didn't consider a missing format specifier from the end an error (like *printf family of functions don't), we'd be much happier :) But, even if this is best we can get, we'd want some more "pseudo" comments :P /* Translators: translate "panel:showusername" to anything * but "1" if "Log out %s" doesn't make any sense in your * language. */ show_username = _("panel:showusername"); if (strcmp (show_username, "1")) { /* Translators: this string is used ONLY if you * translated "panel:showusername" to "1" */ display (_("Log out %s")); } else { /* Translators: this string is used ONLY if you * translated "panel:showusername" to anything other than "1" */ display (_("Log out")); } It's better not to rely on by-source sort-order in PO files, which is not a requirement by the format. :)
Fixed with the proposed solution.