mirror of
https://github.com/minetest/minetest.git
synced 2025-07-01 23:50:22 +02:00
Add translation for main menu
Add engine.gettext() and remove gettext() calls in guiFormspecMenu.cpp
This commit is contained in:
@ -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);
|
||||
}
|
||||
|
Reference in New Issue
Block a user