]> git.ipfire.org Git - thirdparty/newt.git/commitdiff
- support --disable-nls option (patch by Natanael Copa)
authormlichvar <mlichvar>
Wed, 23 Jan 2008 16:18:46 +0000 (16:18 +0000)
committermlichvar <mlichvar>
Wed, 23 Jan 2008 16:18:46 +0000 (16:18 +0000)
configure.ac
newt.spec
nls.h
whiptail.c

index 74b525f62e0eac4c31f70307c1b4fad3321fe99c..42a667a0d4d1c2f2bdbb844313956d2366e45571 100644 (file)
@@ -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
 
index b4c97856f2c9a28fba550dcda7b9c970307e605a..ada4b16166bfb880509fc69c507d1ddf429aab1f 100644 (file)
--- 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 7becf84084abdc3c91a27d05544c98cf770156b8..a803105d19e1e4c11baf2bf403600ad16388d354 100644 (file)
--- a/nls.h
+++ b/nls.h
@@ -6,8 +6,14 @@
 
 # include <locale.h>
 
+#ifdef ENABLE_NLS
 # include <libintl.h>
 # define _(Text) gettext (Text)
+#else
+# define _(Text) (Text)
+# define dgettext(Package, String) (String)
+#endif
+
 # ifdef gettext_noop
 #  define N_(String) gettext_noop (String)
 # else
index 135a5a7b1a405b1f3f3206cfe787a061d0decf3e..ec04d02a44afaedaf35fc2b47dd33bd33dafad47 100644 (file)
@@ -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);