Skip to content

Commit

Permalink
国际化,这次是真的可以用了
Browse files Browse the repository at this point in the history
 Conflicts:
	po/LINGUAS
	po/Makevars
	po/POTFILES.in
	src/i18n.h
	src/mystate.c

 Author:  microcaicai <microcaicai@bfbba66e-6dcc-11de-9c06-37b547990b50>
 Date:  Sun Mar 28 20:37:42 2010 +0000
  • Loading branch information
microcaicai authored and updateing committed Jan 22, 2016
1 parent 8d0185d commit 197d3bf
Show file tree
Hide file tree
Showing 13 changed files with 93 additions and 10 deletions.
4 changes: 3 additions & 1 deletion Makefile.am
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
SUBDIRS = src
ACLOCAL_AMFLAGS = -I m4

SUBDIRS = src po

dist_doc_DATA = README

Expand Down
18 changes: 15 additions & 3 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -48,17 +48,29 @@ AC_ARG_ENABLE([notify], [AC_HELP_STRING([ --disable-notify], [Don't show notific
AS_IF([test "x$enable_notify" = "xno"],
[AC_DEFINE(NO_NOTIFY, [], [Define NO_NOTIFY to disable notification])],
[AC_CHECK_LIB([dl], [dlsym])])

# Checks for typedefs, structures, and compiler characteristics.
AC_TYPE_SIZE_T

# define GETTEXT_* variables
GETTEXT_PACKAGE="$PACKAGE_NAME"
AC_SUBST(GETTEXT_PACKAGE)
AC_SUBST(prefix)
AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE", [Define to the read-only architecture-independent data directory.])

AM_GNU_GETTEXT([external])
AM_GNU_GETTEXT_VERSION(0.16.1)


# Checks for header files.
AC_CHECK_HEADERS([iconv.h arpa/inet.h fcntl.h netinet/in.h stdint.h stdlib.h string.h sys/ioctl.h sys/socket.h sys/time.h unistd.h])

# Checks for typedefs, structures, and compiler characteristics.
AC_TYPE_SIZE_T


# Checks for library functions.
AC_CHECK_FUNCS([atexit memmove memset socket strrchr])

AC_CONFIG_FILES([Makefile src/Makefile])
AC_CONFIG_FILES([Makefile po/Makefile.in src/Makefile])

AC_MSG_RESULT([config result: host($host_os) pcap($with_pcap) notify($enable_notify) encode($enable_encodepass) arp($enable_arp)])
AC_OUTPUT
3 changes: 2 additions & 1 deletion po/LINGUAS
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
en
zh_CN

2 changes: 2 additions & 0 deletions po/POTFILES.in
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# List of source files which contain translatable strings.
src/dlfunc.c
src/mentohust.c
src/mycheck.c
src/myconfig.c
src/myfunc.c
src/myini.c
src/mystate.c
27 changes: 27 additions & 0 deletions po/zh_CN.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#
# <[email protected]>, Inc,P擅, 2010.
msgid ""
msgstr ""
"Project-Id-Version: mentohust 0.3.1\n"
"Report-Msgid-Bugs-To: http://code.google.com/p/mentohust/issues/list\n"
"POT-Creation-Date: 2010-03-29 02:04+0800\n"
"PO-Revision-Date: 2010-03-29 02:03+0800\n"
"Last-Translator: <[email protected]>\n"
"Language-Team: Chinese (simplified)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"

#: src/mentohust.c:77
#, fuzzy, c-format
msgid "!! Failed to capture package, please check network connections!\n"
msgstr "!! ��唳�仃韐伐�霂瑟��亦�蝏��伐�\n"

#: src/mentohust.c:81
msgid "MentoHUST - Error Tips"
msgstr ""

#: src/mentohust.c:81
#, fuzzy
msgid "Failed to capture package, please check network connections!"
msgstr "!! ��唳�仃韐伐�霂瑟��亦�蝏��伐�\n"
6 changes: 6 additions & 0 deletions src/dlfunc.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@
* 邮 箱:[email protected]
* 日 期:2009.11.11
*/

#ifdef HAVE_CONFIG_H
#include "config.h"
#endif

#include "i18n.h"
#include "dlfunc.h"

#ifndef NO_DYLOAD
Expand Down
3 changes: 0 additions & 3 deletions src/dlfunc.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@
#ifndef HUSTMOON_DLFUNC_H
#define HUSTMOON_DLFUNC_H

#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stdio.h>
#include <sys/time.h>

Expand Down
17 changes: 15 additions & 2 deletions src/mentohust.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#define HAVE_ICONV_H
#endif

#include "i18n.h"
#include "myconfig.h"
#include "mystate.h"
#include "myfunc.h"
Expand Down Expand Up @@ -50,6 +51,16 @@ static void showCernetMsg(const u_char *buf); /* 显示赛尔服务器提示信

int main(int argc, char **argv)
{
setlocale(LC_ALL, "");
textdomain(GETTEXT_PACKAGE);

#ifdef G_OS_WIN32
{
char realpath_str[1024];
bindtextdomain(GETTEXT_PACKAGE,realpath(argv[0],realpath_str));
}
#endif

atexit(exit_handle);
initConfig(argc, argv);
signal(SIGALRM, sig_handle); /* 定时器 */
Expand All @@ -63,10 +74,12 @@ int main(int argc, char **argv)
else
switchState(ID_START); /* 开始认证 */
if (-1 == pcap_loop(hPcap, -1, pcap_handle, NULL)) { /* 开始捕获数据包 */
printf("!! 捕获数据包失败,请检查网络连接!\n");
printf(_("!! Failed to capture package, please check network connections!\n"));
//printf("!! 捕获数据包失败,请检查网络连接!\n");
#ifndef NO_NOTIFY
if (showNotify)
show_notify("MentoHUST - 错误提示", "捕获数据包失败,请检查网络连接!");
show_notify(_("MentoHUST - Error Tips"), _("Failed to capture package, please check network connections!"));
//show_notify("MentoHUST - 错误提示", "捕获数据包失败,请检查网络连接!");
#endif
}
exit(EXIT_FAILURE);
Expand Down
5 changes: 5 additions & 0 deletions src/mycheck.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@
* 摘 要:客户端校验算法
* 作 者:kkHAIKE & HustMoon
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif

#include "i18n.h"
#include "mycheck.h"
#include "md5.h"
#include <stdio.h>
Expand Down
1 change: 1 addition & 0 deletions src/myconfig.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ static const char *VERSION = "0.3.1";
static const char *PACKAGE_BUGREPORT = "http://code.google.com/p/mentohust/issues/list";
#endif

#include "i18n.h"
#include "myconfig.h"
#include "myini.h"
#include "myfunc.h"
Expand Down
5 changes: 5 additions & 0 deletions src/myfunc.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@
* 摘 要:认证相关算法及方法
* 作 者:HustMoon@BYHH
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif

#include "i18n.h"
#include "myfunc.h"
#include "md5.h"
#include "mycheck.h"
Expand Down
6 changes: 6 additions & 0 deletions src/myini.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@
* 作 者:HustMoon@BYHH
* 修 改:2009.10.8
*/

#ifdef HAVE_CONFIG_H
#include "config.h"
#endif

#include "i18n.h"
#include "myini.h"
#include <stdio.h>
#include <string.h>
Expand Down
6 changes: 6 additions & 0 deletions src/mystate.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,18 @@
* 邮 箱:[email protected]
*/


/*
* modified by [email protected] 2014
* add NEED_LOGOUT, fix permission problems
* in some secure setuid shebang implemention
*/

#ifdef HAVE_CONFIG_H
#include "config.h"
#endif

#include "i18n.h"
#include "mystate.h"
#include "myfunc.h"
#include "dlfunc.h"
Expand Down

0 comments on commit 197d3bf

Please sign in to comment.