aboutsummaryrefslogtreecommitdiff
path: root/advtrains_luaautomation/init.lua
diff options
context:
space:
mode:
Diffstat (limited to 'advtrains_luaautomation/init.lua')
-rw-r--r--advtrains_luaautomation/init.lua19
1 files changed, 14 insertions, 5 deletions
diff --git a/advtrains_luaautomation/init.lua b/advtrains_luaautomation/init.lua
index c51aa71..753340d 100644
--- a/advtrains_luaautomation/init.lua
+++ b/advtrains_luaautomation/init.lua
@@ -2,15 +2,21 @@
-- Lua automation features for advtrains
-- Uses global table 'atlatc' (AdvTrains_LuaATC)
---TODO: re-add localization (if merging localization, discard this hunk please)
-atltrans = function(s,a,...)a={a,...}return s:gsub("@(%d+)",function(n)return a[tonumber(n)]end)end
---Privilege
---Only trusted players should be enabled to build stuff which can break the server.
atlatc = { envs = {}}
-minetest.register_privilege("atlatc", { description = "Player can place and modify LUA ATC components. Grant with care! Allows to execute bad LUA code.", give_to_singleplayer = false, default= false })
+-- Initialize internationalization (using ywang's poconvert)
+advtrains.poconvert.from_flat("advtrains_luaautomation")
+-- ask engine for translator instance, this will load the translation files
+atlatc.translate = core.get_translator("advtrains_luaautomation")
+
+-- Get current translator
+local S = atlatc.translate
+
+--Privilege
+--Only trusted players should be enabled to build stuff which can break the server.
+minetest.register_privilege("atlatc", { description = S("Can place and configure LuaATC components, including execute potentially harmful Lua code"), give_to_singleplayer = false, default= false })
--Size of code input forms in X,Y notation. Must be at least 10x10
atlatc.CODE_FORM_SIZE = "15,12"
@@ -40,6 +46,9 @@ dofile(mp.."/pcnaming.lua")
dofile(mp.."/chatcmds.lua")
+if minetest.settings:get_bool("advtrains_luaautomation_enable_atlac_recipes",false) == true then
+ dofile(mp.."/recipes.lua")
+end
local filename=minetest.get_worldpath().."/advtrains_luaautomation"