summaryrefslogtreecommitdiff
path: root/src/utils/gettext.h
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-01-02 22:54:36 +0300
committerAndrei Karas <akaras@inbox.ru>2016-01-03 00:46:28 +0300
commit519c2796e52ea933f6de5a490aee1f1ab826ea5e (patch)
tree01205558a568663d1c1ff67fda39ee84ce4051ec /src/utils/gettext.h
parent2d2bbb2fe5a0dc55cbf5b9616a78500704b6ea65 (diff)
downloadplus-519c2796e52ea933f6de5a490aee1f1ab826ea5e.tar.gz
plus-519c2796e52ea933f6de5a490aee1f1ab826ea5e.tar.bz2
plus-519c2796e52ea933f6de5a490aee1f1ab826ea5e.tar.xz
plus-519c2796e52ea933f6de5a490aee1f1ab826ea5e.zip
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)
Diffstat (limited to 'src/utils/gettext.h')
-rw-r--r--src/utils/gettext.h14
1 files changed, 12 insertions, 2 deletions
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 <char*>(gettext(s)))
#define N_(s) (const_cast <char*>(s))
-#else
+#elif defined(ENABLE_CUSTOMNLS) // ENABLE_NLS
+
+#include "utils/translation/podict.h"
+
+#define gettext(s) const_cast <char*>(mainTranslator->getChar(s))
+#define _(s) const_cast <char*>(mainTranslator->getChar(s))
+#define N_(s) (const_cast <char*>(s))
+#define ngettext(s1, s2, i1) const_cast <char*>(mainTranslator->getChar(s1))
+
+#else // ENABLE_NLS
+
#define gettext(s) (const_cast <char*>(s))
#define _(s) (const_cast <char*>(s))
#define N_(s) (const_cast <char*>(s))
#define ngettext(s1, s2, i1) (const_cast <char*>(s1))
-#endif
+#endif // ENABLE_NLS
#endif // UTILS_GETTEXT_H