|
@@ -35,6 +35,7 @@
|
|
|
#include <poll.h>
|
|
#include <poll.h>
|
|
|
#include <signal.h>
|
|
#include <signal.h>
|
|
|
#include <getopt.h>
|
|
#include <getopt.h>
|
|
|
|
|
+#include <libintl.h>
|
|
|
|
|
|
|
|
#include <klist.h>
|
|
#include <klist.h>
|
|
|
#include <vcc/vcc.h>
|
|
#include <vcc/vcc.h>
|
|
@@ -42,7 +43,8 @@
|
|
|
#include <vcc/robot.h>
|
|
#include <vcc/robot.h>
|
|
|
#include <vcc/plugin.h>
|
|
#include <vcc/plugin.h>
|
|
|
#include <vcc/pretty.h>
|
|
#include <vcc/pretty.h>
|
|
|
-#include <vcc/defserv.h>
|
|
|
|
|
|
|
+#include <vcc/defserv.h>
|
|
|
|
|
+#include <vcc/config.h>
|
|
|
|
|
|
|
|
|
|
|
|
|
/* we tried to use libreadline, but after using that, we feel strange
|
|
/* we tried to use libreadline, but after using that, we feel strange
|
|
@@ -67,6 +69,8 @@ int init_socket(const char *server_addr, int server_port);
|
|
|
|
|
|
|
|
int fd;
|
|
int fd;
|
|
|
|
|
|
|
|
|
|
+#define _(s) gettext(s)
|
|
|
|
|
+
|
|
|
/* normally. it belongs to the foreground pgroup, all messages write to terminal. */
|
|
/* normally. it belongs to the foreground pgroup, all messages write to terminal. */
|
|
|
#define MODE_NORMAL 1
|
|
#define MODE_NORMAL 1
|
|
|
/* robot mode. we run in the background pgroup, and give all the messages to the plugin specified. */
|
|
/* robot mode. we run in the background pgroup, and give all the messages to the plugin specified. */
|
|
@@ -145,7 +149,7 @@ static int login(int got_usrname) {
|
|
|
char *passwd;
|
|
char *passwd;
|
|
|
|
|
|
|
|
if (!got_usrname) {
|
|
if (!got_usrname) {
|
|
|
- fprintf(stderr, "login as: ");
|
|
|
|
|
|
|
+ fprintf(stderr, _("login as: "));
|
|
|
scanf("%s", usrname);
|
|
scanf("%s", usrname);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -295,11 +299,14 @@ int main(int argc, char **argv) {
|
|
|
(void) argc;
|
|
(void) argc;
|
|
|
|
|
|
|
|
#ifdef _WIN32
|
|
#ifdef _WIN32
|
|
|
- setlocale(LC_ALL, ".UTF-8");
|
|
|
|
|
|
|
+ setlocale(LC_ALL, "");
|
|
|
#else
|
|
#else
|
|
|
- setlocale(LC_ALL, "C.UTF-8");
|
|
|
|
|
|
|
+ setlocale(LC_ALL, "");
|
|
|
#endif
|
|
#endif
|
|
|
|
|
|
|
|
|
|
+ bindtextdomain("vcc", "lang");
|
|
|
|
|
+ textdomain("vcc");
|
|
|
|
|
+
|
|
|
printf(VCC_VERSION "\n");
|
|
printf(VCC_VERSION "\n");
|
|
|
|
|
|
|
|
got_usrname = parse_args(argc, argv, &port, &ip);
|
|
got_usrname = parse_args(argc, argv, &port, &ip);
|