-#ifdef GETTEXT_FOUND
-#ifdef USE_GETTEXT
+#if defined(GETTEXT_FOUND) && defined(USE_GETTEXT)
#include <libintl.h>
#else
#define gettext(String) String
-#define bindtextdomain(domain, dir) /* */
-#define textdomain(domain) /* */
-#endif
-#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;
// Create user data directory\r
fs::CreateDir(porting::path_userdata);\r
\r
-#ifdef LC_MESSAGES\r
- setlocale(LC_MESSAGES, "");
- bindtextdomain(PROJECT_NAME, (porting::path_userdata+"/locale").c_str());\r
- textdomain(PROJECT_NAME);\r
-#endif\r
+ init_gettext((porting::path_userdata+"/locale").c_str());\r
\r
// Initialize debug streams\r
#ifdef RUN_IN_PLACE\r