diff libpurple/protocols/gg/gg.c @ 27454:7fd1b4c73310

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
author Mark Doliner <mark@kingant.net>
date Mon, 06 Jul 2009 05:27:08 +0000
parents 959e86c022f7
children ac299d029823
line wrap: on
line diff
--- a/libpurple/protocols/gg/gg.c	Mon Jul 06 05:22:25 2009 +0000
+++ b/libpurple/protocols/gg/gg.c	Mon Jul 06 05:27:08 2009 +0000
@@ -352,14 +352,14 @@
 	    *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 @@
 	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 @@
 	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 @@
 			"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 @@
 		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 @@
 			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 @@
 
 	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 @@
 	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 @@
 				"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"));
 	}
 }