summaryrefslogtreecommitdiff
path: root/src/gettext.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/gettext.h')
-rw-r--r--src/gettext.h14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/gettext.h b/src/gettext.h
index 8ddb95346..493f9b21b 100644
--- a/src/gettext.h
+++ b/src/gettext.h
@@ -1,15 +1,23 @@
-#ifdef USE_GETTEXT
+#include "config.h" // for USE_GETTEXT
+
+#if USE_GETTEXT
#include <libintl.h>
#else
#define gettext(String) String
-#define bindtextdomain(domain, dir) /* */
-#define textdomain(domain) /* */
#endif
#define _(String) gettext(String)
#define gettext_noop(String) String
#define N_(String) gettext_noop (String)
+inline void init_gettext(const char *path) {
+#if USE_GETTEXT
+ setlocale(LC_MESSAGES, "");
+ bindtextdomain(PROJECT_NAME, path);
+ textdomain(PROJECT_NAME);
+#endif
+}
+
inline wchar_t* chartowchar_t(const char *str)
{
size_t l = strlen(str)+1;