diff -urN rdesktop-1.1.0.org/Makefile rdesktop-1.1.0/Makefile --- rdesktop-1.1.0.org/Makefile Sat Sep 15 21:34:32 2001 +++ rdesktop-1.1.0/Makefile Mon Oct 7 18:45:58 2002 @@ -15,37 +15,46 @@ EPREFIX = $(PREFIX) BINDIR = $(EPREFIX)/bin MANDIR = $(PREFIX)/man +LANGDIR = $(PREFIX)/share/locale RDPOBJ = rdesktop.o tcp.o iso.o mcs.o secure.o licence.o rdp.o orders.o bitmap.o cache.o xwin.o CRYPTOBJ = crypto/rc4_enc.o crypto/rc4_skey.o crypto/md5_dgst.o crypto/sha1dgst.o crypto/bn_exp.o crypto/bn_mul.o crypto/bn_div.o crypto/bn_sqr.o crypto/bn_add.o crypto/bn_shift.o crypto/bn_asm.o crypto/bn_ctx.o crypto/bn_lib.o include Makeconf # local configuration - -rdesktop: $(RDPOBJ) $(CRYPTOBJ) +rdesktop: makeshared $(RDPOBJ) $(CRYPTOBJ) $(CC) $(CFLAGS) -o rdesktop $(RDPOBJ) $(CRYPTOBJ) $(LDDIRS) $(LDLIBS) Makeconf: ./configure -install: installbin +makeshared: + cat rdesktop.h | sed "s/@LANGDIR@/`echo $(LANGDIR) | sed 's/\//!/g'`/" > rdesktop.tmpl + cat rdesktop.tmpl | sed 's/!/\//' > rdesktop.tmpl2 + rm -f rdesktop.h + mv rdesktop.tmpl2 rdesktop.h + +install: installbin installpo installbin: rdesktop - mkdir -p $(BINDIR) - cp rdesktop $(BINDIR) - strip $(BINDIR)/rdesktop - chmod 755 $(BINDIR)/rdesktop + mkdir -p $(DESTDIR)$(BINDIR) + cp rdesktop $(DESTDIR)$(BINDIR) + strip $(DESTDIR)$(BINDIR)/rdesktop + chmod 755 $(DESTDIR)$(BINDIR)/rdesktop installman: rdesktop.1 - mkdir -p $(MANDIR)/man1 - cp rdesktop.1 $(MANDIR)/man1 - chmod 755 $(MANDIR)/man1/rdesktop.1 + mkdir -p $(DESTDIR)$(MANDIR)/man1 + cp rdesktop.1 $(DESTDIR)$(MANDIR)/man1 + chmod 755 $(DESTDIR)$(MANDIR)/man1/rdesktop.1 + +installpo: + ( cd po; chmod 755 ./install.sh; DESTDIR=$(DESTDIR) ./install.sh $(LANGDIR) ) proto: cproto -DMAKE_PROTO -o proto.h *.c clean: - rm -f *.o crypto/*.o *~ rdesktop + rm -f *.tmpl* *.o crypto/*.o *~ rdesktop po/*.mo .SUFFIXES: .SUFFIXES: .c .o diff -urN rdesktop-1.1.0.org/configure rdesktop-1.1.0/configure --- rdesktop-1.1.0.org/configure Sat Sep 15 18:37:12 2001 +++ rdesktop-1.1.0/configure Mon Oct 7 18:45:58 2002 @@ -6,21 +6,30 @@ # echo "# Generated by $0 $*" >Makeconf +[ -n "$CFLAGS" ] && echo "CFLAGS = $CFLAGS" >>Makeconf for arg in $*; do optarg=`echo $arg | sed 's/[-a-z]*=//'` case $arg in --prefix=*) echo "PREFIX = $optarg" >>Makeconf + PRCHK=1 ;; --exec-prefix=*) echo "EPREFIX = $optarg" >>Makeconf + EPRCHK=1 ;; --bindir=*) echo "BINDIR = $optarg" >>Makeconf + BINCHK=1 ;; --mandir=*) echo "MANDIR = $optarg" >>Makeconf + MANCHK=1 + ;; + --langdir=*) + echo "LANGDIR = $optarg" >>Makeconf + LANGCHK=1 ;; --with-openssl*) echo "CFLAGS += -DWITH_OPENSSL" >>Makeconf @@ -42,6 +51,7 @@ echo " --exec-prefix=EPREFIX location for architecture-dependent files" echo " --bindir=BINDIR location for program binaries [EPREFIX/bin]" echo " --mandir=MANDIR location for man pages [PREFIX/man]" + echo " --langdir=LANGDIR location for i18N files [PREFIX/share/locale]" echo echo "Build configuration:" echo " --with-openssl use system OpenSSL libraries for crypto" @@ -53,4 +63,11 @@ esac done +if [ -n "$PRCHK" ]; then + [ -z "$EPRCHK" ] && echo "EPREFIX = \$(PREFIX)" >>Makeconf + [ -z "$BINCHK" ] && echo "BINDIR = \$(EPREFIX)/bin" >>Makeconf + [ -z "$MANCHK" ] && echo "MANDIR = \$(PREFIX)/man" >>Makeconf + [ -z "$LANGCHK" ] && echo "LANGDIR = \$(PREFIX)/share/locale" >>Makeconf +fi + echo "configure complete - now run make" diff -urN rdesktop-1.1.0.org/po/install.sh rdesktop-1.1.0/po/install.sh --- rdesktop-1.1.0.org/po/install.sh Thu Jan 1 09:00:00 1970 +++ rdesktop-1.1.0/po/install.sh Mon Oct 7 18:45:58 2002 @@ -0,0 +1,19 @@ +#!/bin/sh + +if [ "$1" ]; then + TARGET=$1 +else + TARGET=/usr/local/share/locale +fi + +POLIST=`ls | grep \.po$ | sed 's/.po$//'` + +for i in ${POLIST} +do + if [ ! -d "${DESTDIR}${TARGET}/${i}/LC_MESSAGES" ]; then + mkdir -p ${DESTDIR}${TARGET}/${i}/LC_MESSAGES + fi + + msgfmt ${i}.po -o ${i}.mo + install -m644 ${i}.mo ${DESTDIR}${TARGET}/${i}/LC_MESSAGES/rdesktop.mo +done diff -urN rdesktop-1.1.0.org/po/ko.po rdesktop-1.1.0/po/ko.po --- rdesktop-1.1.0.org/po/ko.po Thu Jan 1 09:00:00 1970 +++ rdesktop-1.1.0/po/ko.po Mon Oct 7 18:45:58 2002 @@ -0,0 +1,152 @@ +# rdesktop korean message file. +# Copyright (C) 2002 THE PACKAGE'S COPYRIGHT HOLDER +# JoungKyun Kim , 2002. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: rdesktop 1.1.0\n" +"POT-Creation-Date: 2002-10-05 18:18+0900\n" +"PO-Revision-Date: 2002-10-05 17:24+0900\n" +"Last-Translator: JoungKyun Kim \n" +"Language-Team: OOPS Development Organization \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=EUC-KR\n" +"Content-Transfer-Encoding: 8bit\n" + +#: rdesktop.c:57 +#, c-format +msgid "Usage: %s [options] server\n" +msgstr "»ç¿ë¹ý: %s [¿É¼Ç] ¼­¹ö\n" + +#: rdesktop.c:58 +msgid " -u: user name. Also, use Environment variable\n" +msgstr " -u: À¯Àú À̸§. -u ¿É¼Ç ´ë½Å¿¡ ȯ°æ º¯¼ö\n" + +#: rdesktop.c:59 +msgid " RDESKTOPUSER instead of -u option\n" +msgstr " RDESKTOPUSER ¸¦ »ç¿ëÇÒ ¼ö ÀÖ´Ù.\n" + +#: rdesktop.c:60 +msgid " -d: domain\n" +msgstr " -d: µµ¸ÞÀÎ\n" + +#: rdesktop.c:61 +msgid " -s: shell\n" +msgstr " -s: ½©\n" + +#: rdesktop.c:62 +msgid " -c: working directory\n" +msgstr " -c: ÀÛ¾÷ µð·ºÅ丮\n" + +#: rdesktop.c:63 +msgid " -p: password (autologon)\n" +msgstr " -p: ÆÐ½º¿öµå (ÀÚµ¿ ·Î±×ÀÎ)\n" + +#: rdesktop.c:64 +msgid " -n: client hostname\n" +msgstr " -n: Ŭ¶óÀÌ¾ðÆ® È£½ºÆ®³×ÀÓ\n" + +#: rdesktop.c:65 +msgid " -k: keyboard layout (hex)\n" +msgstr " -k: Űº¸µå ·¹À̾ƿô (hex)\n" + +#: rdesktop.c:66 +msgid " -g: desktop geometry (WxH). Also, use Environemnt\n" +msgstr " -g: µ¥½ºÅ©Å¾ ÇØ»óµµ (³ÐÀÌx³ôÀÌ). -g ¿É¼Ç ´ë½Å¿¡\n" + +#: rdesktop.c:67 +msgid " variable RDESKTOPSIZE instead of -g option\n" +msgstr " ȯ°æ º¯¼ö RDESKTOPSIZE ¸¦ »ç¿ëÇÒ ¼ö ÀÖ´Ù.\n" + +#: rdesktop.c:68 +msgid " -f: full-screen mode\n" +msgstr " -f: Àüüȭ¸é ¸ðµå\n" + +#: rdesktop.c:69 +msgid " -b: force bitmap updates\n" +msgstr " -b: ºñÆ®¸Ê ¾÷µ¥ÀÌÆ®¸¦ °­Çà\n" + +#: rdesktop.c:70 +msgid " -e: disable encryption (French TS)\n" +msgstr " -e: ¾Ïȣȭ ¾ÈÇÔ (French TS)\n" + +#: rdesktop.c:71 +msgid " -m: do not send motion events\n" +msgstr " -m: ¸ð¼Ç À̺¥Æ®¸¦ º¸³»Áö ¾ÊÀ½\n" + +#: rdesktop.c:72 +msgid "" +" -l: do not request licence\n" +"\n" +msgstr "" +" -l: ¶óÀ̼¾½º¸¦ ¿ä±¸ÇÏÁö ¾ÊÀ½\n" +"\n" + +#: rdesktop.c:92 +msgid "rdesktop: A Remote Desktop Protocol client.\n" +msgstr "rdesktop: ¿ø°Ý µ¥½ºÅ©Å¾ ÇÁ·ÎÅäÄÝ Å¬¶óÀ̾ðÆ®.\n" + +#: rdesktop.c:93 +#, c-format +msgid "Version %s. Copyright (C) 1999-2001 Matt Chapman.\n" +msgstr "¹öÀü : %s Copyright (C) 1999-2001 Matt Chapman.\n" + +#: rdesktop.c:94 +msgid "See http://www.rdesktop.org/ for more information.\n" +msgstr "ÂüÁ¶ : http://www.rdesktop.org/\n" + +#: rdesktop.c:95 +msgid "" +"translation: none\n" +"\n" +msgstr "" +"¹ø¿ª : ±èÁ¤±Õ \n" +"\n" + +#: rdesktop.c:133 +msgid "invalid keyboard layout\n" +msgstr "À¯È¿ÇÏÁö ¾ÊÀº Űº¸µå ·¹À̾ƿô\n" + +#: rdesktop.c:145 rdesktop.c:247 +msgid "invalid geometry\n" +msgstr "À¯È¿ÇÏÁö ¾ÊÀº ÇØ»óµµ\n" + +#: rdesktop.c:192 +msgid "Environment variable RDESKTOPUSER is limited 15 charactors.\n" +msgstr "ȯ°æº¯¼ö RDESKTOPUSER ´Â 15 ÀÚº¸´Ù ±æ°Ô ÁöÁ¤ÇÒ ¼ö ¾ø½À´Ï´Ù.\n" + +#: rdesktop.c:203 +msgid "could not determine username, use -u\n" +msgstr "À¯ÀúÀ̸§À» °áÁ¤ÇÒ ¼ö ¾ø½À´Ï´Ù. -u ¿É¼ÇÀ» »ç¿ëÇϽʽÿÀ.\n" + +#: rdesktop.c:215 +msgid "could not determine local hostname, use -n\n" +msgstr "·ÎÄà ȣ½ºÆ®³×ÀÓÀ» °áÁ¤ÇÒ ¼ö ¾ø½À´Ï´Ù. -n ¿É¼ÇÀ» »ç¿ëÇϽʽÿÀ\n" + +#: rdesktop.c:228 +msgid "Password: " +msgstr "ÆÐ½º¿öµå: " + +#: rdesktop.c:231 +msgid "failed to read password\n" +msgstr "ÆÐ½º¿öµå¸¦ Àдµ¥ ½ÇÆÐÇß½À´Ï´Ù.\n" + +#: rdesktop.c:267 +msgid "Connection successful.\n" +msgstr "Á¢¼Ó ¼º°ø.\n" + +#: rdesktop.c:269 +msgid "Disconnecting...\n" +msgstr "Á¢¼Ó ÇØÁ¦...\n" + +#: rdesktop.c:345 +msgid "ERROR: " +msgstr "¿¡·¯: " + +#: rdesktop.c:358 +msgid "NOT IMPLEMENTED: " +msgstr "NOT IMLEMENTED: " + +#~ msgid " -u: user name\n" +#~ msgstr " -u: À¯Àú À̸§\n" diff -urN rdesktop-1.1.0.org/rdesktop.c rdesktop-1.1.0/rdesktop.c --- rdesktop-1.1.0.org/rdesktop.c Sat Sep 15 21:34:32 2001 +++ rdesktop-1.1.0/rdesktop.c Mon Oct 7 18:48:03 2002 @@ -19,6 +19,7 @@ */ #include /* malloc realloc free */ +#include /* compared string */ #include /* va_list va_start va_end */ #include /* read close getuid getgid getpid getppid gethostname */ #include /* open */ @@ -41,24 +42,34 @@ BOOL desktop_save = True; BOOL fullscreen = False; +void i18n_print(void) +{ + setlocale (LC_CTYPE, ""); + setlocale (LC_MESSAGES, ""); + bindtextdomain("rdesktop", LANGUAGEDIR); + textdomain("rdesktop"); +} + /* Display usage information */ static void usage(char *program) { - printf("Usage: %s [options] server\n", program); - printf(" -u: user name\n"); - printf(" -d: domain\n"); - printf(" -s: shell\n"); - printf(" -c: working directory\n"); - printf(" -p: password (autologon)\n"); - printf(" -n: client hostname\n"); - printf(" -k: keyboard layout (hex)\n"); - printf(" -g: desktop geometry (WxH)\n"); - printf(" -f: full-screen mode\n"); - printf(" -b: force bitmap updates\n"); - printf(" -e: disable encryption (French TS)\n"); - printf(" -m: do not send motion events\n"); - printf(" -l: do not request licence\n\n"); + printf( _("Usage: %s [options] server\n"), program); + printf( _(" -u: user name. Also, use Environment variable\n") ); + printf( _(" RDESKTOPUSER instead of -u option\n") ); + printf( _(" -d: domain\n") ); + printf( _(" -s: shell\n") ); + printf( _(" -c: working directory\n") ); + printf( _(" -p: password (autologon)\n") ); + printf( _(" -n: client hostname\n") ); + printf( _(" -k: keyboard layout (hex)\n") ); + printf( _(" -g: desktop geometry (WxH). Also, use Environemnt\n") ); + printf( _(" variable RDESKTOPSIZE instead of -g option\n") ); + printf( _(" -f: full-screen mode\n") ); + printf( _(" -b: force bitmap updates\n") ); + printf( _(" -e: disable encryption (French TS)\n") ); + printf( _(" -m: do not send motion events\n") ); + printf( _(" -l: do not request licence\n\n") ); } /* Client program */ @@ -72,13 +83,16 @@ char directory[32]; char title[32]; struct passwd *pw; - char *server, *p; + char *server, *p, *chkname, *chksize; uint32 flags; int c; - printf("rdesktop: A Remote Desktop Protocol client.\n"); - printf("Version " VERSION ". Copyright (C) 1999-2001 Matt Chapman.\n"); - printf("See http://www.rdesktop.org/ for more information.\n\n"); + i18n_print(); + + printf( _("rdesktop: A Remote Desktop Protocol client.\n") ); + printf( _("Version %s. Copyright (C) 1999-2001 Matt Chapman.\n"), VERSION); + printf( _("See http://www.rdesktop.org/ for more information.\n") ); + printf( _("translation: none\n\n") ); flags = RDP_LOGON_NORMAL; domain[0] = password[0] = shell[0] = directory[0] = 0; @@ -116,7 +130,7 @@ keylayout = strtol(optarg, NULL, 16); if (keylayout == 0) { - error("invalid keyboard layout\n"); + error( _("invalid keyboard layout\n") ); return 1; } break; @@ -128,7 +142,7 @@ if ((width == 0) || (height == 0)) { - error("invalid geometry\n"); + error( _("invalid geometry\n") ); return 1; } break; @@ -171,21 +185,34 @@ if (username[0] == 0) { - pw = getpwuid(getuid()); - if ((pw == NULL) || (pw->pw_name == NULL)) + if ( (chkname = (char *) getenv ("RDESKTOPUSER")) != NULL ) { - error("could not determine username, use -u\n"); - return 1; + if ( strlen(chkname) > 15 ) + { + error( _("Environment variable RDESKTOPUSER is limited 15 charactors.\n") ); + return 1; + } + + STRNCPY(username, chkname, sizeof(username)); } + else + { + pw = getpwuid(getuid()); + if ((pw == NULL) || (pw->pw_name == NULL)) + { + error( _("could not determine username, use -u\n") ); + return 1; + } - STRNCPY(username, pw->pw_name, sizeof(username)); + STRNCPY(username, pw->pw_name, sizeof(username)); + } } if (hostname[0] == 0) { if (gethostname(fullhostname, sizeof(fullhostname)) == -1) { - error("could not determine local hostname, use -n\n"); + error( _("could not determine local hostname, use -n\n") ); return 1; } @@ -193,15 +220,15 @@ if (p != NULL) *p = 0; - STRNCPY(hostname, fullhostname, sizeof(hostname)); + STRNCPY(hostname, fullhostname, sizeof(hostname) ); } if (!strcmp(password, "-")) { - p = getpass("Password: "); + p = getpass( _("Password: ") ); if (p == NULL) { - error("failed to read password\n"); + error( _("failed to read password\n") ); return 0; } STRNCPY(password, p, sizeof(password)); @@ -209,8 +236,23 @@ if ((width == 0) || (height == 0)) { - width = 800; - height = 600; + if ( (chksize = (char *) getenv ("RDESKTOPSIZE")) != NULL ) + { + width = strtol(chksize, &p, 10); + if (*p == 'x') + height = strtol(p+1, NULL, 10); + + if ((width == 0) || (height == 0)) + { + error( _("invalid geometry\n") ); + return 1; + } + } + else + { + width = 800; + height = 600; + } } strcpy(title, "rdesktop - "); @@ -222,9 +264,9 @@ directory)) return 1; - printf("Connection successful.\n"); + printf( _("Connection successful.\n") ); rdp_main_loop(); - printf("Disconnecting...\n"); + printf( _("Disconnecting...\n") ); ui_destroy_window(); } @@ -300,7 +342,7 @@ { va_list ap; - fprintf(stderr, "ERROR: "); + fprintf(stderr, _("ERROR: ") ); va_start(ap, format); vfprintf(stderr, format, ap); @@ -313,7 +355,7 @@ { va_list ap; - fprintf(stderr, "NOT IMPLEMENTED: "); + fprintf(stderr, _("NOT IMPLEMENTED: ") ); va_start(ap, format); vfprintf(stderr, format, ap); diff -urN rdesktop-1.1.0.org/rdesktop.h rdesktop-1.1.0/rdesktop.h --- rdesktop-1.1.0.org/rdesktop.h Fri Sep 14 22:51:37 2001 +++ rdesktop-1.1.0/rdesktop.h Mon Oct 7 18:45:58 2002 @@ -22,6 +22,12 @@ #include #include +/* use gettext */ +#include +#include +#define _(String) gettext (String) +#define LANGUAGEDIR "/usr/share/locale" + #define VERSION "1.1.0" #ifdef WITH_DEBUG @@ -39,3 +45,5 @@ #ifndef MAKE_PROTO #include "proto.h" #endif + +void i18n_print(void);