Mercurial > pidgin
comparison src/gtkmain.c @ 13089:b553326bc468
[gaim-migrate @ 15451]
Various i18n improvements from Bj??rn Voigt
committer: Tailor Script <tailor@pidgin.im>
author | Mark Doliner <mark@kingant.net> |
---|---|
date | Wed, 01 Feb 2006 06:07:53 +0000 |
parents | 01e09b601840 |
children | 4f615c9fb63a |
comparison
equal
deleted
inserted
replaced
13088:a91a8a28f61f | 13089:b553326bc468 |
---|---|
170 case SIGHUP: | 170 case SIGHUP: |
171 gaim_debug_warning("sighandler", "Caught signal %d\n", sig); | 171 gaim_debug_warning("sighandler", "Caught signal %d\n", sig); |
172 gaim_connections_disconnect_all(); | 172 gaim_connections_disconnect_all(); |
173 break; | 173 break; |
174 case SIGSEGV: | 174 case SIGSEGV: |
175 fprintf(stderr, segfault_message); | 175 gaim_print_utf8_to_console(stderr, segfault_message); |
176 abort(); | 176 abort(); |
177 break; | 177 break; |
178 case SIGCHLD: | 178 case SIGCHLD: |
179 clean_pid(); | 179 clean_pid(); |
180 signal(SIGCHLD, sighandler); /* restore signal catching on this one! */ | 180 signal(SIGCHLD, sighandler); /* restore signal catching on this one! */ |
305 | 305 |
306 static void | 306 static void |
307 show_usage(const char *name, gboolean terse) | 307 show_usage(const char *name, gboolean terse) |
308 { | 308 { |
309 char *text; | 309 char *text; |
310 char *text_conv; | |
311 GError *error = NULL; | |
312 | |
313 #ifdef HAVE_SETLOCALE | |
314 /* Locale initialization is not complete here. See gtk_init_check() */ | |
315 setlocale(LC_ALL, ""); | |
316 #endif | |
317 | 310 |
318 if (terse) { | 311 if (terse) { |
319 text = g_strdup_printf(_("Gaim %s. Try `%s -h' for more information.\n"), VERSION, name); | 312 text = g_strdup_printf(_("Gaim %s. Try `%s -h' for more information.\n"), VERSION, name); |
320 } else { | 313 } else { |
321 text = g_strdup_printf(_("Gaim %s\n" | 314 text = g_strdup_printf(_("Gaim %s\n" |
327 " -l, --login[=NAME] automatically login (optional argument NAME specifies\n" | 320 " -l, --login[=NAME] automatically login (optional argument NAME specifies\n" |
328 " account(s) to use, separated by commas)\n" | 321 " account(s) to use, separated by commas)\n" |
329 " -v, --version display the current version and exit\n"), VERSION, name); | 322 " -v, --version display the current version and exit\n"), VERSION, name); |
330 } | 323 } |
331 | 324 |
332 /* tries to convert 'text' to users locale */ | 325 gaim_print_utf8_to_console(stdout, text); |
333 text_conv = g_locale_from_utf8(text, -1, NULL, NULL, &error); | |
334 if (text_conv != NULL) { | |
335 puts(text_conv); | |
336 g_free(text_conv); | |
337 } | |
338 /* use 'text' as a fallback */ | |
339 else { | |
340 g_warning("%s\n", error->message); | |
341 g_error_free(error); | |
342 puts(text); | |
343 } | |
344 g_free(text); | 326 g_free(text); |
345 } | 327 } |
346 | 328 |
347 #ifdef HAVE_STARTUP_NOTIFICATION | 329 #ifdef HAVE_STARTUP_NOTIFICATION |
348 static void | 330 static void |
487 bindtextdomain(PACKAGE, LOCALEDIR); | 469 bindtextdomain(PACKAGE, LOCALEDIR); |
488 bind_textdomain_codeset(PACKAGE, "UTF-8"); | 470 bind_textdomain_codeset(PACKAGE, "UTF-8"); |
489 textdomain(PACKAGE); | 471 textdomain(PACKAGE); |
490 #endif | 472 #endif |
491 | 473 |
474 #ifdef HAVE_SETLOCALE | |
475 /* Locale initialization is not complete here. See gtk_init_check() */ | |
476 setlocale(LC_ALL, ""); | |
477 #endif | |
492 | 478 |
493 #if HAVE_SIGNAL_H | 479 #if HAVE_SIGNAL_H |
494 | 480 |
495 #ifndef DEBUG | 481 #ifndef DEBUG |
496 /* We translate this here in case the crash breaks gettext. */ | 482 /* We translate this here in case the crash breaks gettext. */ |
497 segfault_message = g_strdup(_( | 483 segfault_message = g_strdup_printf(_( |
498 "Gaim has segfaulted and attempted to dump a core file.\n" | 484 "Gaim has segfaulted and attempted to dump a core file.\n" |
499 "This is a bug in the software and has happened through\n" | 485 "This is a bug in the software and has happened through\n" |
500 "no fault of your own.\n\n" | 486 "no fault of your own.\n\n" |
501 "It is possible that this bug is already fixed in CVS.\n" | 487 "It is possible that this bug is already fixed in CVS.\n" |
502 "If you can reproduce the crash, please notify the gaim\n" | 488 "If you can reproduce the crash, please notify the gaim\n" |
503 "developers by reporting a bug at\n" | 489 "developers by reporting a bug at\n" |
504 GAIM_WEBSITE "bug.php\n\n" | 490 "%sbug.php\n\n" |
505 "Please make sure to specify what you were doing at the time\n" | 491 "Please make sure to specify what you were doing at the time\n" |
506 "and post the backtrace from the core file. If you do not know\n" | 492 "and post the backtrace from the core file. If you do not know\n" |
507 "how to get the backtrace, please read the instructions at\n" | 493 "how to get the backtrace, please read the instructions at\n" |
508 GAIM_WEBSITE "gdb.php. If you need further\n" | 494 "%sgdb.php. If you need further\n" |
509 "assistance, please IM either SeanEgn or LSchiere (via AIM).\n" | 495 "assistance, please IM either SeanEgn or LSchiere (via AIM).\n" |
510 "Contact information for Sean and Luke on other protocols is at\n" | 496 "Contact information for Sean and Luke on other protocols is at\n" |
511 GAIM_WEBSITE "contactinfo.php.\n" | 497 "%scontactinfo.php.\n"), |
512 )); | 498 GAIM_WEBSITE, GAIM_WEBSITE, GAIM_WEBSITE |
499 ); | |
513 #else | 500 #else |
514 /* Don't mark this for translation. */ | 501 /* Don't mark this for translation. */ |
515 segfault_message = g_strdup( | 502 segfault_message = g_strdup( |
516 "Hi, user. We need to talk.\n" | 503 "Hi, user. We need to talk.\n" |
517 "I think something's gone wrong here. It's probably my fault.\n" | 504 "I think something's gone wrong here. It's probably my fault.\n" |