diff options
author | sapier <Sapier at GMX dot net> | 2013-08-14 19:22:23 +0200 |
---|---|---|
committer | PilzAdam <pilzadam@minetest.net> | 2013-08-17 16:01:43 +0200 |
commit | 09a50d0458f46c6129b4bea94502908241b3aed3 (patch) | |
tree | 57a2094750b7d47446a05fe1f8a64a8bca490fe8 /src/script | |
parent | 787b43b2183262a08726434e2597638ad85bfb72 (diff) | |
download | minetest-09a50d0458f46c6129b4bea94502908241b3aed3.tar.gz minetest-09a50d0458f46c6129b4bea94502908241b3aed3.tar.bz2 minetest-09a50d0458f46c6129b4bea94502908241b3aed3.zip |
Add translation for main menu
Add engine.gettext() and remove gettext() calls in guiFormspecMenu.cpp
Diffstat (limited to 'src/script')
-rw-r--r-- | src/script/lua_api/l_mainmenu.cpp | 11 | ||||
-rw-r--r-- | src/script/lua_api/l_mainmenu.h | 2 |
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); |