GNOME Bugzilla – Bug 519528
"Welcome to %n" is not translated
Last modified: 2008-03-25 05:52:27 UTC
Remote greeter welcome message (Welcome to %n") is not present in any .po file, presenting translation to be created by i18n teams.
Actually the default value for the welcome message is really "Welcome to %h". It's an error that the gdmgreeter says "Welcome to %n" is the default. I'm not sure it makes sense to add "Welcome to %n". However, if you think this is a very common default value, then perhaps we could add this string somewhere in the code so it gets translated? Or perhaps we should fix gdmsetup to say the right default value for the string?
Well, I don't really care between %h and %n :) The problem is that neither are translated atm : check for "Welcome to %h" and "Welcome to %n" in po files and you won't find them..
When I cd into the GDM 2.20 branch, cd into the po directory, and grep for "Welcome to %n" I see 166 po files that contain this. Note GDM SVN head is a rewrite, so if you are looking there, you probably won't find this string in its po directory. So, I'm confused about whether this is a bug or not.
By grepping "Welcome to %n", you are also grepping for the documentation string from gdmsetup ;) Try grep '"Welcome to %n"' *.po and you'll get only 17 matches. And don't worry, I'm checking 2.20 branch..
I'm reassigning this issue to the l10n product. This issue is in the GDM 2.20 branch. Note that GDM SVN head is a rewrite and doesn't have this issue. However, we probably should fix this bug in the GDM 2.20 branch since the release-team decided to not approve GDM 2.22 for the GNOME 2.22 release. Frederic, yes, you are correct Looking at the code, I think you are right that this string isn't being marked for translation anymore. The 17 po files that include this string seem to be older po files that haven't been updated since the 2003/2004 timeframe. Can you recommend the best way to mark this string for translation in the code? The l10n team can feel free to modify the 2.20 code in whatever way is appropriate to mark this string for translation.
I guess using N_( ) around the missing string in daemon/gdm.h and adding daemon/gdm.h in po/POTFILES.in should be enough but I'm not a l10n expert.
It's probably not a good idea to set this in daemon/gdm.h. GDM 2.20 lets you restart the GDM greeter GUI in a different language, so we don't want this to be hardcoded to the language that the GDM *daemon* is running with. Remember the greeter GUI can be running under a different language than the daemon. Note that the GDM configuration file allows you to specify the translations there, so perhaps the message should be translated in this file. # Welcome is for all console logins and RemoteWelcome is for remote logins # (through XDMCP). # DefaultWelcome and DefaultRemoteWelcome set the string for Welcome to # "Welcome" and for DefaultWelcome to "Welcome to %n", and properly translate # the message to the appropriate language. Note that %n gets translated to the # hostname of the machine. These default values can be overridden by setting # DefaultWelcome and/or DefaultRemoteWelcome to false, and setting the Welcome # and DefaultWelcome values as desired. Just make sure the strings are in # utf-8 Note to distributors, if you wish to have a different Welcome string # and wish to have this translated you can have entries such as # "Welcome[cs]=Vitejte na %n". I suppose we could also hack the gdm_common_get_welcomemsg function in gui/gdmcommon.c to check if the value is the untranslated default value, and translate it via the _() function so that translations work better for people who don't have the GDM configuration file set up with translations. What do you think?
I think you misread my suggestion : just adding N_ in gdm.h would tell gettext infrastructure to mark this string for translation and add it to gdm.pot file. It wouldn't change anything in the code. Translating the string is already done correctly in gui/gdmcommon.c:gdm_common_get_welcomemsg, as you noted. I would also suggest to try GDM_DEFAULT_REMOTE_WELCOME_MSG, in addition to GDM_DEFAULT_WELCOME_MSG, if no translation is found for overwritten DefaultWelcome (in /etc/X11/gdm/custom.conf). I'm attaching a patch for this suggestion.
Created attachment 106541 [details] [review] try to translate custom welcome string with remote default string if local default string is no match
Frederic Thanks for the patch, but I don't think this will fix the problem. Looking at the code, there is already a similar line to what you add: if (gdm_config_get_bool (GDM_KEY_DEFAULT_REMOTE_WELCOME)) welcomemsg = g_strdup (_(GDM_DEFAULT_REMOTE_WELCOME_MSG)); [...] if (gdm_config_get_bool (GDM_KEY_DEFAULT_WELCOME)) welcomemsg = g_strdup (_(GDM_DEFAULT_WELCOME_MSG)); So, I think the value should be translated properly using the _() function already. I think the problem is that we are using _(GDM_DEFAULT_REMOTE_WELCOME_MSG). This is #defined in daemon/gdm.h as follows: #define GDM_DEFAULT_WELCOME_MSG "Welcome" #define GDM_DEFAULT_REMOTE_WELCOME_MSG "Welcome to %n" Perhaps this syntax isn't appropriate to get the string translated properly? The patch you provided would cause the default value to be used if the user unchecked "use default message", but provided a blank message. I'm not sure this is appropriate. Some users might want to turn off the message, and doing this would make doing this impossible. I'm going to transfer this bug to the l10n group and get their suggestion about how to fix the problem. Anyone from the l10n team can feel free to modify the gdm code so this string is more clearly marked for translation. Also, is it a good idea to send an email to the gnome-i18n list to let them know that this string probably needs attention?
Created attachment 106612 [details] [review] add missing string to po file This patch add the missing string to a utility program which is never used at runtime (so, no code change) and ensure it is grabbed by translators. I haven't removed the duplicated "Welcome" and "Welcome to %n" in the various headers since it isn't worth it.
Created attachment 106613 [details] [review] reworked improved translation when "Welcome to %n" string is used for local welcome Thanks for the patch review, I've corrected it. It allows anybody to use "Welcome to %n" as local welcome string and still get it translated from po file.
l10n team, is this the best way to get these two strings translated, or is there a better way? If no response in the next few days, I'll go ahead and use Frederic's patch from comment #11. I applied patch from comment #12, though I changed it slightly. Please review in SVN 2.20 branch. I modified the patch mostly so that it also works the other way around. If the user decides to use the local msg for the remote msg, then it will translate.
why is this assigned to the german l10n team? this is clearly a gdm code issue. reassigning.
This is now fixed in the 2.20 branch.