cpw.darkrain42.2.6.1: e67b54aa: Make the strings in this file more local...

markdoliner at pidgin.im markdoliner at pidgin.im
Sun Aug 9 17:02:07 EDT 2009


-----------------------------------------------------------------
Revision: e67b54aabe9ebc9c52b091eb993336885ad48209
Ancestor: 7a32e9c1ba38f5383f4ca3e019a9a00503218432
Author: markdoliner at pidgin.im
Date: 2009-08-09T20:56:59
Branch: im.pidgin.cpw.darkrain42.2.6.1
URL: http://d.pidgin.im/viewmtn/revision/info/e67b54aabe9ebc9c52b091eb993336885ad48209

Modified files:
        libpurple/protocols/oscar/clientlogin.c

ChangeLog: 

Make the strings in this file more localizable

-------------- next part --------------
============================================================
--- libpurple/protocols/oscar/clientlogin.c	1222f2616809bea3655bd0d4dfce1f63500a819e
+++ libpurple/protocols/oscar/clientlogin.c	38ada5d8b08e997686b657bca5cb31764c81758a
@@ -156,11 +156,15 @@ static gboolean parse_start_oscar_sessio
 	response_node = xmlnode_from_str(response, response_len);
 	if (response_node == NULL)
 	{
+		char *msg;
 		purple_debug_error("oscar", "startOSCARSession could not parse "
 				"response as XML: %s\n", response);
+		/* Note to translators: %s in this string is a URL */
+		msg = g_strdup_printf(_("Received unexpected response from %s"),
+				URL_START_OSCAR_SESSION);
 		purple_connection_error_reason(gc,
-				PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
-				_("Received unexpected response from " URL_START_OSCAR_SESSION));
+				PURPLE_CONNECTION_ERROR_NETWORK_ERROR, msg);
+		g_free(msg);
 		return FALSE;
 	}
 
@@ -175,11 +179,14 @@ static gboolean parse_start_oscar_sessio
 
 	/* Make sure we have a status code */
 	if (tmp_node == NULL || (tmp = xmlnode_get_data_unescaped(tmp_node)) == NULL) {
+		char *msg;
 		purple_debug_error("oscar", "startOSCARSession response was "
 				"missing statusCode: %s\n", response);
+		msg = g_strdup_printf(_("Received unexpected response from %s"),
+				URL_START_OSCAR_SESSION);
 		purple_connection_error_reason(gc,
-				PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
-				_("Received unexpected response from " URL_START_OSCAR_SESSION));
+				PURPLE_CONNECTION_ERROR_NETWORK_ERROR, msg);
+		g_free(msg);
 		xmlnode_free(response_node);
 		return FALSE;
 	}
@@ -197,10 +204,14 @@ static gboolean parse_start_oscar_sessio
 					  "frequently. Wait ten minutes and try again. If "
 					  "you continue to try, you will need to wait even "
 					  "longer."));
-		else
+		else {
+			char *msg;
+			msg = g_strdup_printf(_("Received unexpected response from %s"),
+					URL_START_OSCAR_SESSION);
 			purple_connection_error_reason(gc,
-					PURPLE_CONNECTION_ERROR_OTHER_ERROR,
-					_("Received unexpected response from " URL_START_OSCAR_SESSION));
+					PURPLE_CONNECTION_ERROR_OTHER_ERROR, msg);
+			g_free(msg);
+		}
 
 		g_free(tmp);
 		xmlnode_free(response_node);
@@ -212,11 +223,14 @@ static gboolean parse_start_oscar_sessio
 	if (data_node == NULL || host_node == NULL ||
 		port_node == NULL || cookie_node == NULL)
 	{
+		char *msg;
 		purple_debug_error("oscar", "startOSCARSession response was missing "
 				"something: %s\n", response);
+		msg = g_strdup_printf(_("Received unexpected response from %s"),
+				URL_START_OSCAR_SESSION);
 		purple_connection_error_reason(gc,
-				PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
-				_("Received unexpected response from " URL_START_OSCAR_SESSION));
+				PURPLE_CONNECTION_ERROR_NETWORK_ERROR, msg);
+		g_free(msg);
 		xmlnode_free(response_node);
 		return FALSE;
 	}
@@ -227,11 +241,14 @@ static gboolean parse_start_oscar_sessio
 	*cookie = xmlnode_get_data_unescaped(cookie_node);
 	if (*host == NULL || **host == '\0' || tmp == NULL || *tmp == '\0' || cookie == NULL || *cookie == '\0')
 	{
+		char *msg;
 		purple_debug_error("oscar", "startOSCARSession response was missing "
 				"something: %s\n", response);
+		msg = g_strdup_printf(_("Received unexpected response from %s"),
+				URL_START_OSCAR_SESSION);
 		purple_connection_error_reason(gc,
-				PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
-				_("Received unexpected response from " URL_START_OSCAR_SESSION));
+				PURPLE_CONNECTION_ERROR_NETWORK_ERROR, msg);
+		g_free(msg);
 		g_free(*host);
 		g_free(tmp);
 		g_free(*cookie);
@@ -261,8 +278,10 @@ static void start_oscar_session_cb(Purpl
 
 	if (error_message != NULL || len == 0) {
 		gchar *tmp;
-		tmp = g_strdup_printf(_("Error requesting " URL_START_OSCAR_SESSION
-				": %s"), error_message);
+		/* Note to translators: The first %s is a URL, the second is an
+		   error message. */
+		tmp = g_strdup_printf(_("Error requesting %s: %s"),
+				URL_START_OSCAR_SESSION, error_message);
 		purple_connection_error_reason(gc,
 				PURPLE_CONNECTION_ERROR_NETWORK_ERROR, tmp);
 		g_free(tmp);
@@ -339,11 +358,14 @@ static gboolean parse_client_login_respo
 	response_node = xmlnode_from_str(response, response_len);
 	if (response_node == NULL)
 	{
+		char *msg;
 		purple_debug_error("oscar", "clientLogin could not parse "
 				"response as XML: %s\n", response);
+		msg = g_strdup_printf(_("Received unexpected response from %s"),
+				URL_CLIENT_LOGIN);
 		purple_connection_error_reason(gc,
-				PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
-				_("Received unexpected response from " URL_CLIENT_LOGIN));
+				PURPLE_CONNECTION_ERROR_NETWORK_ERROR, msg);
+		g_free(msg);
 		return FALSE;
 	}
 
@@ -360,11 +382,14 @@ static gboolean parse_client_login_respo
 
 	/* Make sure we have a status code */
 	if (tmp_node == NULL || (tmp = xmlnode_get_data_unescaped(tmp_node)) == NULL) {
+		char *msg;
 		purple_debug_error("oscar", "clientLogin response was "
 				"missing statusCode: %s\n", response);
+		msg = g_strdup_printf(_("Received unexpected response from %s"),
+				URL_CLIENT_LOGIN);
 		purple_connection_error_reason(gc,
-				PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
-				_("Received unexpected response from " URL_CLIENT_LOGIN));
+				PURPLE_CONNECTION_ERROR_NETWORK_ERROR, msg);
+		g_free(msg);
 		xmlnode_free(response_node);
 		return FALSE;
 	}
@@ -393,10 +418,14 @@ static gboolean parse_client_login_respo
 			purple_connection_error_reason(gc,
 					PURPLE_CONNECTION_ERROR_OTHER_ERROR,
 					_("AOL does not allow your screen name to authenticate here"));
-		} else
+		} else {
+			char *msg;
+			msg = g_strdup_printf(_("Received unexpected response from %s"),
+					URL_CLIENT_LOGIN);
 			purple_connection_error_reason(gc,
-					PURPLE_CONNECTION_ERROR_OTHER_ERROR,
-					_("Received unexpected response from " URL_CLIENT_LOGIN));
+					PURPLE_CONNECTION_ERROR_OTHER_ERROR, msg);
+			g_free(msg);
+		}
 
 		xmlnode_free(response_node);
 		return FALSE;
@@ -407,11 +436,14 @@ static gboolean parse_client_login_respo
 	if (data_node == NULL || secret_node == NULL ||
 		token_node == NULL || tokena_node == NULL)
 	{
+		char *msg;
 		purple_debug_error("oscar", "clientLogin response was missing "
 				"something: %s\n", response);
+		msg = g_strdup_printf(_("Received unexpected response from %s"),
+				URL_CLIENT_LOGIN);
 		purple_connection_error_reason(gc,
-				PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
-				_("Received unexpected response from " URL_CLIENT_LOGIN));
+				PURPLE_CONNECTION_ERROR_NETWORK_ERROR, msg);
+		g_free(msg);
 		xmlnode_free(response_node);
 		return FALSE;
 	}
@@ -422,11 +454,14 @@ static gboolean parse_client_login_respo
 	tmp = xmlnode_get_data_unescaped(hosttime_node);
 	if (*token == NULL || **token == '\0' || *secret == NULL || **secret == '\0' || tmp == NULL || *tmp == '\0')
 	{
+		char *msg;
 		purple_debug_error("oscar", "clientLogin response was missing "
 				"something: %s\n", response);
+		msg = g_strdup_printf(_("Received unexpected response from %s"),
+				URL_CLIENT_LOGIN);
 		purple_connection_error_reason(gc,
-				PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
-				_("Received unexpected response from " URL_CLIENT_LOGIN));
+				PURPLE_CONNECTION_ERROR_NETWORK_ERROR, msg);
+		g_free(msg);
 		g_free(*token);
 		g_free(*secret);
 		g_free(tmp);
@@ -458,8 +493,8 @@ static void client_login_cb(PurpleUtilFe
 
 	if (error_message != NULL || len == 0) {
 		gchar *tmp;
-		tmp = g_strdup_printf(_("Error requesting " URL_CLIENT_LOGIN
-				": %s"), error_message);
+		tmp = g_strdup_printf(_("Error requesting %s: %s"),
+				URL_CLIENT_LOGIN, error_message);
 		purple_connection_error_reason(gc,
 				PURPLE_CONNECTION_ERROR_NETWORK_ERROR, tmp);
 		g_free(tmp);


More information about the Commits mailing list