Changed crude "ifdef DISABLE_NLS" semantics in Makefile and share/lang
authorparasti <parasti@78b8d119-cf0a-0410-b17c-f493084dd1d7>
Sun, 28 Oct 2007 17:52:56 +0000 (17:52 +0000)
committerparasti <parasti@78b8d119-cf0a-0410-b17c-f493084dd1d7>
Sun, 28 Oct 2007 17:52:56 +0000 (17:52 +0000)
to   "if  ENABLE_NLS".   To  disable   language  support,   use  "make
ENABLE_NLS=0".

git-svn-id: https://s.snth.net/svn/neverball/trunk@1206 78b8d119-cf0a-0410-b17c-f493084dd1d7

Makefile
share/lang.c
share/lang.h

index 00c84f6..12e67e9 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -18,8 +18,10 @@ ALL_CFLAGS   := $(CFLAGS)
 ALL_CPPFLAGS := $(SDL_CPPFLAGS) $(PNG_CPPFLAGS) -Ishare \
     -DVERSION=\"$(VERSION)\"
 
-ifdef DISABLE_NLS
-    ALL_CPPFLAGS += -DDISABLE_NLS=1
+ifeq ($(ENABLE_NLS),0)
+    ALL_CPPFLAGS += -DENABLE_NLS=0
+else
+    ALL_CPPFLAGS += -DENABLE_NLS=1
 endif
 
 ALL_CPPFLAGS += $(CPPFLAGS)
@@ -30,7 +32,7 @@ SDL_LIBS := $(shell sdl-config --libs)
 PNG_LIBS := $(shell libpng-config --libs)
 
 ifdef MINGW
-ifndef DISABLE_NLS
+ifneq ($(ENABLE_NLS),0)
     INTL_LIBS := -lintl
 endif
     OGL_LIBS  := -lopengl32 -lm
@@ -166,7 +168,7 @@ $(MAPC_TARG) : $(MAPC_OBJS)
 sols : $(SOLS)
 
 locales :
-ifndef DISABLE_NLS
+ifneq ($(ENABLE_NLS),0)
        $(MAKE) -C po
 endif
 
index 94824fc..39d3720 100644 (file)
@@ -23,7 +23,7 @@
 
 void lang_init(const char *domain, const char *default_dir)
 {
-#ifndef DISABLE_NLS
+#if ENABLE_NLS
     char *dir = getenv("NEVERBALL_LOCALE");
 
     setlocale(LC_ALL, "");
@@ -31,12 +31,14 @@ void lang_init(const char *domain, const char *default_dir)
     bindtextdomain(domain, dir ? dir : default_dir);
     bind_textdomain_codeset(domain, "UTF-8");
     textdomain(domain);
+#else
+    return;
 #endif
 }
 
 const char *sgettext(const char *msgid)
 {
-#ifndef DISABLE_NLS
+#if ENABLE_NLS
     const char *msgval = gettext(msgid);
 #else
     const char *msgval = msgid;
index 9d625ef..83983e5 100644 (file)
@@ -15,7 +15,7 @@
 #ifndef LANG_H
 #define LANG_H
 
-#ifndef DISABLE_NLS
+#if ENABLE_NLS
 #include <libintl.h>
 #define _(String)   gettext(String)
 #else