diff options
author | EvidenceB Kidscode <49488517+EvidenceBKidscode@users.noreply.github.com> | 2020-04-25 07:20:00 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-25 07:20:00 +0200 |
commit | cee3c5e73d7af2a876aa76275234ee76e7cb1bbc (patch) | |
tree | 66abf52902be5c4d7ccc7aa40d20ed77a2a263e0 /src/script/lua_api/l_server.cpp | |
parent | 914dbeaa0be4b5ef87506b605ef4e241cd3732dc (diff) | |
download | minetest-cee3c5e73d7af2a876aa76275234ee76e7cb1bbc.tar.gz minetest-cee3c5e73d7af2a876aa76275234ee76e7cb1bbc.tar.bz2 minetest-cee3c5e73d7af2a876aa76275234ee76e7cb1bbc.zip |
Add server side translations capability (#9733)
* Add server side translations capability
Diffstat (limited to 'src/script/lua_api/l_server.cpp')
-rw-r--r-- | src/script/lua_api/l_server.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/script/lua_api/l_server.cpp b/src/script/lua_api/l_server.cpp index 00e849cdf..7137484e8 100644 --- a/src/script/lua_api/l_server.cpp +++ b/src/script/lua_api/l_server.cpp @@ -163,6 +163,7 @@ int ModApiServer::l_get_player_information(lua_State *L) u16 prot_vers; u8 ser_vers,major,minor,patch; std::string vers_string; + std::string lang_code; #define ERET(code) \ if (!(code)) { \ @@ -182,7 +183,7 @@ int ModApiServer::l_get_player_information(lua_State *L) &avg_jitter)) ERET(getServer(L)->getClientInfo(player->getPeerId(), &state, &uptime, &ser_vers, - &prot_vers, &major, &minor, &patch, &vers_string)) + &prot_vers, &major, &minor, &patch, &vers_string, &lang_code)) lua_newtable(L); int table = lua_gettop(L); @@ -237,6 +238,10 @@ int ModApiServer::l_get_player_information(lua_State *L) lua_pushnumber(L, player->formspec_version); lua_settable(L, table); + lua_pushstring(L, "lang_code"); + lua_pushstring(L, lang_code.c_str()); + lua_settable(L, table); + #ifndef NDEBUG lua_pushstring(L,"serialization_version"); lua_pushnumber(L, ser_vers); |