aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMontandalar <jbis1337@hotmail.com>2019-12-25 05:13:22 +1100
committerSmallJoker <SmallJoker@users.noreply.github.com>2019-12-24 19:13:22 +0100
commit44458896d9097c15c722c5bffb3d72e14962b7ce (patch)
treed8fc8f758a831aba16b40d92478280fec02b9bc6 /src
parent876a15bd7570f4cccf815a1d5e5588525e445cb1 (diff)
downloadminetest-44458896d9097c15c722c5bffb3d72e14962b7ce.tar.gz
minetest-44458896d9097c15c722c5bffb3d72e14962b7ce.tar.bz2
minetest-44458896d9097c15c722c5bffb3d72e14962b7ce.zip
Use appropriate LC_ locale macro for Windows (#9230)
* Wrap LC_ macro in ifdef Windows does not have LC_MESSAGES in locale.h, so use LC_ALL on that platform
Diffstat (limited to 'src')
-rw-r--r--src/script/lua_api/l_client.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/script/lua_api/l_client.cpp b/src/script/lua_api/l_client.cpp
index 4aa7d814d..fba182492 100644
--- a/src/script/lua_api/l_client.cpp
+++ b/src/script/lua_api/l_client.cpp
@@ -230,7 +230,11 @@ int ModApiClient::l_get_node_or_nil(lua_State *L)
int ModApiClient::l_get_language(lua_State *L)
{
+#ifdef _WIN32
+ char *locale = setlocale(LC_ALL, NULL);
+#else
char *locale = setlocale(LC_MESSAGES, NULL);
+#endif
std::string lang = gettext("LANG_CODE");
if (lang == "LANG_CODE")
lang = "";