2 #include "config.h" // for USE_GETTEXT
8 #define gettext(String) String
11 #define _(String) gettext(String)
12 #define gettext_noop(String) String
13 #define N_(String) gettext_noop (String)
15 inline void init_gettext(const char *path) {
17 // don't do this if MSVC compiler is used, it gives an assertion fail
19 setlocale(LC_MESSAGES, "");
21 bindtextdomain(PROJECT_NAME, path);
22 textdomain(PROJECT_NAME);
26 inline wchar_t* chartowchar_t(const char *str)
28 size_t l = strlen(str)+1;
29 wchar_t* nstr = new wchar_t[l];
30 mbstowcs(nstr, str, l);
34 inline wchar_t* wgettext(const char *str)
36 return chartowchar_t(gettext(str));
39 inline void changeCtype(const char *l)
42 ret = setlocale(LC_CTYPE, l);
44 infostream<<"locale could not be set"<<std::endl;
46 infostream<<"locale has been set to:"<<ret<<std::endl;
48 #define GETTEXT_HEADER