pidgin: 84fc6909: Connection error message changes for gg,...

markdoliner at pidgin.im markdoliner at pidgin.im
Mon Jul 6 05:15:54 EDT 2009


-----------------------------------------------------------------
Revision: 84fc690990052c6d46d2a83019425e8cfb7b3358
Ancestor: 5e860cee52ca7cb571dc425dbd1b3291a74d7401
Author: markdoliner at pidgin.im
Date: 2009-07-06T05:27:08
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/84fc690990052c6d46d2a83019425e8cfb7b3358

Modified files:
        libpurple/protocols/gg/gg.c

ChangeLog: 

Connection error message changes for gg, and a few other strings changes.
* Short connection error messages (phrases and short sentences) should not
  end in a period.  This is kind of arbitrary, but I did comparisons both
  ways and I thought short messages looked a lot better without the period.
  Less cluttered, more approachable.
* Connection error messages should not have trailing newlines--the UI
  should add a newline if it wants.
* Change "token" to "captcha" in the input box prompts when creating a
  new account.  Captcha is an increasingly common term for this.  Not
  all users will know what it means, but "token" is not a whole lot better.
  And users should be able to figure out what to do using context clues,
  regardless of the term used.  I believe we use the same term in QQ.
* Put the output of g_strerror(errno) in the message when possible

-------------- next part --------------
============================================================
--- libpurple/protocols/gg/gg.c	a9f48f89275ab4897804c7ce2dc188ee7aecf1ea
+++ libpurple/protocols/gg/gg.c	8c26c44a12c8bf9b9fe221c42083f84fa3bc4420
@@ -352,14 +352,14 @@ static void ggp_callback_register_accoun
 	    *email == '\0' || *p1 == '\0' || *p2 == '\0' || *t == '\0') {
 		purple_connection_error_reason (gc,
 			PURPLE_CONNECTION_ERROR_OTHER_ERROR,
-			_("Fill in the registration fields."));
+			_("You must fill in all registration fields"));
 		goto exit_err;
 	}
 
 	if (g_utf8_collate(p1, p2) != 0) {
 		purple_connection_error_reason (gc,
 			PURPLE_CONNECTION_ERROR_AUTHENTICATION_FAILED,
-			_("Passwords do not match."));
+			_("Passwords do not match"));
 		goto exit_err;
 	}
 
@@ -369,7 +369,7 @@ static void ggp_callback_register_accoun
 	if (h == NULL || !(s = h->data) || !s->success) {
 		purple_connection_error_reason (gc,
 			PURPLE_CONNECTION_ERROR_OTHER_ERROR,
-			_("Unable to register new account. Error occurred.\n"));
+			_("Unable to register new account.  An unknown error occurred."));
 		goto exit_err;
 	}
 
@@ -450,18 +450,18 @@ static void ggp_register_user_dialog(Pur
 	purple_request_field_group_add_field(group, field);
 
 	field = purple_request_field_string_new("password2",
-			_("Password (retype)"), "", FALSE);
+			_("Password (again)"), "", FALSE);
 	purple_request_field_string_set_masked(field, TRUE);
 	purple_request_field_group_add_field(group, field);
 
 	field = purple_request_field_string_new("token",
-			_("Enter current token"), "", FALSE);
+			_("Enter captcha text"), "", FALSE);
 	purple_request_field_string_set_masked(field, FALSE);
 	purple_request_field_group_add_field(group, field);
 
 	/* original size: 60x24 */
 	field = purple_request_field_image_new("token_img",
-			_("Current token"), token->data, token->size);
+			_("Captcha"), token->data, token->size);
 	purple_request_field_group_add_field(group, field);
 
 	purple_request_fields(account,
@@ -1530,7 +1530,7 @@ static void ggp_callback_recv(gpointer _
 			"ggp_callback_recv: gg_watch_fd failed -- CRITICAL!\n");
 		purple_connection_error_reason (gc,
 			PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
-			_("Unable to read socket"));
+			_("Unable to read from socket"));
 		return;
 	}
 	gc->last_received = time(NULL);
@@ -1688,7 +1688,7 @@ static void ggp_async_login_handler(gpoi
 		purple_debug_error("gg", "login_handler: gg_watch_fd failed!\n");
 		purple_connection_error_reason (gc,
 			PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
-			_("Unable to read socket"));
+			_("Unable to read from socket"));
 		return;
 	}
 	purple_debug_info("gg", "login_handler: session->fd = %d\n", info->session->fd);
@@ -1725,7 +1725,7 @@ static void ggp_async_login_handler(gpoi
 			gc->inpa = 0;
 			purple_connection_error_reason (gc,
 				PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
-				_("Connection failed."));
+				_("Connection failed"));
 			break;
 		default:
 			purple_debug_error("gg", "strange event: %d\n", ev->type);
@@ -1935,16 +1935,18 @@ static void ggp_login(PurpleAccount *acc
 
 	address = purple_account_get_string(account, "gg_server", "");
 	if (address && *address) {
+		/* TODO: Make this non-blocking */
 		struct in_addr *addr = gg_gethostbyname(address);
 
 		purple_debug_info("gg", "Using gg server given by user (%s)\n", address);
 
 		if (addr == NULL) {
-			purple_debug_error("gg", "gg_gethostbyname returned error (%d): %s\n",
-			                   errno, g_strerror(errno));
+			gchar *tmp = g_strdup_printf(_("Unable to resolve hostname '%s': %s"),
+					address, g_strerror(errno));
 			purple_connection_error_reason(gc,
 				PURPLE_CONNECTION_ERROR_NETWORK_ERROR, /* should this be a settings error? */
-				_("Unable to resolve server"));
+				tmp);
+			g_free(tmp);
 			return;
 		}
 
@@ -1957,7 +1959,7 @@ static void ggp_login(PurpleAccount *acc
 	if (info->session == NULL) {
 		purple_connection_error_reason (gc,
 			PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
-			_("Connection failed."));
+			_("Connection failed"));
 		g_free(glp);
 		return;
 	}
@@ -2332,7 +2334,7 @@ static void ggp_keepalive(PurpleConnecti
 				"or gg_session is not correct\n");
 		purple_connection_error_reason (gc,
 			PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
-			_("Not connected to the server."));
+			_("Not connected to the server"));
 	}
 }
 


More information about the Commits mailing list