GNOME Bugzilla – Bug 572360
"Password: " is not translated in pam module
Last modified: 2009-06-26 16:40:54 UTC
In prompt_password(), we have a string "Password: ". I thought that PAM would magically translate it, but it seems it doesn't -- at least, I saw it a few minutes ago.
I'm not quite sure what's the right thing to do here:
+ we can use GNOME translations, and so use the gnome-keyring gettext domain.
+ we can try to use the PAM translations. On Linux, it means using the Linux-PAM domain (as far as I can tell). I tried here and it works.
The latter might be better for consistency, but I'm not sure if it will work on all platforms :/
Created attachment 129030 [details] [review]
Here's a patch for the second solution. Or at least an example of how it could be, since we don't want to use the Linux-PAM domain like that.
A solution could be to use a configure flag to specify the domain (it could also be used to say "use internal translation").
The patch looks good. But are you sure that this is meant to be translated? I think that there's a bit of screen scraping going on within PAM apps.
I have a feeling, but I'm not certain, that this string is not only interpreted by humans, but also by applications.
How would we go about verifying this? Could you perhaps ask on a PAM mailing list where folks who would know hang out?
When I saw the untranslated strings, I looked at the pam code and saw that:
(look for "Password:"). So they do translate it in PAM. But it might make sense to check by sending a mail if there's any doubt.
Oh boy, sorry, I missed string freeze on this one. Do you think it could wait until 2.27? If not, we could get permission for breaking the freeze.
It's not urgent, so let's do it for 2.27. However, I'm confused: do you want to make the string translatable for translators, or do you want to re-use the pam translations (as my draft patch does)?
Actually, we should probably look for a pam translation (for consistency) and if there's none, use an internal translation. That sounds better.
Is there anyway to do that automatically without adding a configure option?
Sure. We can do this:
translated = NULL
try Linux-PAM gettext domain
// wait for bsd people to tell us what domain to use
// wait for solaris people to tell us what domain to use
if (translated == NULL)
use our own translation
Is this really what other projects with PAM modules do?
Heh, sorry to keep going back and forth on this. If you're willing to take responsibility, I'd say go ahead and do it in the way that you feel is best.
(In reply to comment #8)
> Is this really what other projects with PAM modules do?
I think I only checked PAM modules that are shipped with PAM, so, well, it's not a good example. I'll check other PAM modules if I can find some.
So, can this get in now that gnome-keyring has branched for 2.26, please?
I've committed Vincent's patch to master. Only fixes the problem on linux, but I wouldn't know where to start on other OS's.