Mercurial > pidgin.yaz
comparison src/protocols/oscar/oscar.c @ 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 | 07283934dedd |
children | 2221f6801577 |
comparison
equal
deleted
inserted
replaced
4055:caeef78fd198 | 4056:4f3fb54ee669 |
---|---|
381 static int oscar_sendfile_request(aim_session_t *sess, | 381 static int oscar_sendfile_request(aim_session_t *sess, |
382 struct oscar_file_transfer *oft); | 382 struct oscar_file_transfer *oft); |
383 static int oscar_sendfile_timeout(aim_session_t *sess, aim_frame_t *fr, ...); | 383 static int oscar_sendfile_timeout(aim_session_t *sess, aim_frame_t *fr, ...); |
384 | 384 |
385 static char *msgerrreason[] = { | 385 static char *msgerrreason[] = { |
386 "Invalid error", | 386 N_("Invalid error"), |
387 "Invalid SNAC", | 387 N_("Invalid SNAC"), |
388 "Rate to host", | 388 N_("Rate to host"), |
389 "Rate to client", | 389 N_("Rate to client"), |
390 "Not logged in", | 390 N_("Not logged in"), |
391 "Service unavailable", | 391 N_("Service unavailable"), |
392 "Service not defined", | 392 N_("Service not defined"), |
393 "Obsolete SNAC", | 393 N_("Obsolete SNAC"), |
394 "Not supported by host", | 394 N_("Not supported by host"), |
395 "Not supported by client", | 395 N_("Not supported by client"), |
396 "Refused by client", | 396 N_("Refused by client"), |
397 "Reply too big", | 397 N_("Reply too big"), |
398 "Responses lost", | 398 N_("Responses lost"), |
399 "Request denied", | 399 N_("Request denied"), |
400 "Busted SNAC payload", | 400 N_("Busted SNAC payload"), |
401 "Insufficient rights", | 401 N_("Insufficient rights"), |
402 "In local permit/deny", | 402 N_("In local permit/deny"), |
403 "Too evil (sender)", | 403 N_("Too evil (sender)"), |
404 "Too evil (receiver)", | 404 N_("Too evil (receiver)"), |
405 "User temporarily unavailable", | 405 N_("User temporarily unavailable"), |
406 "No match", | 406 N_("No match"), |
407 "List overflow", | 407 N_("List overflow"), |
408 "Request ambiguous", | 408 N_("Request ambiguous"), |
409 "Queue full", | 409 N_("Queue full"), |
410 "Not while on AOL" | 410 N_("Not while on AOL") |
411 }; | 411 }; |
412 static int msgerrreasonlen = 25; | 412 static int msgerrreasonlen = 25; |
413 | 413 |
414 /* | 414 /* |
415 * This is called to clean up whenever a file transfer is no longer in progress, | 415 * This is called to clean up whenever a file transfer is no longer in progress, |
792 va_end(ap); | 792 va_end(ap); |
793 | 793 |
794 debug_printf("inside auth_resp (Screen name: %s)\n", info->sn); | 794 debug_printf("inside auth_resp (Screen name: %s)\n", info->sn); |
795 | 795 |
796 if (info->errorcode || !info->bosip || !info->cookie) { | 796 if (info->errorcode || !info->bosip || !info->cookie) { |
797 char buf[256]; | |
797 switch (info->errorcode) { | 798 switch (info->errorcode) { |
798 case 0x05: | 799 case 0x05: |
799 /* Incorrect nick/password */ | 800 /* Incorrect nick/password */ |
800 hide_login_progress(gc, _("Incorrect nickname or password.")); | 801 hide_login_progress(gc, _("Incorrect nickname or password.")); |
801 plugin_event(event_error, (void *)980, 0, 0, 0); | 802 plugin_event(event_error, (void *)980, 0, 0, 0); |
813 hide_login_progress(gc, _("You have been connecting and disconnecting too frequently. Wait ten minutes and try again. If you continue to try, you will need to wait even longer.")); | 814 hide_login_progress(gc, _("You have been connecting and disconnecting too frequently. Wait ten minutes and try again. If you continue to try, you will need to wait even longer.")); |
814 plugin_event(event_error, (void *)983, 0, 0, 0); | 815 plugin_event(event_error, (void *)983, 0, 0, 0); |
815 break; | 816 break; |
816 case 0x1c: | 817 case 0x1c: |
817 /* client too old */ | 818 /* client too old */ |
818 hide_login_progress(gc, _("The client version you are using is too old. Please upgrade at " WEBSITE)); | 819 g_snprintf(buf, sizeof(buf), _("The client version you are using is too old. Please upgrade at %s"), WEBSITE); |
820 hide_login_progress(gc, buf); | |
819 plugin_event(event_error, (void *)989, 0, 0, 0); | 821 plugin_event(event_error, (void *)989, 0, 0, 0); |
820 break; | 822 break; |
821 default: | 823 default: |
822 hide_login_progress(gc, _("Authentication Failed")); | 824 hide_login_progress(gc, _("Authentication Failed")); |
823 break; | 825 break; |
930 if (x == 2) | 932 if (x == 2) |
931 break; | 933 break; |
932 in = '\0'; | 934 in = '\0'; |
933 } | 935 } |
934 if (in != '\n') { | 936 if (in != '\n') { |
937 char buf[256]; | |
938 g_snprintf(buf, sizeof(buf), _("You may be disconnected shortly. You may want to use TOC until " | |
939 "this is fixed. Check %s for updates."), WEBSITE); | |
935 do_error_dialog(_("Gaim was Unable to get a valid AIM login hash."), | 940 do_error_dialog(_("Gaim was Unable to get a valid AIM login hash."), |
936 _("You may be disconnected shortly. You may want to use TOC until " | 941 buf, GAIM_WARNING); |
937 "this is fixed. Check " WEBSITE " for updates."), GAIM_WARNING); | |
938 gaim_input_remove(pos->inpa); | 942 gaim_input_remove(pos->inpa); |
939 close(pos->fd); | 943 close(pos->fd); |
940 g_free(pos); | 944 g_free(pos); |
941 return; | 945 return; |
942 } | 946 } |
955 static void straight_to_hell(gpointer data, gint source, GaimInputCondition cond) { | 959 static void straight_to_hell(gpointer data, gint source, GaimInputCondition cond) { |
956 struct pieceofcrap *pos = data; | 960 struct pieceofcrap *pos = data; |
957 char buf[BUF_LONG]; | 961 char buf[BUF_LONG]; |
958 | 962 |
959 if (source < 0) { | 963 if (source < 0) { |
964 char buf[256]; | |
965 g_snprintf(buf, sizeof(buf), _("You may be disconnected shortly. You may want to use TOC until " | |
966 "this is fixed. Check %s for updates."), WEBSITE); | |
960 do_error_dialog(_("Gaim was Unable to get a valid AIM login hash."), | 967 do_error_dialog(_("Gaim was Unable to get a valid AIM login hash."), |
961 _("You may be disconnected shortly. You may want to use TOC until " | 968 buf, GAIM_WARNING); |
962 "this is fixed. Check " WEBSITE " for updates."), GAIM_WARNING); | |
963 if (pos->modname) | 969 if (pos->modname) |
964 g_free(pos->modname); | 970 g_free(pos->modname); |
965 g_free(pos); | 971 g_free(pos); |
966 return; | 972 return; |
967 } | 973 } |
1034 pos->len = len; | 1040 pos->len = len; |
1035 pos->modname = modname ? g_strdup(modname) : NULL; | 1041 pos->modname = modname ? g_strdup(modname) : NULL; |
1036 | 1042 |
1037 fd = proxy_connect("gaim.sourceforge.net", 80, straight_to_hell, pos); | 1043 fd = proxy_connect("gaim.sourceforge.net", 80, straight_to_hell, pos); |
1038 if (fd < 0) { | 1044 if (fd < 0) { |
1045 char buf[256]; | |
1039 if (pos->modname) | 1046 if (pos->modname) |
1040 g_free(pos->modname); | 1047 g_free(pos->modname); |
1041 g_free(pos); | 1048 g_free(pos); |
1049 g_snprintf(buf, sizeof(buf), _("You may be disconnected shortly. You may want to use TOC until " | |
1050 "this is fixed. Check %s for updates."), WEBSITE); | |
1042 do_error_dialog(_("Gaim was Unable to get valid login hash."), | 1051 do_error_dialog(_("Gaim was Unable to get valid login hash."), |
1043 _("You may be disconnected shortly. You may want to use TOC until " | 1052 buf, GAIM_WARNING); |
1044 "this is fixed. Check " WEBSITE " for updates."), GAIM_WARNING); | |
1045 } | 1053 } |
1046 pos->fd = fd; | 1054 pos->fd = fd; |
1047 | 1055 |
1048 return 1; | 1056 return 1; |
1049 } | 1057 } |
2356 | 2364 |
2357 debug_printf("snac threw error (reason 0x%04x: %s)\n", reason, | 2365 debug_printf("snac threw error (reason 0x%04x: %s)\n", reason, |
2358 (reason < msgerrreasonlen) ? msgerrreason[reason] : "unknown"); | 2366 (reason < msgerrreasonlen) ? msgerrreason[reason] : "unknown"); |
2359 | 2367 |
2360 m = g_strdup_printf(_("SNAC threw error: %s\n"), | 2368 m = g_strdup_printf(_("SNAC threw error: %s\n"), |
2361 reason < msgerrreasonlen ? msgerrreason[reason] : "Unknown error"); | 2369 reason < msgerrreasonlen ? gettext(msgerrreason[reason]) : _("Unknown error")); |
2362 do_error_dialog(m, NULL, GAIM_ERROR); | 2370 do_error_dialog(m, NULL, GAIM_ERROR); |
2363 g_free(m); | 2371 g_free(m); |
2364 | 2372 |
2365 return 1; | 2373 return 1; |
2366 } | 2374 } |
2379 va_end(ap); | 2387 va_end(ap); |
2380 | 2388 |
2381 /* If this was a file transfer request, data is a cookie. */ | 2389 /* If this was a file transfer request, data is a cookie. */ |
2382 if ((oft = find_oft_by_cookie(gc, data))) { | 2390 if ((oft = find_oft_by_cookie(gc, data))) { |
2383 transfer_abort(oft->xfer, | 2391 transfer_abort(oft->xfer, |
2384 (reason < msgerrreasonlen) ? msgerrreason[reason] : _("No reason was given.")); | 2392 (reason < msgerrreasonlen) ? gettext(msgerrreason[reason]) : _("No reason was given.")); |
2385 | 2393 |
2386 oscar_file_transfer_disconnect(sess, oft->conn); | 2394 oscar_file_transfer_disconnect(sess, oft->conn); |
2387 return 1; | 2395 return 1; |
2388 } | 2396 } |
2389 | 2397 |
2390 /* Data is assumed to be the destination sn. */ | 2398 /* Data is assumed to be the destination sn. */ |
2391 snprintf(buf, sizeof(buf), _("Your message to %s did not get sent:"), data); | 2399 snprintf(buf, sizeof(buf), _("Your message to %s did not get sent:"), data); |
2392 do_error_dialog(buf, (reason < msgerrreasonlen) ? msgerrreason[reason] : _("No reason was given."), GAIM_ERROR); | 2400 do_error_dialog(buf, (reason < msgerrreasonlen) ? gettext(msgerrreason[reason]) : _("No reason was given."), GAIM_ERROR); |
2393 | 2401 |
2394 return 1; | 2402 return 1; |
2395 } | 2403 } |
2396 | 2404 |
2397 static int gaim_parse_mtn(aim_session_t *sess, aim_frame_t *fr, ...) { | 2405 static int gaim_parse_mtn(aim_session_t *sess, aim_frame_t *fr, ...) { |
2439 reason = (fu16_t)va_arg(ap, unsigned int); | 2447 reason = (fu16_t)va_arg(ap, unsigned int); |
2440 destn = va_arg(ap, char *); | 2448 destn = va_arg(ap, char *); |
2441 va_end(ap); | 2449 va_end(ap); |
2442 | 2450 |
2443 snprintf(buf, sizeof(buf), _("User information for %s unavailable:"), destn); | 2451 snprintf(buf, sizeof(buf), _("User information for %s unavailable:"), destn); |
2444 do_error_dialog(buf, (reason < msgerrreasonlen) ? msgerrreason[reason] : _("No reason was given."), GAIM_ERROR); | 2452 do_error_dialog(buf, (reason < msgerrreasonlen) ? gettext(msgerrreason[reason]) : _("No reason was given."), GAIM_ERROR); |
2445 | 2453 |
2446 return 1; | 2454 return 1; |
2447 } | 2455 } |
2448 | 2456 |
2449 static char *images(int flags) { | 2457 static char *images(int flags) { |
3310 debug_printf("account confirmation returned status 0x%04x (%s)\n", status, | 3318 debug_printf("account confirmation returned status 0x%04x (%s)\n", status, |
3311 status ? "unknown" : "email sent"); | 3319 status ? "unknown" : "email sent"); |
3312 if (!status) { | 3320 if (!status) { |
3313 g_snprintf(msg, sizeof(msg), "You should receive an email asking to confirm %s.", | 3321 g_snprintf(msg, sizeof(msg), "You should receive an email asking to confirm %s.", |
3314 gc->username); | 3322 gc->username); |
3315 do_error_dialog("Account Confirmation Requested", msg, GAIM_INFO); | 3323 do_error_dialog(_("Account Confirmation Requested"), msg, GAIM_INFO); |
3316 } | 3324 } |
3317 | 3325 |
3318 return 1; | 3326 return 1; |
3319 } | 3327 } |
3320 | 3328 |
3369 return 1; | 3377 return 1; |
3370 } | 3378 } |
3371 | 3379 |
3372 if (sn) { | 3380 if (sn) { |
3373 char *dialog_msg = g_strdup_printf(_("Your screen name is currently formated as follows:\n%s"), sn); | 3381 char *dialog_msg = g_strdup_printf(_("Your screen name is currently formated as follows:\n%s"), sn); |
3374 do_error_dialog("Account Info", dialog_msg, GAIM_INFO); | 3382 do_error_dialog(_("Account Info"), dialog_msg, GAIM_INFO); |
3375 g_free(dialog_msg); | 3383 g_free(dialog_msg); |
3376 } | 3384 } |
3377 | 3385 |
3378 if (email) { | 3386 if (email) { |
3379 char *dialog_msg = g_strdup_printf(_("The email address for %s is %s"), gc->username, email); | 3387 char *dialog_msg = g_strdup_printf(_("The email address for %s is %s"), gc->username, email); |
3380 do_error_dialog("Account Info", dialog_msg, GAIM_INFO); | 3388 do_error_dialog(_("Account Info"), dialog_msg, GAIM_INFO); |
3381 g_free(dialog_msg); | 3389 g_free(dialog_msg); |
3382 } | 3390 } |
3383 | 3391 |
3384 return 1; | 3392 return 1; |
3385 } | 3393 } |