# HG changeset patch # User Paul Aurich # Date 1257276443 0 # Node ID 4549c3b5a0b3c1014333d99728fd3a180d86f309 # Parent bcf6944f09d87110d7301f881cd1df098f0c24b6 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. diff -r bcf6944f09d8 -r 4549c3b5a0b3 libpurple/protocols/oscar/oscar.c --- 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; }