changeset 4056:4f3fb54ee669

[gaim-migrate @ 4266] some _() and N_()'s from Nicol?s Lichtmaier committer: Tailor Script <tailor@pidgin.im>
author Luke Schierer <lschiere@pidgin.im>
date Tue, 10 Dec 2002 14:19:26 +0000
parents caeef78fd198
children 68d942babdfa
files src/protocols/msn/msn.c src/protocols/oscar/oscar.c
diffstat 2 files changed, 90 insertions(+), 82 deletions(-) [+]
line wrap: on
line diff
--- a/src/protocols/msn/msn.c	Tue Dec 10 02:28:38 2002 +0000
+++ b/src/protocols/msn/msn.c	Tue Dec 10 14:19:26 2002 +0000
@@ -794,7 +794,7 @@
 	g_snprintf(buf, sizeof(buf), "ADD %d AL %s %s\r\n", ++md->trId, map->user, url_encode(map->friend));
 	
 	if (msn_write(md->fd, buf, strlen(buf)) < 0) {
-		hide_login_progress(map->gc, "Write error");
+		hide_login_progress(map->gc, _("Write error"));
 		signoff(map->gc);
 		return;
 	}
@@ -813,7 +813,7 @@
 
 	g_snprintf(buf, sizeof(buf), "ADD %d BL %s %s\r\n", ++md->trId, map->user, url_encode(map->friend));
 	if (msn_write(md->fd, buf, strlen(buf)) < 0) {
-		hide_login_progress(map->gc, "Write error");
+		hide_login_progress(map->gc, _("Write error"));
 		signoff(map->gc);
 		return;
 	}
@@ -912,7 +912,7 @@
 		}
 
 		if (msn_write(md->fd, sendbuf, strlen(sendbuf)) < 0) {
-			hide_login_progress(gc, "Unable to write to server");
+			hide_login_progress(gc, _("Unable to write to server"));
 			signoff(gc);
 		}
 
@@ -1029,7 +1029,7 @@
 
 			g_snprintf(sendbuf, sizeof(sendbuf), "CHG %d NLN\r\n", ++md->trId);
 			if (msn_write(md->fd, sendbuf, strlen(sendbuf)) < 0) {
-				hide_login_progress(gc, "Unable to write");
+				hide_login_progress(gc, _("Unable to write"));
 				signoff(gc);
 				return 0;
 			}
@@ -1045,7 +1045,7 @@
 			else {
 				g_snprintf(sendbuf, sizeof(sendbuf), "BLP %d AL\r\n", ++md->trId);
 				if (msn_write(md->fd, sendbuf, strlen(sendbuf)) < 0) {
-					hide_login_progress(gc, "Unable to write");
+					hide_login_progress(gc, _("Unable to write"));
 					signoff(gc);
 					return 0;
 				}
@@ -1255,7 +1255,7 @@
 		if (!host) {
 			host = strstr(buf, "NS");
 			if (!host) {
-				hide_login_progress(gc, "Got invalid XFR\n");
+				hide_login_progress(gc, _("Got invalid XFR\n"));
 				signoff(gc);
 				return 0;
 			}
@@ -1295,7 +1295,7 @@
 			md->inpa = 0;
 			md->fd = proxy_connect(host, port, msn_login_xfr_connect, gc);
 			if (md->fd < 0) {
-				hide_login_progress(gc, "Error transfering");
+				hide_login_progress(gc, _("Error transfering"));
 				signoff(gc);
 				return 0;
 			}
@@ -1463,14 +1463,14 @@
 		md->fd = source;
 
 	if (md->fd == -1) {
-		hide_login_progress(gc, "Unable to connect to Notification Server");
+		hide_login_progress(gc, _("Unable to connect to Notification Server"));
 		signoff(gc);
 		return;
 	}
 
 	g_snprintf(buf, sizeof(buf), "VER %d MSNP5\r\n", ++md->trId);
 	if (msn_write(md->fd, buf, strlen(buf)) < 0) {
-		hide_login_progress(gc, "Unable to talk to Notification Server");
+		hide_login_progress(gc, _("Unable to talk to Notification Server"));
 		signoff(gc);
 		return;
 	}
@@ -1486,28 +1486,28 @@
 	if (!g_strncasecmp(buf, "VER", 3)) {
 		/* we got VER, check to see that MSNP5 is in the list, then send INF */
 		if (!strstr(buf, "MSNP5")) {
-			hide_login_progress(gc, "Protocol not supported");
+			hide_login_progress(gc, _("Protocol not supported"));
 			signoff(gc);
 			return 0;
 		}
 
 		g_snprintf(sendbuf, sizeof(sendbuf), "INF %d\r\n", ++md->trId);
 		if (msn_write(md->fd, sendbuf, strlen(sendbuf)) < 0) {
-			hide_login_progress(gc, "Unable to request INF\n");
+			hide_login_progress(gc, _("Unable to request INF\n"));
 			signoff(gc);
 			return 0;
 		}
 	} else if (!g_strncasecmp(buf, "INF", 3)) {
 		/* check to make sure we can use md5 */
 		if (!strstr(buf, "MD5")) {
-			hide_login_progress(gc, "Unable to login using MD5");
+			hide_login_progress(gc, _("Unable to login using MD5"));
 			signoff(gc);
 			return 0;
 		}
 
 		g_snprintf(sendbuf, sizeof(sendbuf), "USR %d MD5 I %s\r\n", ++md->trId, gc->username);
 		if (msn_write(md->fd, sendbuf, strlen(sendbuf)) < 0) {
-			hide_login_progress(gc, "Unable to send USR\n");
+			hide_login_progress(gc, _("Unable to send USR\n"));
 			signoff(gc);
 			return 0;
 		}
@@ -1530,7 +1530,7 @@
 
 			g_snprintf(sendbuf, sizeof(sendbuf), "SYN %d 0\r\n", ++md->trId);
 			if (msn_write(md->fd, sendbuf, strlen(sendbuf)) < 0) {
-				hide_login_progress(gc, "Unable to write");
+				hide_login_progress(gc, _("Unable to write"));
 				signoff(gc);
 				return 0;
 			}
@@ -1571,7 +1571,7 @@
 		int i = 0;
 
 		if (!host) {
-			hide_login_progress(gc, "Got invalid XFR\n");
+			hide_login_progress(gc, _("Got invalid XFR\n"));
 			signoff(gc);
 			return 0;
 		}
@@ -1592,7 +1592,7 @@
 		md->fd = proxy_connect(host, port, msn_login_xfr_connect, gc);
 		md->sl = time(NULL);
 		if (md->fd < 0) {
-			hide_login_progress(gc, "Unable to transfer");
+			hide_login_progress(gc, _("Unable to transfer"));
 			signoff(gc);
 		}
 		return 0;
@@ -1600,7 +1600,7 @@
 		if (isdigit(*buf))
 			hide_login_progress(gc, handle_errcode(buf, FALSE));
 		else
-			hide_login_progress(gc, "Unable to parse message");
+			hide_login_progress(gc, _("Unable to parse message"));
 		signoff(gc);
 		return 0;
 	}
@@ -1784,7 +1784,7 @@
 	} else if (strcmp(who, gc->username)) {
 		g_snprintf(buf, MSN_BUF_LEN, "XFR %d SB\r\n", ++md->trId);
 		if (msn_write(md->fd, buf, strlen(buf)) < 0) {
-			hide_login_progress(gc, "Write error");
+			hide_login_progress(gc, _("Write error"));
 			signoff(gc);
 			return 1;
 		}
@@ -1902,7 +1902,7 @@
 
 	g_snprintf(buf, sizeof(buf), "CHG %d %s\r\n", ++md->trId, away);
 	if (msn_write(md->fd, buf, strlen(buf)) < 0) {
-		hide_login_progress(gc, "Write error");
+		hide_login_progress(gc, _("Write error"));
 		signoff(gc);
 		return;
 	}
@@ -1920,7 +1920,7 @@
 	else
 		g_snprintf(buf, sizeof(buf), "CHG %d NLN\r\n", ++md->trId);
 	if (msn_write(md->fd, buf, strlen(buf)) < 0) {
-		hide_login_progress(gc, "Write error");
+		hide_login_progress(gc, _("Write error"));
 		signoff(gc);
 		return;
 	}
@@ -1943,19 +1943,19 @@
 {
 	switch (s) {
 		case MSN_BUSY :
-			return "Busy";
+			return _("Busy");
 		case MSN_BRB :
-			return "Be right back";
+			return _("Be right back");
 		case MSN_AWAY :
-			return "Away from the computer";
+			return _("Away from the computer");
 		case MSN_PHONE :
-			return "On the phone";
+			return _("On the phone");
 		case MSN_LUNCH :
-			return "Out to lunch";
+			return _("Out to lunch");
 		case MSN_IDLE :
-			return "Idle";
+			return _("Idle");
 		default:
-			return "Available";
+			return _("Available");
 	}
 }
 
@@ -2020,7 +2020,7 @@
 
 	g_snprintf(buf, sizeof(buf), "ADD %d FL %s %s\r\n", ++md->trId, who, who);
 	if (msn_write(md->fd, buf, strlen(buf)) < 0) {
-		hide_login_progress(gc, "Write error");
+		hide_login_progress(gc, _("Write error"));
 		signoff(gc);
 		return;
 	}
@@ -2033,7 +2033,7 @@
 
 	g_snprintf(buf, sizeof(buf), "REM %d FL %s\r\n", ++md->trId, who);
 	if (msn_write(md->fd, buf, strlen(buf)) < 0) {
-		hide_login_progress(gc, "Write error");
+		hide_login_progress(gc, _("Write error"));
 		signoff(gc);
 		return;
 	}
@@ -2059,7 +2059,7 @@
 	g_snprintf(buf, sizeof(buf), "REA %d %s %s\r\n", ++md->trId, gc->username, url_encode(alias));
 	g_free(alias);
 	if (msn_write(md->fd, buf, strlen(buf)) < 0) {
-		hide_login_progress(gc, "Write error");
+		hide_login_progress(gc, _("Write error"));
 		signoff(gc);
 		return;
 	}
@@ -2089,7 +2089,7 @@
 	GList *m = NULL;
 
 	m = g_list_append(m, _("Set Friendly Name"));
-	m = g_list_append(m, "Reset All Friendly Names");
+	m = g_list_append(m, _("Reset All Friendly Names"));
 
 	return m;
 }
@@ -2109,7 +2109,7 @@
 
 	g_snprintf(buf, sizeof(buf), "PNG\r\n");
 	if (msn_write(md->fd, buf, strlen(buf)) < 0) {
-		hide_login_progress(gc, "Write error");
+		hide_login_progress(gc, _("Write error"));
 		signoff(gc);
 		return;
 	}
@@ -2127,7 +2127,7 @@
 		g_snprintf(buf, sizeof(buf), "BLP %d BL\r\n", ++md->trId);
 
 	if (msn_write(md->fd, buf, strlen(buf)) < 0) {
-		hide_login_progress(gc, "Write error");
+		hide_login_progress(gc, _("Write error"));
 		signoff(gc);
 		return;
 	}
@@ -2162,7 +2162,7 @@
 			}
 			g_snprintf(buf, sizeof(buf), "ADD %d AL %s %s\r\n", ++md->trId, who, who);
 			if (msn_write(md->fd, buf, strlen(buf)) < 0) {
-				hide_login_progress(gc, "Write error");
+				hide_login_progress(gc, _("Write error"));
 				signoff(gc);
 				return;
 			}
@@ -2196,7 +2196,7 @@
 			}
 			g_snprintf(buf, sizeof(buf), "ADD %d BL %s %s\r\n", ++md->trId, who, who);
 			if (msn_write(md->fd, buf, strlen(buf)) < 0) {
-				hide_login_progress(gc, "Write error");
+				hide_login_progress(gc, _("Write error"));
 				signoff(gc);
 				return;
 			}
@@ -2237,14 +2237,14 @@
 		gc->deny = g_slist_remove(gc->deny, dupl);
 		g_snprintf(buf, sizeof(buf), "REM %d BL %s\r\n", ++md->trId, who);
 			if (msn_write(md->fd, buf, strlen(buf)) < 0) {
-				hide_login_progress(gc, "Write error");
+				hide_login_progress(gc, _("Write error"));
 				signoff(gc);
 				return;
 			}
 	}
 	g_snprintf(buf, sizeof(buf), "ADD %d AL %s %s\r\n", ++md->trId, who, who);
 	if (msn_write(md->fd, buf, strlen(buf)) < 0) {
-		hide_login_progress(gc, "Write error");
+		hide_login_progress(gc, _("Write error"));
 		signoff(gc);
 		return;
 	}
@@ -2257,7 +2257,7 @@
 
 	g_snprintf(buf, sizeof(buf), "REM %d AL %s\r\n", ++md->trId, who);
 	if (msn_write(md->fd, buf, strlen(buf)) < 0) {
-		hide_login_progress(gc, "Write error");
+		hide_login_progress(gc, _("Write error"));
 		signoff(gc);
 		return;
 	}
@@ -2265,7 +2265,7 @@
 	g_slist_append(gc->deny, who);
 	g_snprintf(buf, sizeof(buf), "ADD %d BL %s %s\r\n", ++md->trId, who, who);
 	if (msn_write(md->fd, buf, strlen(buf)) < 0) {
-		hide_login_progress(gc, "Write error");
+		hide_login_progress(gc, _("Write error"));
 		signoff(gc);
 		return;
 	}
@@ -2294,7 +2294,7 @@
 		gc->permit = g_slist_remove(gc->permit, dupl);
 		g_snprintf(buf, sizeof(buf), "REM %d AL %s\r\n", ++md->trId, who);
 		if (msn_write(md->fd, buf, strlen(buf)) < 0) {
-			hide_login_progress(gc, "Write error");
+			hide_login_progress(gc, _("Write error"));
 			signoff(gc);
 			return;
 		}
@@ -2303,7 +2303,7 @@
 
 	g_snprintf(buf, sizeof(buf), "ADD %d BL %s %s\r\n", ++md->trId, who, who);
 	if (msn_write(md->fd, buf, strlen(buf)) < 0) {
-		hide_login_progress(gc, "Write error");
+		hide_login_progress(gc, _("Write error"));
 		signoff(gc);
 		return;
 	}
@@ -2316,7 +2316,7 @@
 
 	g_snprintf(buf, sizeof(buf), "REM %d BL %s\r\n", ++md->trId, who);
 	if (msn_write(md->fd, buf, strlen(buf)) < 0) {
-		hide_login_progress(gc, "Write error");
+		hide_login_progress(gc, _("Write error"));
 		signoff(gc);
 		return;
 	}
@@ -2324,7 +2324,7 @@
 	g_slist_append(gc->permit, who);
 	g_snprintf(buf, sizeof(buf), "ADD %d AL %s %s\r\n", ++md->trId, who, who);
 	if (msn_write(md->fd, buf, strlen(buf)) < 0) {
-		hide_login_progress(gc, "Write error");
+		hide_login_progress(gc, _("Write error"));
 		signoff(gc);
 		return;
 	}
--- a/src/protocols/oscar/oscar.c	Tue Dec 10 02:28:38 2002 +0000
+++ b/src/protocols/oscar/oscar.c	Tue Dec 10 14:19:26 2002 +0000
@@ -383,31 +383,31 @@
 static int oscar_sendfile_timeout(aim_session_t *sess, aim_frame_t *fr, ...);
 
 static char *msgerrreason[] = {
-	"Invalid error",
-	"Invalid SNAC",
-	"Rate to host",
-	"Rate to client",
-	"Not logged in",
-	"Service unavailable",
-	"Service not defined",
-	"Obsolete SNAC",
-	"Not supported by host",
-	"Not supported by client",
-	"Refused by client",
-	"Reply too big",
-	"Responses lost",
-	"Request denied",
-	"Busted SNAC payload",
-	"Insufficient rights",
-	"In local permit/deny",
-	"Too evil (sender)",
-	"Too evil (receiver)",
-	"User temporarily unavailable",
-	"No match",
-	"List overflow",
-	"Request ambiguous",
-	"Queue full",
-	"Not while on AOL"
+	N_("Invalid error"),
+	N_("Invalid SNAC"),
+	N_("Rate to host"),
+	N_("Rate to client"),
+	N_("Not logged in"),
+	N_("Service unavailable"),
+	N_("Service not defined"),
+	N_("Obsolete SNAC"),
+	N_("Not supported by host"),
+	N_("Not supported by client"),
+	N_("Refused by client"),
+	N_("Reply too big"),
+	N_("Responses lost"),
+	N_("Request denied"),
+	N_("Busted SNAC payload"),
+	N_("Insufficient rights"),
+	N_("In local permit/deny"),
+	N_("Too evil (sender)"),
+	N_("Too evil (receiver)"),
+	N_("User temporarily unavailable"),
+	N_("No match"),
+	N_("List overflow"),
+	N_("Request ambiguous"),
+	N_("Queue full"),
+	N_("Not while on AOL")
 };
 static int msgerrreasonlen = 25;
 
@@ -794,6 +794,7 @@
 	debug_printf("inside auth_resp (Screen name: %s)\n", info->sn);
 
 	if (info->errorcode || !info->bosip || !info->cookie) {
+		char buf[256];
 		switch (info->errorcode) {
 		case 0x05:
 			/* Incorrect nick/password */
@@ -815,7 +816,8 @@
 			break;
 		case 0x1c:
 			/* client too old */
-			hide_login_progress(gc, _("The client version you are using is too old. Please upgrade at " WEBSITE));
+			g_snprintf(buf, sizeof(buf), _("The client version you are using is too old. Please upgrade at %s"), WEBSITE);
+			hide_login_progress(gc, buf);
 			plugin_event(event_error, (void *)989, 0, 0, 0);
 			break;
 		default:
@@ -932,9 +934,11 @@
 		in = '\0';
 	}
 	if (in != '\n') {
+		char buf[256];
+		g_snprintf(buf, sizeof(buf), _("You may be disconnected shortly.  You may want to use TOC until "
+			"this is fixed.  Check %s for updates."), WEBSITE);
 		do_error_dialog(_("Gaim was Unable to get a valid AIM login hash."),
-				_("You may be disconnected shortly.  You may want to use TOC until "
-				  "this is fixed.  Check " WEBSITE " for updates."), GAIM_WARNING);
+				buf, GAIM_WARNING);
 		gaim_input_remove(pos->inpa);
 		close(pos->fd);
 		g_free(pos);
@@ -957,9 +961,11 @@
 	char buf[BUF_LONG];
 
 	if (source < 0) {
+		char buf[256];
+		g_snprintf(buf, sizeof(buf), _("You may be disconnected shortly.  You may want to use TOC until "
+			"this is fixed.  Check %s for updates."), WEBSITE);
 		do_error_dialog(_("Gaim was Unable to get a valid AIM login hash."),
-				_("You may be disconnected shortly.  You may want to use TOC until "
-				  "this is fixed.  Check " WEBSITE " for updates."), GAIM_WARNING);
+				buf, GAIM_WARNING);
 		if (pos->modname)
 			g_free(pos->modname);
 		g_free(pos);
@@ -1036,12 +1042,14 @@
 
 	fd = proxy_connect("gaim.sourceforge.net", 80, straight_to_hell, pos);
 	if (fd < 0) {
+		char buf[256];
 		if (pos->modname)
 			g_free(pos->modname);
 		g_free(pos);
+		g_snprintf(buf, sizeof(buf), _("You may be disconnected shortly.  You may want to use TOC until "
+			"this is fixed.  Check %s for updates."), WEBSITE);
 		do_error_dialog(_("Gaim was Unable to get valid login hash."),
-				_("You may be disconnected shortly.  You may want to use TOC until "
-				  "this is fixed.  Check " WEBSITE " for updates."), GAIM_WARNING);
+				 buf, GAIM_WARNING);
 	}
 	pos->fd = fd;
 
@@ -2358,7 +2366,7 @@
 			(reason < msgerrreasonlen) ? msgerrreason[reason] : "unknown");
 
 	m = g_strdup_printf(_("SNAC threw error: %s\n"),
-			reason < msgerrreasonlen ? msgerrreason[reason] : "Unknown error");
+			reason < msgerrreasonlen ? gettext(msgerrreason[reason]) : _("Unknown error"));
 	do_error_dialog(m, NULL, GAIM_ERROR);
 	g_free(m);
 
@@ -2381,7 +2389,7 @@
 	/* If this was a file transfer request, data is a cookie. */
 	if ((oft = find_oft_by_cookie(gc, data))) {
 		transfer_abort(oft->xfer,
-				(reason < msgerrreasonlen) ? msgerrreason[reason] : _("No reason was given."));
+				(reason < msgerrreasonlen) ? gettext(msgerrreason[reason]) : _("No reason was given."));
 
 		oscar_file_transfer_disconnect(sess, oft->conn);
 		return 1;
@@ -2389,7 +2397,7 @@
 
 	/* Data is assumed to be the destination sn. */
 	snprintf(buf, sizeof(buf), _("Your message to %s did not get sent:"), data);
-	do_error_dialog(buf, (reason < msgerrreasonlen) ? msgerrreason[reason] : _("No reason was given."), GAIM_ERROR);
+	do_error_dialog(buf, (reason < msgerrreasonlen) ? gettext(msgerrreason[reason]) : _("No reason was given."), GAIM_ERROR);
 
 	return 1;
 }
@@ -2441,7 +2449,7 @@
 	va_end(ap);
 
 	snprintf(buf, sizeof(buf), _("User information for %s unavailable:"), destn);
-	do_error_dialog(buf, (reason < msgerrreasonlen) ? msgerrreason[reason] : _("No reason was given."), GAIM_ERROR);
+	do_error_dialog(buf, (reason < msgerrreasonlen) ? gettext(msgerrreason[reason]) : _("No reason was given."), GAIM_ERROR);
 
 	return 1;
 }
@@ -3312,7 +3320,7 @@
 	if (!status) {
 		g_snprintf(msg, sizeof(msg), "You should receive an email asking to confirm %s.",
 				gc->username);
-		do_error_dialog("Account Confirmation Requested", msg, GAIM_INFO);
+		do_error_dialog(_("Account Confirmation Requested"), msg, GAIM_INFO);
 	}
 
 	return 1;
@@ -3371,13 +3379,13 @@
 
 	if (sn) {
 		char *dialog_msg = g_strdup_printf(_("Your screen name is currently formated as follows:\n%s"), sn);
-		do_error_dialog("Account Info", dialog_msg, GAIM_INFO);
+		do_error_dialog(_("Account Info"), dialog_msg, GAIM_INFO);
 		g_free(dialog_msg);
 	}
 
 	if (email) {
 		char *dialog_msg = g_strdup_printf(_("The email address for %s is %s"), gc->username, email);
-		do_error_dialog("Account Info", dialog_msg, GAIM_INFO);
+		do_error_dialog(_("Account Info"), dialog_msg, GAIM_INFO);
 		g_free(dialog_msg);
 	}