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
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)
PNG_LIBS := $(shell libpng-config --libs)
ifdef MINGW
-ifndef DISABLE_NLS
+ifneq ($(ENABLE_NLS),0)
INTL_LIBS := -lintl
endif
OGL_LIBS := -lopengl32 -lm
sols : $(SOLS)
locales :
-ifndef DISABLE_NLS
+ifneq ($(ENABLE_NLS),0)
$(MAKE) -C po
endif
void lang_init(const char *domain, const char *default_dir)
{
-#ifndef DISABLE_NLS
+#if ENABLE_NLS
char *dir = getenv("NEVERBALL_LOCALE");
setlocale(LC_ALL, "");
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;
#ifndef LANG_H
#define LANG_H
-#ifndef DISABLE_NLS
+#if ENABLE_NLS
#include <libintl.h>
#define _(String) gettext(String)
#else