aboutsummaryrefslogtreecommitdiff
path: root/src/gettext.h
diff options
context:
space:
mode:
authorNils Dagsson Moskopp <nils@dieweltistgarnichtso.net>2011-07-30 13:28:14 -0700
committerNils Dagsson Moskopp <nils@dieweltistgarnichtso.net>2011-07-30 13:28:14 -0700
commit6199252cdaba1c5014ee3695c9d09a9179acd3d0 (patch)
tree1f5ca72d74a414546f3b45b69801d6677317a38a /src/gettext.h
parent17830c5894fb6c2bbae73c3ce1046f8783b15e04 (diff)
parentc08720bfbaa0c02442f070c23569fcd44b653e9d (diff)
downloadminetest-6199252cdaba1c5014ee3695c9d09a9179acd3d0.tar.gz
minetest-6199252cdaba1c5014ee3695c9d09a9179acd3d0.tar.bz2
minetest-6199252cdaba1c5014ee3695c9d09a9179acd3d0.zip
Merge pull request #39 from SpeedProg/master
fixes for gettext to workaround some bad behaviour of Irrlicht
Diffstat (limited to 'src/gettext.h')
-rw-r--r--src/gettext.h14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/gettext.h b/src/gettext.h
index 493f9b21b..3413f3806 100644
--- a/src/gettext.h
+++ b/src/gettext.h
@@ -1,3 +1,4 @@
+#ifndef GETTEXT_HEADER
#include "config.h" // for USE_GETTEXT
#if USE_GETTEXT
@@ -12,7 +13,6 @@
inline void init_gettext(const char *path) {
#if USE_GETTEXT
- setlocale(LC_MESSAGES, "");
bindtextdomain(PROJECT_NAME, path);
textdomain(PROJECT_NAME);
#endif
@@ -25,3 +25,15 @@ inline wchar_t* chartowchar_t(const char *str)
mbstowcs(nstr, str, l);
return nstr;
}
+
+inline void changeCtype(const char *l)
+{
+ char *ret = NULL;
+ ret = setlocale(LC_CTYPE, l);
+ if(ret == NULL)
+ std::cout<<"locale could not be set"<<std::endl;
+ else
+ std::cout<<"locale has been set to:"<<ret<<std::endl;
+}
+#define GETTEXT_HEADER
+#endif