libgksu doesn't translate a "Password: " string correctly

Bug #41239 reported by Sir No
6
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/gksu-context.c file, based
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.2-1.3.7-localized-prompt.patch file.
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.

Revision history for this message
Sir No (wiktorw) wrote : libgksu1.2-1.3.7-localized-prompt.patch

diff -urpN libgksu1.2-1.3.7.orig/libgksu/gksu-context.c libgksu1.2-1.3.7/libgksu/gksu-context.c
--- libgksu1.2-1.3.7.orig/libgksu/gksu-context.c 2005-11-18 01:18:02.000000000 +0100
+++ libgksu1.2-1.3.7/libgksu/gksu-context.c 2006-02-27 23:12:12.000000000 +0100
@@ -870,7 +870,14 @@ gksu_context_run_full (GksuContext *cont
   {
     if (!context->password)
       {
- 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;

         g_return_val_if_fail (context->password, -1);

Revision history for this message
Sir No (wiktorw) wrote : URL for libgksu1.2-1.3.7-localized-prompt.patch
Changed in libgksu1.2:
status: Unconfirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.