From 2b16f8c0d57ec31f5e09a51fc4af8cb13da8e9ee Mon Sep 17 00:00:00 2001 From: Sebastien Helleu Date: Sat, 1 Nov 2003 23:19:01 +0000 Subject: [PATCH] Added #ifdef ENABLE_NLS (do not translate if ./configure --disable-nls) --- src/common/weechat.c | 2 ++ src/common/weechat.h | 26 ++++++++++++++++++++------ weechat/src/common/weechat.c | 2 ++ weechat/src/common/weechat.h | 26 ++++++++++++++++++++------ 4 files changed, 44 insertions(+), 12 deletions(-) diff --git a/src/common/weechat.c b/src/common/weechat.c index 9a31625ff..1fb831987 100644 --- a/src/common/weechat.c +++ b/src/common/weechat.c @@ -230,9 +230,11 @@ main (int argc, char *argv[]) { t_irc_server *ptr_server; + #ifdef ENABLE_NLS setlocale (LC_ALL, ""); bindtextdomain (PACKAGE, LOCALEDIR); textdomain (PACKAGE); + #endif /* pre-initiliaze interface */ gui_pre_init (&argc, &argv); diff --git a/src/common/weechat.h b/src/common/weechat.h index 2e676ca86..7a6c75ca7 100644 --- a/src/common/weechat.h +++ b/src/common/weechat.h @@ -23,13 +23,27 @@ #ifndef __WEECHAT_H #define __WEECHAT_H 1 -#include -#include -#include +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include + +#if defined(ENABLE_NLS) && !defined(_) + #include + #include + #define _(x) gettext(x) + #ifdef gettext_noop + #define N_(string) gettext_noop (string) + #else + #define N_(string) (string) + #endif +#endif +#if !defined(_) + #define _(x) (x) + #define N_(string) (string) +#endif -#define PACKAGE "weechat" -#define _(string) gettext(string) -#define N_(string) (string) #define WEECHAT_COPYRIGHT PACKAGE_NAME " (c) 2003 by Wee Team" #define WEECHAT_WEBSITE "http://weechat.flashtux.org" diff --git a/weechat/src/common/weechat.c b/weechat/src/common/weechat.c index 9a31625ff..1fb831987 100644 --- a/weechat/src/common/weechat.c +++ b/weechat/src/common/weechat.c @@ -230,9 +230,11 @@ main (int argc, char *argv[]) { t_irc_server *ptr_server; + #ifdef ENABLE_NLS setlocale (LC_ALL, ""); bindtextdomain (PACKAGE, LOCALEDIR); textdomain (PACKAGE); + #endif /* pre-initiliaze interface */ gui_pre_init (&argc, &argv); diff --git a/weechat/src/common/weechat.h b/weechat/src/common/weechat.h index 2e676ca86..7a6c75ca7 100644 --- a/weechat/src/common/weechat.h +++ b/weechat/src/common/weechat.h @@ -23,13 +23,27 @@ #ifndef __WEECHAT_H #define __WEECHAT_H 1 -#include -#include -#include +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include + +#if defined(ENABLE_NLS) && !defined(_) + #include + #include + #define _(x) gettext(x) + #ifdef gettext_noop + #define N_(string) gettext_noop (string) + #else + #define N_(string) (string) + #endif +#endif +#if !defined(_) + #define _(x) (x) + #define N_(string) (string) +#endif -#define PACKAGE "weechat" -#define _(string) gettext(string) -#define N_(string) (string) #define WEECHAT_COPYRIGHT PACKAGE_NAME " (c) 2003 by Wee Team" #define WEECHAT_WEBSITE "http://weechat.flashtux.org"