Skip to content

Commit

Permalink
Use appropriate LC_ locale macro for Windows (#9230)
Browse files Browse the repository at this point in the history
* Wrap LC_ macro in ifdef

Windows does not have LC_MESSAGES in locale.h, so use LC_ALL on that platform
  • Loading branch information
Montandalar authored and SmallJoker committed Dec 24, 2019
1 parent 876a15b commit 4445889
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/script/lua_api/l_client.cpp
Expand Up @@ -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 = "";
Expand Down

0 comments on commit 4445889

Please sign in to comment.