aboutsummaryrefslogtreecommitdiff
path: root/src/script/lua_api/l_mainmenu.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/script/lua_api/l_mainmenu.cpp')
-rw-r--r--src/script/lua_api/l_mainmenu.cpp11
1 files changed, 11 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);
}