pidgin: 8fabd9a1: oscar: Make these errors more translatab...

darkrain42 at pidgin.im darkrain42 at pidgin.im
Tue Nov 3 14:30:37 EST 2009


-----------------------------------------------------------------
Revision: 8fabd9a1bc4e9b709c6854c06ec1526cc8fcb6f9
Ancestor: 517640346d9ad471a4b2219d4b04c62db14a1527
Author: darkrain42 at pidgin.im
Date: 2009-11-03T19:27:23
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/8fabd9a1bc4e9b709c6854c06ec1526cc8fcb6f9

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

ChangeLog: 

oscar: Make these errors more translatable.

I realized that having the untranslated "%s: %s" (error, suberror) probably
wasn't translator friendly.  This is (probably) better, but at the expense
of four strings instead of two.

-------------- next part --------------
============================================================
--- libpurple/protocols/oscar/oscar.c	7aaad1a31b030fd18748c3f00532d6da3f8d194d
+++ libpurple/protocols/oscar/oscar.c	309aed81ec9a1f50cc93a88061bd2d715a56e924
@@ -3238,7 +3238,7 @@ static int purple_parse_msgerr(OscarData
 #endif
 	va_list ap;
 	guint16 reason, errcode;
-	char *data, *reason_str, *buf, *error;
+	char *data, *reason_str, *buf;
 
 	va_start(ap, fr);
 	reason = (guint16)va_arg(ap, unsigned int);
@@ -3263,21 +3263,27 @@ static int purple_parse_msgerr(OscarData
 #endif
 
 	/* Data is assumed to be the destination bn */
+
 	reason_str = g_strdup((reason < msgerrreasonlen) ? _(msgerrreason[reason]) : _("Unknown reason"));
-	if (errcode != 0 && errcode < errcodereasonlen) {
-		error = g_strdup_printf("%s: %s", reason_str, _(errcodereason[errcode]));
-		g_free(reason_str);
-	} else
-		error = reason_str;
+	if (errcode != 0 && errcode < errcodereasonlen)
+		buf = g_strdup_printf(_("Unable to send message: %s (%s)"), reason_str,
+		                      _(errcodereason[errcode]));
+	else
+		buf = g_strdup_printf(_("Unable to send message: %s"), reason_str);
 
-	buf = g_strdup_printf(_("Unable to send message: %s"), error);
 	if (!purple_conv_present_error(data, purple_connection_get_account(gc), buf)) {
 		g_free(buf);
-		buf = g_strdup_printf(_("Unable to send message to %s:"), data ? data : "(unknown)");
-		purple_notify_error(od->gc, NULL, buf, error);
+		if (errcode != 0 && errcode < errcodereasonlen)
+			buf = g_strdup_printf(_("Unable to send message to %s: %s (%s)"),
+			                      data ? data : "(unknown)", reason_str,
+			                      _(errcodereason[errcode]));
+		else
+			buf = g_strdup_printf(_("Unable to send message to %s: %s"),
+			                      data ? data : "(unknown)", reason_str);
+		purple_notify_error(od->gc, NULL, buf, reason_str);
 	}
 	g_free(buf);
-	g_free(error);
+	g_free(reason_str);
 
 	return 1;
 }


More information about the Commits mailing list