diff --git a/.gitignore b/.gitignore index af4828fb..048d69c1 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,12 @@ version.c openconnect nm-openconnect-auth-dialog Make.config +/po/Makefile +/po/Makefile.in +/po/Makefile.in.in +/po/*.gmo +/po/*.mo +/po/POTFILES +/po/.intltool-merge-cache +/po/stamp-it +/po/openconnect.pot diff --git a/Makefile.am b/Makefile.am index 8f70ecf1..deba8dd9 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,4 +1,7 @@ +if USE_NLS +SUBDIRS = po +endif lib_LTLIBRARIES = libopenconnect.la bin_PROGRAMS = openconnect diff --git a/autogen.sh b/autogen.sh index 885c0dfa..3938fbef 100755 --- a/autogen.sh +++ b/autogen.sh @@ -1,6 +1,7 @@ #!/bin/sh -aclocal && \ - libtoolize --automake --copy --force && \ - automake --foreign --add-missing && \ - autoconf +intltoolize --force --copy --automake && \ + aclocal && \ + libtoolize --automake --copy --force && \ + automake --foreign --add-missing && \ + autoconf diff --git a/configure.ac b/configure.ac index 53027273..012469f7 100644 --- a/configure.ac +++ b/configure.ac @@ -5,6 +5,13 @@ AC_LANG_C AM_INIT_AUTOMAKE([foreign]) m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) +IT_PROG_INTLTOOL +AC_SUBST(GETTEXT_PACKAGE, [openconnect]) +AM_CONDITIONAL(USE_NLS, [test "$USE_NLS" = "yes"]) +if (test "$USE_NLS" = "yes"); then + AC_DEFINE(ENABLE_NLS, 1) +fi + AS_COMPILER_FLAGS(CFLAGS, "-Wall -Wextra @@ -77,4 +84,4 @@ AC_CHECK_LIB(ssl, dtls1_stop_timer, AC_DEFINE(HAVE_DTLS1_STOP_TIMER, [1], [OpenSSL has dtls1_stop_timer() function]), ,,${OPENSSL_LIBS}) -AC_OUTPUT(Makefile openconnect.pc) +AC_OUTPUT(Makefile openconnect.pc po/Makefile.in) diff --git a/main.c b/main.c index 26370074..ca54f947 100644 --- a/main.c +++ b/main.c @@ -236,6 +236,11 @@ int main(int argc, char **argv) char *pidfile = NULL; FILE *fp = NULL; +#ifdef ENABLE_NLS + setlocale(LC_ALL, ""); + textdomain("openconnect"); +#endif + openconnect_init_openssl(); vpninfo = malloc(sizeof(*vpninfo)); diff --git a/openconnect-internal.h b/openconnect-internal.h index 1a660a0b..b03153f7 100644 --- a/openconnect-internal.h +++ b/openconnect-internal.h @@ -39,7 +39,12 @@ #ifdef LIBPROXY_HDR #include LIBPROXY_HDR #endif - +#ifdef ENABLE_NLS +#include +#define _(s) gettext(s) +#else +#define _(s) s +#endif /****************************************************************************/ diff --git a/openconnect.html b/openconnect.html index c308b910..145eb866 100644 --- a/openconnect.html +++ b/openconnect.html @@ -183,6 +183,7 @@

Release Notes / Changelog