changeset 12556:14e094d7568f

[gaim-migrate @ 14875] Localize the segfault message. This may not make a big difference in the bug reports we get, but I don't see any harm. I also made a couple edits to the message itself. committer: Tailor Script <tailor@pidgin.im>
author Richard Laager <rlaager@wiktel.com>
date Mon, 19 Dec 2005 08:57:38 +0000
parents 8427ef2b4138
children adf79d8ceb2d
files src/gtkmain.c
diffstat 1 files changed, 36 insertions(+), 23 deletions(-) [+]
line wrap: on
line diff
--- a/src/gtkmain.c	Mon Dec 19 08:29:34 2005 +0000
+++ b/src/gtkmain.c	Mon Dec 19 08:57:38 2005 +0000
@@ -156,6 +156,8 @@
 	}
 }
 
+char *segfault_message;
+
 static void
 sighandler(int sig)
 {
@@ -165,29 +167,7 @@
 		gaim_connections_disconnect_all();
 		break;
 	case SIGSEGV:
-#ifndef DEBUG
-		fprintf(stderr, "Gaim has segfaulted and attempted to dump a core file.\n"
-			"This is a bug in the software and has happened through\n"
-			"no fault of your own.\n\n"
-			"It is possible that this bug is already fixed in CVS.\n"
-			"If you can reproduce the crash, please notify the gaim\n"
-			"maintainers by reporting a bug at\n"
-			GAIM_WEBSITE "bug.php\n\n"
-			"Please make sure to specify what you were doing at the time,\n"
-			"and post the backtrace from the core file. If you do not know\n"
-			"how to get the backtrace, please get instructions at\n"
-			GAIM_WEBSITE "gdb.php. If you need further\n"
-			"assistance, please IM either SeanEgn or LSchiere and\n"
-			"they can help you.\n");
-#else
-		fprintf(stderr, "Hi, user.  We need to talk.\n"
-			"I think something's gone wrong here.  It's probably my fault.\n"
-			"No, really, it's not you... it's me... no no no, I think we get along well\n"
-			"it's just that.... well, I want to see other people.  I... what?!?  NO!  I haven't\n"
-			"been cheating on you!!  How many times do you want me to tell you?!  And for the\n"
-			"last time, it's just a rash!\n");
-		/*g_on_error_query (g_get_prgname());*/
-#endif
+		fprintf(stderr, segfault_message);
 		abort();
 		break;
 	case SIGCHLD:
@@ -493,6 +473,37 @@
 
 
 #if HAVE_SIGNAL_H
+
+#ifndef DEBUG
+		/* We translate this here in case the crash breaks gettext. */
+		segfault_message = g_strdup(_(
+			"Gaim has segfaulted and attempted to dump a core file.\n"
+			"This is a bug in the software and has happened through\n"
+			"no fault of your own.\n\n"
+			"It is possible that this bug is already fixed in CVS.\n"
+			"If you can reproduce the crash, please notify the gaim\n"
+			"developers by reporting a bug at\n"
+			GAIM_WEBSITE "bug.php\n\n"
+			"Please make sure to specify what you were doing at the time\n"
+			"and post the backtrace from the core file.  If you do not know\n"
+			"how to get the backtrace, please read the instructions at\n"
+			GAIM_WEBSITE "gdb.php.  If you need further\n"
+			"assistance, please IM either SeanEgn or LSchiere (via AIM).\n"
+			"Contact information for Sean and Luke on other protocols is at\n"
+			GAIM_WEBSITE "contactinfo.php.\n"
+		));
+#else
+		/* Don't mark this for translation. */
+		segfault_message = g_strdup(
+			"Hi, user.  We need to talk.\n"
+			"I think something's gone wrong here.  It's probably my fault.\n"
+			"No, really, it's not you... it's me... no no no, I think we get along well\n"
+			"it's just that.... well, I want to see other people.  I... what?!?  NO!  I haven't\n"
+			"been cheating on you!!  How many times do you want me to tell you?!  And for the\n"
+			"last time, it's just a rash!\n"
+		);
+#endif
+
 	/* Let's not violate any PLA's!!!! */
 	/* jseymour: whatever the fsck that means */
 	/* Robot101: for some reason things like gdm like to block     *
@@ -708,6 +719,8 @@
 
 	gtk_main();
 
+	g_free(segfault_message);
+
 #ifdef _WIN32
 	wgaim_cleanup();
 #endif