changeset 28498:4549c3b5a0b3

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.
author Paul Aurich <paul@darkrain42.org>
date Tue, 03 Nov 2009 19:27:23 +0000
parents bcf6944f09d8
children 4575d8daba12
files libpurple/protocols/oscar/oscar.c
diffstat 1 files changed, 17 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/oscar/oscar.c	Tue Nov 03 19:14:35 2009 +0000
+++ b/libpurple/protocols/oscar/oscar.c	Tue Nov 03 19:27:23 2009 +0000
@@ -3238,7 +3238,7 @@
 #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 @@
 #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;
-
-	buf = g_strdup_printf(_("Unable to send message: %s"), error);
+	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);
+
 	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;
 }