Re: [patch] add a "connection information" dialog.



On Tue, 2005-06-21 at 15:44 -0400, Robert Love wrote:
> On Tue, 2005-06-21 at 15:42 -0400, Robert Love wrote:
> 
> > The attached email implements a "Connection Information" dialog,
> > accessible from the right-click menu, with connection-related
> > information such as IP address, subnet mask, active interface, and so
> > on.

I can't really comment as to whether it's a good idea or not, but from a
code point of view:

You create several different error dialogs like this:
+ error_dialog = gtk_message_dialog_new_with_markup (
+                               GTK_WINDOW (info_dialog),
+                               0, GTK_MESSAGE_ERROR, GTK_BUTTONS_OK,
+                               _("<span weight=\"bold\" size=\"larger
\">"
+                                 "Error displaying connection
information: "
+                                 "</span>\n\n"
+                                 "No active connection!"));

Speaking from experience, you'll get yelled at by translators.  They
don't like having the <span> in the translated text; they suggest
wrapping it in g_strdup_printf, like:

msg = g_strdup_printf ("<span weight=\"bold\" size=\"larger\">%s</span>", 
                       _("Error displaying connection information: %s"));
error_dialog = gtk_message_dialog_new_with_markup (GTK_WINDOW (info_dialog),
                                                   0, GTK_MESSAGE_ERROR, GTK_BUTTONS_OK,
                                                   msg,
                                                   _("No active connection!"));
g_free (msg);

And actually looking more closely it looks like you're missing a %s.  
Also, you have several variants of this message which only differ on one
technical detail ("Unable to open socket" versus "SIOCGIFFLAGS failed on
socket!"), you probably want to extract that to a separate printf so the
translators only have to do the "Error displaying connection
information:" string once.  Maybe just do a "goto socket_error;".


Attachment: signature.asc
Description: This is a digitally signed message part



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]