aboutsummaryrefslogtreecommitdiff
path: root/src/script
diff options
context:
space:
mode:
Diffstat (limited to 'src/script')
-rw-r--r--src/script/lua_api/l_mainmenu.cpp11
-rw-r--r--src/script/lua_api/l_mainmenu.h2
2 files changed, 13 insertions, 0 deletions
diff --git a/src/script/lua_api/l_mainmenu.cpp b/src/script/lua_api/l_mainmenu.cpp
index b3ae1f3f1..65676eacd 100644
--- a/src/script/lua_api/l_mainmenu.cpp
+++ b/src/script/lua_api/l_mainmenu.cpp
@@ -981,6 +981,16 @@ int ModApiMainMenu::l_download_file(lua_State *L)
}
/******************************************************************************/
+int ModApiMainMenu::l_gettext(lua_State *L)
+{
+ const char* str = luaL_checkstring(L, 1);
+ str = gettext(str);
+ lua_pushstring(L, str);
+
+ return 1;
+}
+
+/******************************************************************************/
void ModApiMainMenu::Initialize(lua_State *L, int top)
{
API_FCT(update_formspec);
@@ -1013,4 +1023,5 @@ void ModApiMainMenu::Initialize(lua_State *L, int top)
API_FCT(get_modstore_list);
API_FCT(sound_play);
API_FCT(sound_stop);
+ API_FCT(gettext);
}
diff --git a/src/script/lua_api/l_mainmenu.h b/src/script/lua_api/l_mainmenu.h
index 21dd82c68..d0f3d6f72 100644
--- a/src/script/lua_api/l_mainmenu.h
+++ b/src/script/lua_api/l_mainmenu.h
@@ -81,6 +81,8 @@ private:
static int l_sound_stop(lua_State *L);
+ static int l_gettext(lua_State *L);
+
//gui
static int l_show_keys_menu(lua_State *L);