From 519c2796e52ea933f6de5a490aee1f1ab826ea5e Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sat, 2 Jan 2016 22:54:36 +0300 Subject: Add support for custom NLS (without gettext). Add configure flag --enable-customnls Add empty directory in data/translations/manaplus for suctom translations (po files from /po directory) --- src/utils/gettext.h | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'src/utils/gettext.h') diff --git a/src/utils/gettext.h b/src/utils/gettext.h index 392980fe8..d4b8938b5 100644 --- a/src/utils/gettext.h +++ b/src/utils/gettext.h @@ -34,12 +34,22 @@ #define _(s) (const_cast (gettext(s))) #define N_(s) (const_cast (s)) -#else +#elif defined(ENABLE_CUSTOMNLS) // ENABLE_NLS + +#include "utils/translation/podict.h" + +#define gettext(s) const_cast (mainTranslator->getChar(s)) +#define _(s) const_cast (mainTranslator->getChar(s)) +#define N_(s) (const_cast (s)) +#define ngettext(s1, s2, i1) const_cast (mainTranslator->getChar(s1)) + +#else // ENABLE_NLS + #define gettext(s) (const_cast (s)) #define _(s) (const_cast (s)) #define N_(s) (const_cast (s)) #define ngettext(s1, s2, i1) (const_cast (s1)) -#endif +#endif // ENABLE_NLS #endif // UTILS_GETTEXT_H -- cgit v1.2.3-70-g09d2