Mercurial > pidgin
diff src/gaim-remote.c @ 5116:c081a81ee013
[gaim-migrate @ 5479]
Bjoern Voigt writes:
"I have prepared some updates and patches:
1) File i18n5-de.patch
- updated German translation
2) File i18n5.patch
- new files in po/POTFILES.in
- new strings marked for translation
3) File i18n5-accelgroup.patch
- keyboard accelerators for conversation window
4) File i18n5-gaim-remote.patch
- i18n support for gaim-remote.c
- correct handling of "--help" option"
committer: Tailor Script <tailor@pidgin.im>
author | Luke Schierer <lschiere@pidgin.im> |
---|---|
date | Sat, 12 Apr 2003 23:31:41 +0000 |
parents | cf19d8102b34 |
children | 2e78141ec1b5 |
line wrap: on
line diff
--- a/src/gaim-remote.c Sat Apr 12 01:53:54 2003 +0000 +++ b/src/gaim-remote.c Sat Apr 12 23:31:41 2003 +0000 @@ -132,7 +132,7 @@ struct gaim_cui_packet *p = NULL; fd = gaim_connect_to_session(0); if (!fd) { - fprintf(stderr, "Gaim not running (on session 0)\n"); + fprintf(stderr, _("Gaim not running (on session 0)\n")); return 1; } p = cui_packet_new(CUI_TYPE_REMOTE, CUI_REMOTE_URI); @@ -148,7 +148,7 @@ struct gaim_cui_packet *p = NULL; fd = gaim_connect_to_session(0); if (!fd) { - fprintf(stderr, "Gaim not running (on session 0)\n"); + fprintf(stderr, _("Gaim not running (on session 0)\n")); return 1; } p = cui_packet_new(CUI_TYPE_META, CUI_META_QUIT); @@ -158,27 +158,33 @@ return 0; } -void show_longhelp_uri(){ - printf ("\n" - - "Using AIM: URIs:\n" - "Sending an IM to a screenname:\n" - " gaim-remote uri 'aim:goim?screenname=Penguin&message=hello+world'\n" - "In this case, 'Penguin' is the screenname we wish to IM, and 'hello world'\n" - "is the message to be sent. '+' must be used in place of spaces.\n" - "Please note the quoting used above - if you run this from a shell the '&'\n" - "needs to be escaped, or the command will stop at that point.\n" - "Also,the following will just open a conversation window to a screenname,\n" - "with no message:\n" - " gaim-remote uri aim:goim?screenname=Penguin\n\n" - "Joining a chat:\n" - " gaim-remote uri aim:gochat?roomname=PenguinLounge\n" - "...joins the 'PenguinLounge' chat room.\n\n" - "Adding a buddy to your buddy list:\n" - " gaim-remote uri aim:addbuddy?screenname=Penguin\n" - "...prompts you to add 'Penguin' to your buddy list.\n" - ); - return; +void show_longhelp_uri( char *name, char *command){ + if(!strcmp(command, "uri")) { + printf (_("\n" + "Using AIM: URIs:\n" + "Sending an IM to a screenname:\n" + " gaim-remote uri 'aim:goim?screenname=Penguin&message=hello+world'\n" + "In this case, 'Penguin' is the screenname we wish to IM, and 'hello world'\n" + "is the message to be sent. '+' must be used in place of spaces.\n" + "Please note the quoting used above - if you run this from a shell the '&'\n" + "needs to be escaped, or the command will stop at that point.\n" + "Also,the following will just open a conversation window to a screenname,\n" + "with no message:\n" + " gaim-remote uri aim:goim?screenname=Penguin\n\n" + "Joining a chat:\n" + " gaim-remote uri aim:gochat?roomname=PenguinLounge\n" + "...joins the 'PenguinLounge' chat room.\n\n" + "Adding a buddy to your buddy list:\n" + " gaim-remote uri aim:addbuddy?screenname=Penguin\n" + "...prompts you to add 'Penguin' to your buddy list.\n") + ); + } + else if(!strcmp(command, "quit")) { + printf (_("\nClose running copy of Gaim\n")); + } + else { + show_remote_usage(name); + } } /* Work in progress - JBS @@ -190,6 +196,13 @@ int main (int argc, char *argv[]) { +#ifdef ENABLE_NLS + setlocale (LC_ALL, ""); + bindtextdomain(PACKAGE, LOCALEDIR); + bind_textdomain_codeset(PACKAGE, "UTF-8"); + textdomain(PACKAGE); +#endif + if (get_options(argc, argv)) { show_remote_usage(argv[0]); return 0; @@ -198,14 +211,18 @@ if (!strcmp(opts.command, "uri")) { if(opts.help){ - show_longhelp_uri(); + show_longhelp_uri(argv[0], "uri"); }else{ return command_uri(); } /* } else if (!strcmp(opts.command, "info")) { return command_info();*/ } else if (!strcmp(opts.command, "quit")) { - return command_quit(); + if(opts.help){ + show_longhelp_uri(argv[0], "quit"); + }else{ + return command_quit(); + } } else { show_remote_usage(argv[0]); return 1;