libgksu doesn't translate a "Password: " string correctly
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
libgksu1.2 (Ubuntu) |
Fix Released
|
Medium
|
Unassigned |
Bug Description
Recently I did a translation of gksu, libgksu and libgksuui packages.
While testing the resulting translation I've found one situation when
the window asking for the password was translated only in 95%.
And exactly one string, namely "Password: " was always displayed
in original (English).
This was odd, because I was positively sure that this string
was translated correctly. However, that resulted in an unaesthetic
situation: almost all messages translated and one big "Password: "
in the center of the window...
Eventually I've found that this is due to the way how libgksuui
interacts with the login tty. So in fact this "Password: " string was
coming from the tty, and not from the libgksuui's missing translation.
I've created a small patch against libgksu/
on the fact that exactly the same string is already translated in the
libgksuui's .po files. It works this way:
- compares the string buffer read from the tty with the constant
"Password: " string
- if the strings match, buffer is replaced with the translated string
- finally 'ask_pass' function is called with the resulting prompt
The patch is in the libgksu1.
Please review it and if you find it useful, please apply. With this patch the
gksu combo is "complete" - so all messages displayed on the screen
are properly translated.
Changed in libgksu1.2: | |
status: | Unconfirmed → Fix Released |
diff -urpN libgksu1. 2-1.3.7. orig/libgksu/ gksu-context. c libgksu1. 2-1.3.7/ libgksu/ gksu-context. c 2-1.3.7. orig/libgksu/ gksu-context. c 2005-11-18 01:18:02.000000000 +0100 2-1.3.7/ libgksu/ gksu-context. c 2006-02-27 23:12:12.000000000 +0100 run_full (GksuContext *cont >password)
--- libgksu1.
+++ libgksu1.
@@ -870,7 +870,14 @@ gksu_context_
{
if (!context-
{
- if (ask_pass (context, buf, user_data, error))
+ gchar* prompt = buf;
+ // Use the translated version of "Password: " string
+ // if possible (this string is already localized).
+ if (strcmp("Password: ", buf) == 0)
+ {
+ prompt = _("Password: ");
+ }
+ if (ask_pass (context, prompt, user_data, error))
return -1;