From: mlichvar Date: Wed, 23 Jan 2008 16:18:46 +0000 (+0000) Subject: - support --disable-nls option (patch by Natanael Copa) X-Git-Tag: r0-52-8~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=970ce9d589c4e4a088f3acd12b392a12c1f15a05;p=thirdparty%2Fnewt.git - support --disable-nls option (patch by Natanael Copa) --- diff --git a/configure.ac b/configure.ac index 74b525f..42a667a 100644 --- a/configure.ac +++ b/configure.ac @@ -35,6 +35,12 @@ if test "x$with_gpm_support" = "xyes"; then AC_DEFINE([USE_GPM], 1, [Define to 1 if GPM support is enabled]) fi +AC_ARG_ENABLE([nls], [ --disable-nls compile without NLS support]) + +if test "x$enable_nls" != "xno"; then + AC_DEFINE([ENABLE_NLS], 1, [Define to 1 if NLS support is enabled]) +fi + AC_CONFIG_FILES([Makefile]) AC_OUTPUT diff --git a/newt.spec b/newt.spec index b4c9785..ada4b16 100644 --- a/newt.spec +++ b/newt.spec @@ -89,6 +89,7 @@ rm -rf $RPM_BUILD_ROOT %changelog - enable slang utf8 mode (#425992) +- support --disable-nls option (patch by Natanael Copa) - redraw screen when using entry in euc encodings - add back support for list of Entries in EntryWindow prompts in snack - fix segfault in whiptail when no entry is selected in radiolist diff --git a/nls.h b/nls.h index 7becf84..a803105 100644 --- a/nls.h +++ b/nls.h @@ -6,8 +6,14 @@ # include +#ifdef ENABLE_NLS # include # define _(Text) gettext (Text) +#else +# define _(Text) (Text) +# define dgettext(Package, String) (String) +#endif + # ifdef gettext_noop # define N_(String) gettext_noop (String) # else diff --git a/whiptail.c b/whiptail.c index 135a5a7..ec04d02 100644 --- a/whiptail.c +++ b/whiptail.c @@ -390,9 +390,11 @@ int main(int argc, const char ** argv) { { 0, 0, 0, 0, 0 } }; +#ifdef ENABLE_NLS setlocale (LC_ALL, ""); bindtextdomain (PACKAGE, LOCALEDIR); textdomain (PACKAGE); +#endif optCon = poptGetContext("whiptail", argc, argv, optionsTable, 0);