mirror of
https://github.com/holub/mame
synced 2025-04-19 23:12:11 +03:00
luaengine: translation support [Carl]
This commit is contained in:
parent
53809fca95
commit
7e75ba4bfa
@ -20,6 +20,8 @@ function lfs.env_replace(str)
|
||||
end
|
||||
return str
|
||||
end
|
||||
|
||||
_G._ = emu.lang_translate
|
||||
local dir = lfs.env_replace(manager:options().entries.pluginspath:value())
|
||||
|
||||
package.path = dir .. "/?.lua;" .. dir .. "/?/init.lua"
|
||||
|
@ -680,7 +680,7 @@ function cheat.startplugin()
|
||||
end,
|
||||
function()
|
||||
return menu_populate()
|
||||
end, "Cheat")
|
||||
end, _("Cheat"))
|
||||
|
||||
emu.register_start(function()
|
||||
if not stop then
|
||||
|
@ -746,6 +746,7 @@ void lua_engine::initialize()
|
||||
* emu.print_info(str) -- output to stderr at info level
|
||||
* emu.print_debug(str) -- output to stderr at debug level
|
||||
* emu.driver_find(driver) -- find and return game_driver for driver
|
||||
* emu.wait(len) -- wait from len within coroutine
|
||||
*/
|
||||
sol::table emu = sol().create_named_table("emu");
|
||||
emu["app_name"] = &emulator_info::get_appname_lower;
|
||||
@ -806,6 +807,7 @@ void lua_engine::initialize()
|
||||
engine->machine().scheduler().timer_set(attotime::from_double(lua_tonumber(L, 1)), timer_expired_delegate(FUNC(lua_engine::resume), engine), 0, L);
|
||||
return lua_yield(L, 0);
|
||||
});
|
||||
emu["lang_translate"] = &lang_translate;
|
||||
|
||||
/*
|
||||
* emu.file([opt] searchpath, flags) - flags can be as in osdcore "OPEN_FLAG_*" or lua style with 'rwc' with addtional c for create *and truncate* (be careful)
|
||||
|
Loading…
Reference in New Issue
Block a user