]> git.lizzy.rs Git - dragonfireclient.git/blobdiff - src/gettext.h
marked strings as translation
[dragonfireclient.git] / src / gettext.h
index 3413f38068220c5538665bd429f50c1a506d6314..f2cb8e471953b4e64634f16c89a90d3b5a1ab860 100644 (file)
 
 inline void init_gettext(const char *path) {
 #if USE_GETTEXT
+       // don't do this if MSVC compiler is used, it gives an assertion fail
+       #ifndef _MSC_VER
+               setlocale(LC_MESSAGES, "");
+       #endif
        bindtextdomain(PROJECT_NAME, path);
        textdomain(PROJECT_NAME);
 #endif
@@ -26,6 +30,11 @@ inline wchar_t* chartowchar_t(const char *str)
        return nstr;
 }
 
+inline wchar_t* wgettext(const char *str)
+{
+       return chartowchar_t(gettext(str));
+}
+
 inline void changeCtype(const char *l)
 {
        char *ret = NULL;