From 09a50d0458f46c6129b4bea94502908241b3aed3 Mon Sep 17 00:00:00 2001 From: sapier Date: Wed, 14 Aug 2013 19:22:23 +0200 Subject: Add translation for main menu Add engine.gettext() and remove gettext() calls in guiFormspecMenu.cpp --- src/script/lua_api/l_mainmenu.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/script/lua_api/l_mainmenu.cpp') 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 @@ -980,6 +980,16 @@ int ModApiMainMenu::l_download_file(lua_State *L) return 1; } +/******************************************************************************/ +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) { @@ -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); } -- cgit v1.2.3