# HG changeset patch # User Mark Doliner # Date 1249851419 0 # Node ID 2987756bc600d34d90ff773db2cf49e95075c968 # Parent 4e7b8902da90c81a51e24bdddb7d5def0dc8d70f Make the strings in this file more localizable diff -r 4e7b8902da90 -r 2987756bc600 libpurple/protocols/oscar/clientlogin.c --- a/libpurple/protocols/oscar/clientlogin.c Sun Aug 09 20:34:29 2009 +0000 +++ b/libpurple/protocols/oscar/clientlogin.c Sun Aug 09 20:56:59 2009 +0000 @@ -156,11 +156,15 @@ 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 @@ /* 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 @@ "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 @@ 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 @@ *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 @@ 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 @@ 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 @@ /* 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 @@ 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 @@ 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 @@ 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 @@ 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);