From f885c04e95cf9291330a42ceb0612dd3568ac7c7 Mon Sep 17 00:00:00 2001 From: cheapie Date: Sat, 13 Dec 2025 19:25:48 -0600 Subject: Add translation support and rudimentary Spanish locale --- .gitignore | 2 + callbuttons.lua | 40 ++++-- car.lua | 16 ++- car_glassback.lua | 11 +- car_metal.lua | 17 ++- car_metalglass.lua | 11 +- car_standard.lua | 11 +- chatcommands.lua | 86 ++++++------ controller.lua | 36 ++--- controllerfw.lua | 308 +++++++++++++++++++++++------------------- dbdkiosk.lua | 21 +-- decorations.lua | 30 +++-- digilines.lua | 24 ++-- dispatcher.lua | 30 +++-- dispatcherfw.lua | 146 ++++++++++---------- doors.lua | 50 +++---- drive_entity.lua | 46 ++++--- drive_null.lua | 18 ++- fs1switch.lua | 21 ++- genericswitch.lua | 92 ++++++------- governor.lua | 8 +- laptop.lua | 143 ++++++++++---------- locale/celevator.es.tr | 359 +++++++++++++++++++++++++++++++++++++++++++++++++ locale/template.txt | 359 +++++++++++++++++++++++++++++++++++++++++++++++++ mesecons.lua | 150 +++++++++++---------- pilantern.lua | 56 +++++--- 26 files changed, 1478 insertions(+), 613 deletions(-) create mode 100644 .gitignore create mode 100644 locale/celevator.es.tr create mode 100644 locale/template.txt diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..ffc8a2e --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +i18n.py +locale/*.old diff --git a/callbuttons.lua b/callbuttons.lua index 45e6a40..84ccf12 100644 --- a/callbuttons.lua +++ b/callbuttons.lua @@ -1,5 +1,7 @@ celevator.callbutton = {} +local S = core.get_translator("celevator") + local function makebuttontex(dir,upon,downon,inventory) local tex = "[combine:64x64".. ":0,0=celevator_cabinet_sides.png".. @@ -42,15 +44,20 @@ local function makebuttontex(dir,upon,downon,inventory) return(tex) end +local upname = S("Elevator Up Call Button") +local dnname = S("Elevator Down Call Button") +local bothname = S("Elevator Up and Down Call Buttons") +local onname = S("Elevator Call Button (on state - you hacker you!)") + local validstates = { - {"up",false,false,"Up"}, - {"up",true,false,"Up"}, - {"down",false,false,"Down"}, - {"down",false,true,"Down"}, - {"both",false,false,"Up and Down"}, - {"both",true,false,"Up and Down"}, - {"both",false,true,"Up and Down"}, - {"both",true,true,"Up and Down"}, + {"up",false,false,upname}, + {"up",true,false,onname}, + {"down",false,false,dnname}, + {"down",false,true,onname}, + {"both",false,false,bothname}, + {"both",true,false,onname}, + {"both",false,true,onname}, + {"both",true,true,onname}, } function celevator.callbutton.setlight(pos,dir,newstate) @@ -134,7 +141,7 @@ for _,state in ipairs(validstates) do light = light + 5 end local idle = not (state[2] or state[3]) - local description = string.format("Elevator %s Call Button%s%s",state[4],(state[1] == "both" and "s" or ""),(idle and "" or " (on state, you hacker you!)")) + local description = state[4] core.register_node(nname,{ description = description, groups = { @@ -168,7 +175,14 @@ for _,state in ipairs(validstates) do }, after_place_node = function(pos) local meta = core.get_meta(pos) - meta:set_string("formspec","formspec_version[7]size[8,5]field[0.5,0.5;7,1;carid;Car ID;]field[0.5,2;7,1;landing;Landing Number;]button[3,3.5;2,1;save;Save]") + local idmsg = S("Car ID") + local landingmsg = S("Landing Number") + local savemsg = S("Save") + local fs = "formspec_version[7]size[8,5]" + fs = fs.."field[0.5,0.5;7,1;carid;"..idmsg..";]" + fs = fs.."field[0.5,2;7,1;landing;"..landingmsg..";]" + fs = fs.."button[3,3.5;2,1;save;"..savemsg.."]" + meta:set_string("formspec",fs) end, on_receive_fields = function(pos,_,fields) if tonumber(fields.carid) and tonumber(fields.landing) then @@ -251,13 +265,13 @@ core.register_abm({ if not (carid and carid > 0) then return end --Not set up yet local carinfo = core.deserialize(celevator.storage:get_string("car"..carid)) if not carinfo then - meta:set_string("infotext","Error reading car information!\nPlease remove and replace this node.") + meta:set_string("infotext",S("Error reading car information!\nPlease remove and replace this node.")) return end local iscontroller = (carinfo.controllerpos and celevator.controller.iscontroller(carinfo.controllerpos)) local isdispatcher = (carinfo.dispatcherpos and celevator.dispatcher.isdispatcher(carinfo.dispatcherpos)) if not (iscontroller or isdispatcher) then - meta:set_string("infotext","Controller/dispatcher is missing!\nPlease remove and replace this node.") + meta:set_string("infotext",S("Controller/dispatcher is missing!\nPlease remove and replace this node.")) return end local metacarid = 0 @@ -267,7 +281,7 @@ core.register_abm({ metacarid = celevator.get_meta(carinfo.dispatcherpos):get_int("carid") end if metacarid ~= carid then - meta:set_string("infotext","Controller/dispatcher found but with incorrect ID!\nPlease remove and replace this node.") + meta:set_string("infotext",S("Controller/dispatcher found but with incorrect ID!\nPlease remove and replace this node.")) end end, }) diff --git a/car.lua b/car.lua index dace830..94eac20 100644 --- a/car.lua +++ b/car.lua @@ -1,5 +1,7 @@ celevator.car = {} +local S = core.get_translator("celevator") + local function disambiguatecartopbutton(pos,facedir,player) if player and not player.is_fake_player then local eyepos = vector.add(player:get_pos(),vector.add(player:get_eye_offset(),vector.new(0,1.5,0))) @@ -105,7 +107,7 @@ function celevator.car.register(name,defs,size) def.paramtype = "light" def.paramtype2 = "4dir" def.drawtype = "nodebox" - def.description = "Car "..def._position.." (you hacker you!)" + def.description = S("Car (part @1 - you hacker you!)",def._position) def.light_source = 9 def.drop = "" if def._cop then @@ -135,7 +137,7 @@ function celevator.car.register(name,defs,size) if not carinfo then return end local playername = player:get_player_name() if core.is_protected(pos,playername) and not core.check_player_privs(playername,{protection_bypass=true}) then - core.chat_send_player(playername,"You don't have access to these switches.") + core.chat_send_player(playername,S("You don't have access to these switches.")) core.record_protection_violation(pos,playername) return end @@ -218,9 +220,9 @@ function celevator.car.register(name,defs,size) end local hash = core.hash_node_position(pos) local fs = "formspec_version[7]size[6,4]" - fs = fs.."label[0.5,1;Really remove this car?]" - fs = fs.."button_exit[0.5,2;2,1;yes;Yes]" - fs = fs.."button_exit[3,2;2,1;no;No]" + fs = fs.."label[0.5,1;"..S("Really remove this car?").."]" + fs = fs.."button_exit[0.5,2;2,1;yes;"..S("Yes").."]" + fs = fs.."button_exit[3,2;2,1;no;"..S("No").."]" core.show_formspec(playername,string.format("celevator:remove_car_%d",hash),fs) end def.on_timer = function(pos) @@ -308,7 +310,7 @@ core.register_abm({ }) core.register_node("celevator:car_top_box_off",{ - description = "Car-top Inspection Box, Off State (you hacker you!)", + description = S("Car-top Inspection Box, Off State (you hacker you!)"), drop = "", groups = { not_in_creative_inventory = 1, @@ -328,7 +330,7 @@ core.register_node("celevator:car_top_box_off",{ }) core.register_node("celevator:car_top_box_on",{ - description = "Car-top Inspection Box, On State (you hacker you!)", + description = S("Car-top Inspection Box, On State (you hacker you!)"), drop = "", groups = { not_in_creative_inventory = 1, diff --git a/car_glassback.lua b/car_glassback.lua index 1db0903..8569396 100644 --- a/car_glassback.lua +++ b/car_glassback.lua @@ -1,3 +1,5 @@ +local S = core.get_translator("celevator") + local pieces = { { _position = "000", @@ -333,7 +335,7 @@ celevator.car.register("glassback",pieces,vector.new(2,3,3)) core.register_node("celevator:car_glassback",{ - description = "Glass-Back Elevator Car", + description = S("Glass-Back Elevator Car"), paramtype2 = "4dir", buildable_to = true, inventory_image = "celevator_car_glassback_inventory.png", @@ -351,17 +353,18 @@ core.register_node("celevator:car_glassback",{ for x=0,1,1 do for y=0,2,1 do for z=0,2,1 do - local offsetdesc = string.format("%dm to the right, %dm up, and %dm back",x,y,z) local placeoffset = vector.new(x,y,z) local placepos = vector.add(pos,vector.rotate_around_axis(placeoffset,vector.new(0,1,0),facedir)) local replaces = core.get_node(placepos).name if not (core.registered_nodes[replaces] and core.registered_nodes[replaces].buildable_to) then - core.chat_send_player(name,string.format("Can't place car here - position %s is blocked!",offsetdesc)) + local message = S("Can't place car here - position @1m to the right, @2m up, and @3m back is blocked!",x,y,z) + core.chat_send_player(name,message) core.remove_node(pos) return true end if core.is_protected(placepos,name) and not core.check_player_privs(name,{protection_bypass=true}) then - core.chat_send_player(name,string.format("Can't place car here - position %s is protected!",offsetdesc)) + local message = S("Can't place car here - position @1m to the right, @2m up, and @3m back is protected!",x,y,z) + core.chat_send_player(name,message) core.record_protection_violation(placepos,name) core.remove_node(pos) return true diff --git a/car_metal.lua b/car_metal.lua index b6a8e33..0516b95 100644 --- a/car_metal.lua +++ b/car_metal.lua @@ -1,3 +1,5 @@ +local S = core.get_translator("celevator") + local pieces = { { _position = "000", @@ -327,7 +329,7 @@ celevator.car.register("metal",pieces,vector.new(2,3,3)) core.register_node("celevator:car_metal",{ - description = "Metal Elevator Car", + description = S("Metal Elevator Car"), paramtype2 = "4dir", buildable_to = true, inventory_image = "celevator_car_metal_inventory.png", @@ -345,20 +347,21 @@ core.register_node("celevator:car_metal",{ for x=0,1,1 do for y=0,2,1 do for z=0,2,1 do - local offsetdesc = string.format("%dm to the right, %dm up, and %dm back",x,y,z) local placeoffset = vector.new(x,y,z) local placepos = vector.add(pos,vector.rotate_around_axis(placeoffset,vector.new(0,1,0),facedir)) local replaces = core.get_node(placepos).name if not (core.registered_nodes[replaces] and core.registered_nodes[replaces].buildable_to) then - core.chat_send_player(name,string.format("Can't place car here - position %s is blocked!",offsetdesc)) + local message = S("Can't place car here - position @1m to the right, @2m up, and @3m back is blocked!",x,y,z) + core.chat_send_player(name,message) core.remove_node(pos) return true end if core.is_protected(placepos,name) and not core.check_player_privs(name,{protection_bypass=true}) then - core.chat_send_player(name,string.format("Can't place car here - position %s is protected!",offsetdesc)) - core.record_protection_violation(placepos,name) - core.remove_node(pos) - return true + local message = S("Can't place car here - position @1m to the right, @2m up, and @3m back is protected!",x,y,z) + core.chat_send_player(name,message) + core.record_protection_violation(placepos,name) + core.remove_node(pos) + return true end end end diff --git a/car_metalglass.lua b/car_metalglass.lua index 0bd7058..985cfa6 100644 --- a/car_metalglass.lua +++ b/car_metalglass.lua @@ -1,3 +1,5 @@ +local S = core.get_translator("celevator") + local pieces = { { _position = "000", @@ -333,7 +335,7 @@ celevator.car.register("metal_glassback",pieces,vector.new(2,3,3)) core.register_node("celevator:car_metal_glassback",{ - description = "Metal Glass-Back Elevator Car", + description = S("Metal Glass-Back Elevator Car"), paramtype2 = "4dir", buildable_to = true, inventory_image = "celevator_car_metal_glassback_inventory.png", @@ -351,17 +353,18 @@ core.register_node("celevator:car_metal_glassback",{ for x=0,1,1 do for y=0,2,1 do for z=0,2,1 do - local offsetdesc = string.format("%dm to the right, %dm up, and %dm back",x,y,z) local placeoffset = vector.new(x,y,z) local placepos = vector.add(pos,vector.rotate_around_axis(placeoffset,vector.new(0,1,0),facedir)) local replaces = core.get_node(placepos).name if not (core.registered_nodes[replaces] and core.registered_nodes[replaces].buildable_to) then - core.chat_send_player(name,string.format("Can't place car here - position %s is blocked!",offsetdesc)) + local message = S("Can't place car here - position @1m to the right, @2m up, and @3m back is blocked!",x,y,z) + core.chat_send_player(name,message) core.remove_node(pos) return true end if core.is_protected(placepos,name) and not core.check_player_privs(name,{protection_bypass=true}) then - core.chat_send_player(name,string.format("Can't place car here - position %s is protected!",offsetdesc)) + local message = S("Can't place car here - position @1m to the right, @2m up, and @3m back is protected!",x,y,z) + core.chat_send_player(name,message) core.record_protection_violation(placepos,name) core.remove_node(pos) return true diff --git a/car_standard.lua b/car_standard.lua index 6e69b7c..0a70ed0 100644 --- a/car_standard.lua +++ b/car_standard.lua @@ -1,3 +1,5 @@ +local S = core.get_translator("celevator") + local pieces = { { _position = "000", @@ -334,7 +336,7 @@ for x=0,1,1 do end core.register_node("celevator:car_standard",{ - description = "Basic Elevator Car", + description = S("Basic Elevator Car"), paramtype2 = "4dir", buildable_to = true, inventory_image = "celevator_car_inventory.png", @@ -352,17 +354,18 @@ core.register_node("celevator:car_standard",{ for x=0,1,1 do for y=0,2,1 do for z=0,2,1 do - local offsetdesc = string.format("%dm to the right, %dm up, and %dm back",x,y,z) local placeoffset = vector.new(x,y,z) local placepos = vector.add(pos,vector.rotate_around_axis(placeoffset,vector.new(0,1,0),facedir)) local replaces = core.get_node(placepos).name if not (core.registered_nodes[replaces] and core.registered_nodes[replaces].buildable_to) then - core.chat_send_player(name,string.format("Can't place car here - position %s is blocked!",offsetdesc)) + local message = S("Can't place car here - position @1m to the right, @2m up, and @3m back is blocked!",x,y,z) + core.chat_send_player(name,message) core.remove_node(pos) return true end if core.is_protected(placepos,name) and not core.check_player_privs(name,{protection_bypass=true}) then - core.chat_send_player(name,string.format("Can't place car here - position %s is protected!",offsetdesc)) + local message = S("Can't place car here - position @1m to the right, @2m up, and @3m back is protected!",x,y,z) + core.chat_send_player(name,message) core.record_protection_violation(placepos,name) core.remove_node(pos) return true diff --git a/chatcommands.lua b/chatcommands.lua index 53829e7..eacb4f0 100644 --- a/chatcommands.lua +++ b/chatcommands.lua @@ -1,62 +1,64 @@ +local S = core.get_translator("celevator") + core.register_chatcommand("carcall",{ - description = "Places a car call at the specified landing on the specified elevator", - params = " ", + description = S("Places a car call at the specified landing on the specified elevator"), + params = S(" "), func = function(name,param) local carid,landing = string.match(param,"(%d+) (%d+)") if not (carid and tonumber(carid)) then - return false,"Invalid car ID" + return false,S("Invalid car ID") end if not (landing and tonumber(landing)) then - return false,"Invalid landing number" + return false,S("Invalid landing number") end local carinfo = core.deserialize(celevator.storage:get_string("car"..carid)) if not (carinfo and carinfo.controllerpos) then - return false,"No such car or car info is missing" + return false,S("No such car or car info is missing") end if not celevator.controller.iscontroller(carinfo.controllerpos) then - return false,"Controller is missing" + return false,S("Controller is missing") end if celevator.get_meta(carinfo.controllerpos):get_int("carid") ~= tonumber(carid) then - return false,"Controller found but with wrong ID" + return false,S("Controller found but with wrong ID") end if core.is_protected(carinfo.controllerpos,name) then core.record_protection_violation(carinfo.controllerpos,name) - return false,"Controller is protected" + return false,S("Controller is protected") end celevator.controller.run(carinfo.controllerpos,{ type = "remotemsg", channel = "carcall", msg = tonumber(landing), }) - return true,"Command sent" + return true,S("Command sent") end, }) core.register_chatcommand("upcall",{ - description = "Places an up hall call at the specified landing on the specified elevator or dispatcher", - params = " ", + description = S("Places an up hall call at the specified landing on the specified elevator or dispatcher"), + params = S(" "), func = function(name,param) local carid,landing = string.match(param,"(%d+) (%d+)") if not (carid and tonumber(carid)) then - return false,"Invalid car ID" + return false,S("Invalid car ID") end if not (landing and tonumber(landing)) then - return false,"Invalid landing number" + return false,S("Invalid landing number") end local carinfo = core.deserialize(celevator.storage:get_string("car"..carid)) if not (carinfo and (carinfo.controllerpos or carinfo.dispatcherpos)) then - return false,"No such car or car info is missing" + return false,S("No such car or car info is missing") end if carinfo.controllerpos then if not celevator.controller.iscontroller(carinfo.controllerpos) then - return false,"Controller is missing" + return false,S("Controller is missing") end if celevator.get_meta(carinfo.controllerpos):get_int("carid") ~= tonumber(carid) then - return false,"Controller found but with wrong ID" + return false,S("Controller found but with wrong ID") end if core.is_protected(carinfo.controllerpos,name) then core.record_protection_violation(carinfo.controllerpos,name) - return false,"Controller is protected" + return false,S("Controller is protected") end --One of these will work depending on the mode, the other will be ignored celevator.controller.run(carinfo.controllerpos,{ @@ -69,53 +71,53 @@ core.register_chatcommand("upcall",{ channel = "swingupcall", msg = tonumber(landing), }) - return true,"Command sent" + return true,S("Command sent") elseif carinfo.dispatcherpos then if not celevator.dispatcher.isdispatcher(carinfo.dispatcherpos) then - return false,"Dispatcher is missing" + return false,S("Dispatcher is missing") end if celevator.get_meta(carinfo.dispatcherpos):get_int("carid") ~= tonumber(carid) then - return false,"Dispatcher found but with wrong ID" + return false,S("Dispatcher found but with wrong ID") end if core.is_protected(carinfo.dispatcherpos,name) then core.record_protection_violation(carinfo.dispatcherpos,name) - return false,"Dispatcher is protected" + return false,S("Dispatcher is protected") end celevator.dispatcher.run(carinfo.dispatcherpos,{ type = "remotemsg", channel = "upcall", msg = tonumber(landing), }) - return true,"Command sent" + return true,S("Command sent") end end, }) core.register_chatcommand("downcall",{ - description = "Places a down hall call at the specified landing on the specified elevator or dispatcher", - params = " ", + description = S("Places a down hall call at the specified landing on the specified elevator or dispatcher"), + params = S(" "), func = function(name,param) local carid,landing = string.match(param,"(%d+) (%d+)") if not (carid and tonumber(carid)) then - return false,"Invalid car ID" + return false,S("Invalid car ID") end if not (landing and tonumber(landing)) then - return false,"Invalid landing number" + return false,S("Invalid landing number") end local carinfo = core.deserialize(celevator.storage:get_string("car"..carid)) if not (carinfo and (carinfo.controllerpos or carinfo.dispatcherpos)) then - return false,"No such car or car info is missing" + return false,S("No such car or car info is missing") end if carinfo.controllerpos then if not celevator.controller.iscontroller(carinfo.controllerpos) then - return false,"Controller is missing" + return false,S("Controller is missing") end if celevator.get_meta(carinfo.controllerpos):get_int("carid") ~= tonumber(carid) then - return false,"Controller found but with wrong ID" + return false,S("Controller found but with wrong ID") end if core.is_protected(carinfo.controllerpos,name) then core.record_protection_violation(carinfo.controllerpos,name) - return false,"Controller is protected" + return false,S("Controller is protected") end --One of these will work depending on the mode, the other will be ignored celevator.controller.run(carinfo.controllerpos,{ @@ -128,49 +130,49 @@ core.register_chatcommand("downcall",{ channel = "swingdncall", msg = tonumber(landing), }) - return true,"Command sent" + return true,S("Command sent") elseif carinfo.dispatcherpos then if not celevator.dispatcher.isdispatcher(carinfo.dispatcherpos) then - return false,"Dispatcher is missing" + return false,S("Dispatcher is missing") end if celevator.get_meta(carinfo.dispatcherpos):get_int("carid") ~= tonumber(carid) then - return false,"Dispatcher found but with wrong ID" + return false,S("Dispatcher found but with wrong ID") end if core.is_protected(carinfo.dispatcherpos,name) then core.record_protection_violation(carinfo.dispatcherpos,name) - return false,"Dispatcher is protected" + return false,S("Dispatcher is protected") end celevator.dispatcher.run(carinfo.dispatcherpos,{ type = "remotemsg", channel = "dncall", msg = tonumber(landing), }) - return true,"Command sent" + return true,S("Command sent") end end, }) core.register_chatcommand("elevstatus",{ - description = "View the status of the specified elevator", - params = "", + description = S("View the status of the specified elevator"), + params = S(""), func = function(_,param) if not (param and tonumber(param)) then - return false,"Invalid car ID" + return false,S("Invalid car ID") end local carinfo = core.deserialize(celevator.storage:get_string("car"..param)) if not (carinfo and carinfo.controllerpos) then - return false,"No such car or car info is missing" + return false,S("No such car or car info is missing") end if not celevator.controller.iscontroller(carinfo.controllerpos) then - return false,"Controller is missing" + return false,S("Controller is missing") end local controllermeta = celevator.get_meta(carinfo.controllerpos) if controllermeta:get_int("carid") ~= tonumber(param) then - return false,"Controller found but with wrong ID" + return false,S("Controller found but with wrong ID") end local mem = core.deserialize(controllermeta:get_string("mem")) if not mem then - return false,"Failed to load controller memory" + return false,S("Failed to load controller memory") end local infotext = controllermeta:get_string("infotext") if mem.drive and mem.drive.status and mem.drive.status.vel and mem.drive.status.apos then diff --git a/controller.lua b/controller.lua index bf351ef..2c6c9b6 100644 --- a/controller.lua +++ b/controller.lua @@ -1,5 +1,7 @@ celevator.controller = {} +local S = core.get_translator("celevator") + celevator.controller.iqueue = core.deserialize(celevator.storage:get_string("controller_iqueue")) or {} celevator.controller.equeue = core.deserialize(celevator.storage:get_string("controller_equeue")) or {} @@ -11,13 +13,13 @@ if not fw then error(err) end core.register_chatcommand("celevator_reloadcontroller",{ params = "", - description = "Reload celevator controller firmware from disk", + description = S("Reload celevator controller firmware from disk"), privs = {server = true}, func = function() local newfw,loaderr = loadfile(core.get_modpath("celevator").."/controllerfw.lua") if newfw then fw = newfw - return true,"Firmware reloaded successfully" + return true,S("Firmware reloaded successfully") else return false,loaderr end @@ -31,14 +33,14 @@ local function after_place(pos,placer) local placername = placer:get_player_name() if topnode.name ~= "air" then if placer:is_player() then - core.chat_send_player(placername,"Can't place cabinet - no room for the top half!") + core.chat_send_player(placername,S("Can't place cabinet - no room for the top half!")) end core.set_node(pos,{name="air"}) return true end if core.is_protected(toppos,placername) and not core.check_player_privs(placername,{protection_bypass=true}) then if placer:is_player() then - core.chat_send_player(placername,"Can't place cabinet - top half is protected!") + core.chat_send_player(placername,S("Can't place cabinet - top half is protected!")) core.record_protection_violation(toppos,placername) end core.set_node(pos,{name="air"}) @@ -121,13 +123,13 @@ local function candig(_,player) if controls.sneak then return true else - core.chat_send_player(player:get_player_name(),"Hold the sneak button while digging to remove.") + core.chat_send_player(player:get_player_name(),S("Hold the sneak button while digging to remove.")) return false end end core.register_node("celevator:controller",{ - description = "Elevator Controller", + description = S("Elevator Controller"), groups = { cracky = 1, }, @@ -177,7 +179,7 @@ core.register_node("celevator:controller",{ end local name = puncher:get_player_name() if core.is_protected(pos,name) and not core.check_player_privs(name,{protection_bypass=true}) then - core.chat_send_player(name,"Can't open cabinet - cabinet is locked.") + core.chat_send_player(name,S("Can't open cabinet - cabinet is locked.")) core.record_protection_violation(pos,name) return end @@ -202,7 +204,7 @@ core.register_node("celevator:controller",{ }) core.register_node("celevator:controller_open",{ - description = "Controller (door open - you hacker you!)", + description = S("Controller (door open - you hacker you!)"), groups = { cracky = 1, not_in_creative_inventory = 1, @@ -263,7 +265,7 @@ core.register_node("celevator:controller_open",{ }) core.register_node("celevator:controller_top",{ - description = "Controller (top section - you hacker you!)", + description = S("Controller (top section - you hacker you!)"), groups = { not_in_creative_inventory = 1, }, @@ -294,7 +296,7 @@ core.register_node("celevator:controller_top",{ }) core.register_node("celevator:controller_top_running",{ - description = "Controller (top section, car in motion - you hacker you!)", + description = S("Controller (top section, car in motion - you hacker you!)"), groups = { not_in_creative_inventory = 1, }, @@ -325,7 +327,7 @@ core.register_node("celevator:controller_top_running",{ }) core.register_node("celevator:controller_top_open",{ - description = "Controller (top section, open - you hacker you!)", + description = S("Controller (top section, open - you hacker you!)"), groups = { not_in_creative_inventory = 1, }, @@ -361,7 +363,7 @@ core.register_node("celevator:controller_top_open",{ }) core.register_node("celevator:controller_top_open_running",{ - description = "Controller (top section, open, car in motion - you hacker you!)", + description = S("Controller (top section, open, car in motion - you hacker you!)"), groups = { not_in_creative_inventory = 1, }, @@ -420,7 +422,7 @@ function celevator.controller.finish(pos,mem,changedinterrupts) local carinfo = core.deserialize(celevator.storage:get_string(string.format("car%d",carid))) local carinfodirty = false if not carinfo then - core.log("error","[celevator] [controller] Bad car info for controller at "..core.pos_to_string(pos)) + core.log("error",string.format("[celevator] [controller] Bad car info for controller at %s",core.pos_to_string(pos))) return end local drivepos,drivetype = celevator.controller.finddrive(pos) @@ -592,8 +594,10 @@ function celevator.controller.run(pos,event) table.insert(celevator.controller.equeue[hash],event) celevator.storage:set_string("controller_equeue",core.serialize(celevator.controller.equeue)) if #celevator.controller.equeue[hash] > 5 then - local message = "[celevator] [controller] Async process for controller at %s is falling behind, %d events in queue" - core.log("warning",string.format(message,core.pos_to_string(pos),#celevator.controller.equeue[hash])) + local pstring = core.pos_to_string(pos) + local queuelen = #celevator.controller.queue[hash] + local message = string.format("[celevator] [controller] Async process for controller at %s is falling behind, %d events in queue",pstring,queuelen) + core.log("warning",message) end return end @@ -601,7 +605,7 @@ function celevator.controller.run(pos,event) local meta = core.get_meta(pos) local mem = core.deserialize(meta:get_string("mem")) if not mem then - core.log("error","[celevator] [controller] Failed to load controller memory at "..core.pos_to_string(pos)) + core.log("error",string.format("[celevator] [controller] Failed to load controller memory at %s",core.pos_to_string(pos))) return end mem.drive = {} diff --git a/controllerfw.lua b/controllerfw.lua index 0ac2878..ed92af9 100644 --- a/controllerfw.lua +++ b/controllerfw.lua @@ -1,5 +1,7 @@ local pos,event,mem = ... +local S = core.get_translator("celevator") + local changedinterrupts = {} mem.messages = {} @@ -40,44 +42,44 @@ end local juststarted = false local modenames = { - normal = "Normal Operation", - uninit = "Uninitialized", - resync = "Position Sync - Floor", - bfdemand = "Position Sync - Terminal", - fault = "Fault", - stop = "Emergency Stop", - mrinspect = "Machine Room Inspection", - carinspect = "Car Top Inspection", + normal = S("Normal Operation"), + uninit = S("Uninitialized"), + resync = S("Position Sync - Floor"), + bfdemand = S("Position Sync - Terminal"), + fault = S("Fault"), + stop = S("Emergency Stop"), + mrinspect = S("Machine Room Inspection"), + carinspect = S("Car Top Inspection"), inspconflict = "Inspection Conflict", --No longer used but some controllers may be in it at update time - fs1 = "Fire Service - Phase 1", - fs2 = "Fire Service - Phase 2", - fs2hold = "Fire Service - Phase 2 Hold", - indep = "Independent Service", - capture = "Captured", - test = "Test Mode", - swing = "Swing Operation", + fs1 = S("Fire Service - Phase 1"), + fs2 = S("Fire Service - Phase 2"), + fs2hold = S("Fire Service - Phase 2 Hold"), + indep = S("Independent Service"), + capture = S("Captured"), + test = S("Test Mode"), + swing = S("Swing Operation"), } local doorstates = { - open = "Open", - opening = "Opening", - closing = "Closing", - closed = "Closed", - testtiming = "Closed", + open = S("Doors Open"), + opening = S("Doors Opening"), + closing = S("Doors Closing"), + closed = S("Doors Closed"), + testtiming = S("Doors Closed"), } local faultnames = { - opentimeout = "Door Open Timeout", - closetimeout = "Door Close Timeout", - drivecomm = "Lost Communication With Drive", - driveuninit = "Drive Not Configured", - drivemetaload = "Drive Metadata Load Failure", - drivebadorigin = "Drive Origin Invalid", - drivedoorinterlock = "Attempted to Move Doors With Car in Motion", - driveoutofbounds = "Target Position Out of Bounds", - drivenomachine = "Hoist Machine Missing", - drivemachinemismatch = "Drive<->Machine ID Mismatch", - drivecontrollermismatch = "Controller<->Drive ID Mismatch", + opentimeout = S("Door Open Timeout"), + closetimeout = S("Door Close Timeout"), + drivecomm = S("Lost Communication With Drive"), + driveuninit = S("Drive Not Configured"), + drivemetaload = S("Drive Metadata Load Failure"), + drivebadorigin = S("Drive Origin Invalid"), + drivedoorinterlock = S("Attempted to Move Doors With Car in Motion"), + driveoutofbounds = S("Target Position Out of Bounds"), + drivenomachine = S("Hoist Machine Missing"), + drivemachinemismatch = S("Drive<->Machine ID Mismatch"), + drivecontrollermismatch = S("Controller<->Drive ID Mismatch"), } local function drivecmd(command) @@ -1296,68 +1298,93 @@ fs("no_prepend[]") fs("background9[0,0;16,12;celevator_fs_bg.png;true;3]") if mem.screenstate == "oobe_welcome" then fs("image[6,1;4,2;celevator_logo.png]") - fs("label[1,4;Welcome to your new MTronic XT elevator controller!]") - fs("label[1,4.5;This setup wizard is designed to get your elevator up and running as quickly as possible.]") - fs("label[1,5.5;Press Next to begin.]") - fs("button[1,10;2,1;license;License Info]") - fs("button[13,10;2,1;next;Next >]") + local welcomemsg = S("Welcome to your new MTronic XT elevator controller!") + local wizardmsg = S("This setup wizard is designed to get your elevator up and running as quickly as possible.") + local pressnextmsg = S("Press Next to begin.") + local licensemsg = S("License Info") + local nextbuttonmsg = S("Next >") + fs("label[1,4;"..welcomemsg.."]") + fs("label[1,4.5;"..wizardmsg.."]") + fs("label[1,5.5;"..pressnextmsg.."]") + fs("button[1,10;3,1;license;"..licensemsg.."]") + fs("button[13,10;2,1;next;"..nextbuttonmsg.."]") elseif mem.screenstate == "oobe_license" then local licensefile = io.open(core.get_modpath("celevator").."/LICENSE") local license = core.formspec_escape(licensefile:read("*all")) licensefile:close() - fs("textarea[1,1;14,8;license;This applies to the whole celevator mod\\, not just this controller:;"..license.."]") - fs("button[7,10.5;2,1;back;OK]") + local licenseinfo = core.formspec_escape(S("This applies to the whole celevator mod, not just this controller:")) + fs("textarea[1,1;14,8;license;"..licenseinfo..";"..license.."]") + local okmsg = S("OK") + fs("button[7,10.5;2,1;back;"..okmsg.."]") elseif mem.screenstate == "oobe_groupmode" then - fs("button[1,10;2,1;back;< Back]") - fs("label[1,1;Select a group operation mode:]") - fs("button[1,3;2,1;simplex;Simplex]") - fs("label[1,4.5;This will be the only elevator in the group. Hall calls will be handled by this controller.]") - fs("button[1,6;2,1;group;Group]") - fs("label[1,7.5;This elevator will participate in a group with others. Hall calls will be handled by a dispatcher.]") + local backmsg = S("< Back") + fs("button[1,10;2,1;back;"..backmsg.."]") + local modeselectmsg = S("Select a group operation mode:") + fs("label[1,1;"..modeselectmsg.."]") + local simplexmsg = S("Simplex") + fs("button[1,3;2,1;simplex;"..simplexmsg.."]") + local simplexlongmsg = S("This will be the only elevator in the group. Hall calls will be handled by this controller.") + fs("label[1,4.5;"..simplexlongmsg.."]") + local groupmsg = S("Group") + fs("button[1,6;2,1;group;"..groupmsg.."]") + local grouplongmsg = S("This elevator will participate in a group with others. Hall calls will be handled by a dispatcher.") + fs("label[1,7.5;"..grouplongmsg.."]") elseif mem.screenstate == "oobe_dispatcherconnect" then - fs("button[1,10;2,1;back;< Cancel]") - fs("label[1,1;Waiting for connection from dispatcher...]") - fs(string.format("label[1,1.5;This controller's car ID is: %d]",mem.carid)) + local cancelmsg = S("Cancel") + fs("button[1,10;2,1;back;"..cancelmsg.."]") + local waitingmsg = S("Waiting for connection from dispatcher...") + fs("label[1,1;"..waitingmsg.."]") + local idmsg = S("This controller's car ID is: @1",mem.carid) + fs("label[1,1.5;"..idmsg.."]") elseif mem.screenstate == "oobe_floortable" or mem.screenstate == "floortable" then if mem.screenstate == "oobe_floortable" then - fs("label[1,1;Enter details of all floors this elevator will serve, then press Done.]") - fs("button[1,10;2,1;back;< Back]") - fs("button[13,10;2,1;next;Done >]") + local helpmsg = S("Enter details of all floors this elevator will serve, then press Done.") + fs("label[1,1;"..helpmsg.."]") + local backmsg = S("< Back") + fs("button[1,10;2,1;back;"..backmsg.."]") + local donemsg = S("Done") + fs("button[13,10;2,1;next;"..donemsg.."]") else - fs("label[1,1;EDIT FLOOR TABLE]") - fs("button[1,10;2,1;next;Done]") + local titlemsg = S("EDIT FLOOR TABLE") + fs("label[1,1;"..titlemsg.."]") + local donemsg = S("Done") + fs("button[1,10;2,1;next;"..donemsg.."]") end fs("textlist[1,2;6,7;floor;") for i=#mem.params.floornames,1,-1 do - fs(core.formspec_escape(string.format("%d - Height: %d - PI: %s",i,mem.params.floorheights[i],mem.params.floornames[i]))..(i==1 and "" or ",")) + local floortext = S("@1 - Height: @2 - PI: @3",i,mem.params.floorheights[i],mem.params.floornames[i]) + fs(core.formspec_escape(floortext)..(i==1 and "" or ",")) end fs(";"..tostring(#mem.params.floornames-mem.editingfloor+1)..";false]") - if #mem.params.floornames < 100 then fs("button[8,2;2,1;add;New Floor]") end - fs("button[8,3.5;2,1;edit;Edit Floor]") - if #mem.params.floornames > 2 then fs("button[8,5;2,1;remove;Remove Floor]") end - if mem.editingfloor < #mem.params.floornames then fs("button[8,6.5;2,1;moveup;Move Up]") end - if mem.editingfloor > 1 then fs("button[8,8;2,1;movedown;Move Down") end + if #mem.params.floornames < 100 then fs("button[8,2;2,1;add;"..S("New Floor").."]") end + fs("button[8,3.5;2,1;edit;"..S("Edit Floor").."]") + if #mem.params.floornames > 2 then fs("button[8,5;2,1;remove;"..S("Remove Floor").."]") end + if mem.editingfloor < #mem.params.floornames then fs("button[8,6.5;2,1;moveup;"..S("Move Up").."]") end + if mem.editingfloor > 1 then fs("button[8,8;2,1;movedown;"..S("Move Down").."]") end elseif mem.screenstate == "oobe_floortable_edit" or mem.screenstate == "floortable_edit" then if mem.screenstate == "oobe_floortable_edit" then - fs("button[7,10.5;2,1;back;OK]") - fs("label[1,5;The Floor Height is the distance (in meters/nodes) from the floor level of this floor to the floor level of the next floor.]") - fs("label[1,5.5;(not used at the highest floor)]") - fs("label[1,6.5;The Floor Name is how the floor will be displayed on the position indicators.]") + fs("button[7,10.5;2,1;back;"..S("OK").."]") + local help1 = S("The Floor Height is the distance (in meters/nodes) from the floor level of this floor to the floor level of the next floor.") + local help2 = S("(not used at the highest floor)") + local help3 = S("The Floor Name is how the floor will be displayed on the position indicators.") + fs("label[1,5;"..help1.."]") + fs("label[1,5.5;"..help2.."]") + fs("label[1,6.5;"..help3.."]") else - fs("button[7,10.5;2,1;save;Save]") + fs("button[7,10.5;2,1;save;"..S("Save").."]") end - fs("label[1,1;Editing floor "..tostring(mem.editingfloor).."]") - fs("field[1,3;3,1;height;Floor Height;"..tostring(mem.params.floorheights[mem.editingfloor]).."]") - fs("field[5,3;3,1;name;Floor Name;"..core.formspec_escape(mem.params.floornames[mem.editingfloor]).."]") + fs("label[1,1;"..S("Editing Floor @1",tostring(mem.editingfloor)).."]") + fs("field[1,3;3,1;height;"..S("Floor Height")..";"..tostring(mem.params.floorheights[mem.editingfloor]).."]") + fs("field[5,3;3,1;name;"..S("Floor Name")..";"..core.formspec_escape(mem.params.floornames[mem.editingfloor]).."]") elseif mem.screenstate == "status" then fs("style_type[image_button;font=mono;font_size=*0.75]") fs("box[12,2.5;0.1,9;#AAAAAAFF]") fs("box[13.12,2.5;0.05,9;#AAAAAAFF]") fs("box[14.12,2.5;0.05,9;#AAAAAAFF]") fs("box[15.25,2.5;0.1,9;#AAAAAAFF]") - fs("label[12.5,2;UP]") - fs("label[13.38,2;CAR]") - fs("label[14.25,2;DOWN]") + fs("label[12.4,2;^]") + fs("label[13.38,2;"..S("CAR").."]") + fs("label[14.8,2;v]") local maxfloor = #mem.params.floornames local bottom = (mem.screenpage-1)*10+1 for i=0,9,1 do @@ -1400,7 +1427,7 @@ elseif mem.screenstate == "status" then end end if maxfloor > 10 then - fs(string.format("checkbox[13,1.25;scrollfollowscar;Follow Car;%s]",tostring(mem.scrollfollowscar))) + fs(string.format("checkbox[13,1.25;scrollfollowscar;"..S("Follow Car")..";%s]",tostring(mem.scrollfollowscar))) if bottom+9 < maxfloor then fs("image_button[12.75,0.25;0.75,0.75;celevator_menu_arrow.png;scrollup;;false;false;celevator_menu_arrow.png]") end @@ -1408,18 +1435,21 @@ elseif mem.screenstate == "status" then fs("image_button[13.87,0.25;0.75,0.75;celevator_menu_arrow.png^\\[transformFY;scrolldown;;false;false;celevator_menu_arrow.png^\\[transformFY]") end end - fs("label[1,1;CAR STATUS]") + fs("label[1,1;"..S("CAR STATUS").."]") fs(string.format("label[1,2;%s]",modenames[mem.carstate])) - fs(string.format("label[1,2.5;Doors %s]",doorstates[mem.doorstate])) + fs(string.format("label[1,2.5;%s]",doorstates[mem.doorstate])) local currentfloor = core.formspec_escape(mem.params.floornames[getpos()]) - fs(string.format("label[1,3;Position: %0.02fm Speed: %+0.02fm/s PI: %s]",mem.drive.status.apos,mem.drive.status.vel,currentfloor)) + local posfmt = string.format("%0.02f",mem.drive.status.apos) + local speedfmt = string.format("%+0.02f",mem.drive.status.vel) + local posmsg = S("Position: @1m Speed: @2m/s PI: @3",posfmt,speedfmt,currentfloor) + fs("label[1,3;"..posmsg.."]") if #mem.faultlog > 0 then - fs("label[1,3.5;Fault(s) Active]") + fs("label[1,3.5;"..S("Fault(s) Active").."]") else - fs("label[1,3.5;No Current Faults]") + fs("label[1,3.5;"..S("No Current Faults").."]") end - fs("button[1,10;3,1;faults;Fault History]") - fs("button[4.5,10;3,1;parameters;Edit Parameters]") + fs("button[1,10;3,1;faults;"..S("Fault History").."]") + fs("button[4.5,10;3,1;parameters;"..S("Edit Parameters").."]") local redon = "celevator_led_red_on.png" local redoff = "celevator_led_red_off.png" local yellowon = "celevator_led_yellow_on.png" @@ -1427,64 +1457,64 @@ elseif mem.screenstate == "status" then local greenon = "celevator_led_green_on.png" local greenoff = "celevator_led_green_off.png" fs(string.format("image[7,1;0.7,0.7;%s]",mem.carstate == "fault" and redon or redoff)) - fs("label[8,1.35;FAULT]") + fs("label[8,1.35;"..S("FAULT").."]") local inspectionstates = { mrinspect = true, carinspect = true, inspconflict = true, } fs(string.format("image[7,1.9;0.7,0.7;%s]",inspectionstates[mem.carstate] and yellowon or yellowoff)) - fs("label[8,2.25;INSP/ACCESS]") + fs("label[8,2.25;"..S("INSP/ACCESS").."]") fs(string.format("image[7,2.8;0.7,0.7;%s]",mem.carstate == "normal" and greenon or greenoff)) - fs("label[8,3.15;NORMAL OPERATION]") + fs("label[8,3.15;"..S("NORMAL OPERATION").."]") fs(string.format("image[7,3.7;0.7,0.7;%s]",mem.drive.status.vel > 0.01 and yellowon or yellowoff)) - fs("label[8,4.05;UP]") + fs("label[8,4.05;"..S("UP").."]") fs(string.format("image[7,4.6;0.7,0.7;%s]",math.abs(mem.drive.status.vel) > 0.01 and yellowon or yellowoff)) - fs("label[8,4.95;DRIVE CMD]") + fs("label[8,4.95;"..S("DRIVE CMD").."]") fs(string.format("image[7,5.5;0.7,0.7;%s]",mem.drive.status.vel < -0.01 and yellowon or yellowoff)) - fs("label[8,5.85;DOWN]") + fs("label[8,5.85;"..S("DOWN").."]") fs(string.format("image[7,6.4;0.7,0.7;%s]",math.abs(mem.drive.status.vel) > math.min(0.4,mem.params.contractspeed/2) and yellowon or yellowoff)) - fs("label[8,6.75;HIGH SPEED]") + fs("label[8,6.75;"..S("HIGH SPEED").."]") fs(string.format("image[7,7.3;0.7,0.7;%s]",math.abs(gettarget(getpos(true))-mem.drive.status.apos) < 0.5 and greenon or greenoff)) - fs("label[8,7.65;DOOR ZONE]") + fs("label[8,7.65;"..S("DOOR ZONE").."]") fs(string.format("image[7,8.2;0.7,0.7;%s]",mem.doorstate == "closed" and greenon or greenoff)) - fs("label[8,8.55;DOORS LOCKED]") + fs("label[8,8.55;"..S("DOORS LOCKED").."]") fs("style[*;font=mono]") local stopswimg = "celevator_toggle_switch.png"..(mem.controllerstopsw and "^\\[transformFY" or "") fs(string.format("image_button[1,5;1,1.33;%s;stopsw;;false;false;%s]",stopswimg,stopswimg)) - fs("label[1.3,4.75;RUN]") - fs("label[1.2,6.6;STOP]") + fs("label[1.3,4.75;"..S("RUN").."]") + fs("label[1.2,6.6;"..S("STOP").."]") local captureswimg = "celevator_toggle_switch.png"..(mem.capturesw and "" or "^\\[transformFY") fs(string.format("image_button[3,5;1,1.33;%s;capturesw;;false;false;%s]",captureswimg,captureswimg)) - fs("label[3,4.75;CAPTURE]") + fs("label[3,4.75;"..S("CAPTURE").."]") local testswimg = "celevator_toggle_switch.png"..(mem.testsw and "" or "^\\[transformFY") fs(string.format("image_button[5,5;1,1.33;%s;testsw;;false;false;%s]",testswimg,testswimg)) - fs("label[5.23,4.75;TEST]") + fs("label[5.23,4.75;"..S("TEST").."]") local inspectswimg = "celevator_toggle_switch.png"..(mem.controllerinspectsw and "" or "^\\[transformFY") fs(string.format("image_button[1,8;1,1.33;%s;inspectsw;;false;false;%s]",inspectswimg,inspectswimg)) - fs("label[1.05,7.75;INSPECT]") - fs("label[1.1,9.6;NORMAL]") + fs("label[1.05,7.75;"..S("INSPECT").."]") + fs("label[1.1,9.6;"..S("NORMAL").."]") fs(string.format("image_button[3,8.25;1,1;%s;inspectup;;false;false;%s]","celevator_button_black.png","celevator_button_black.png")) - fs("label[3.4,7.75;UP]") + fs("label[3.4,7.75;"..S("UP ").."]") fs(string.format("image_button[5,8.25;1,1;%s;inspectdown;;false;false;%s]","celevator_button_black.png","celevator_button_black.png")) - fs("label[5.25,7.75;DOWN]") + fs("label[5.25,7.75;"..S("DOWN ").."]") elseif mem.screenstate == "parameters" then - fs("label[1,1;EDIT PARAMETERS]") - fs("button[1,10;3,1;save;Save]") - fs("button[4.5,10;3,1;cancel;Cancel]") - if mem.params.groupmode == "simplex" then fs("button[8,10;3,1;floortable;Edit Floor Table]") end - fs(string.format("field[1,3;3,1;doortimer;Door Dwell Timer;%0.1f]",mem.params.doortimer)) - fs(string.format("field[1,5;3,1;contractspeed;Contract Speed (m/s);%0.1f]",mem.params.contractspeed)) - fs(string.format("field[4.5,5;3,1;inspectionspeed;Inspection Speed (m/s);%0.1f]",mem.params.inspectionspeed)) - fs(string.format("field[1,7;3,1;mainlanding;Main Egress Landing;%d]",mem.params.mainlanding or 1)) - fs(string.format("field[4.5,3;3,1;nudgetimer;Nudging Timer (0 = None);%0.1f]",mem.params.nudgetimer)) - fs(string.format("field[4.5,7;3,1;altrecalllanding;Alternate Recall Landing;%d]",mem.params.altrecalllanding)) + fs("label[1,1;"..S("EDIT PARAMETERS").."]") + fs("button[1,10;3,1;save;"..S("Save").."]") + fs("button[4.5,10;3,1;cancel;"..S("Cancel").."]") + if mem.params.groupmode == "simplex" then fs("button[8,10;3,1;floortable;"..S("Edit Floor Table").."]") end + fs(string.format("field[1,3;3,1;doortimer;"..S("Door Dwell Timer")..";%0.1f]",mem.params.doortimer)) + fs(string.format("field[1,5;3,1;contractspeed;"..S("Contract Speed (m/s)")..";%0.1f]",mem.params.contractspeed)) + fs(string.format("field[4.5,5;3,1;inspectionspeed;"..S("Inspection Speed (m/s)")..";%0.1f]",mem.params.inspectionspeed)) + fs(string.format("field[1,7;3,1;mainlanding;"..S("Main Egress Landing")..";%d]",mem.params.mainlanding or 1)) + fs(string.format("field[4.5,3;3,1;nudgetimer;"..S("Nudging Timer")..";%0.1f]",mem.params.nudgetimer)) + fs(string.format("field[4.5,7;3,1;altrecalllanding;"..S("Alternate Recall Landing")..";%d]",mem.params.altrecalllanding)) fs("style[resetdoors,resetcontroller;bgcolor=#DD3333]") - fs("button[12,1;3,1;resetdoors;Reset Doors]") - fs("button[12,2.5;3,1;resetcontroller;Reset Controller]") - fs("button[1,8.5;3,1;carcallsecurity;Car Call Security]") + fs("button[12,1;3,1;resetdoors;"..S("Reset Doors").."]") + fs("button[12,2.5;3,1;resetcontroller;"..S("Reset Controller").."]") + fs("button[1,8.5;3,1;carcallsecurity;"..S("Car Call Security").."]") elseif mem.screenstate == "faults" then - fs("label[1,1;FAULT HISTORY]") + fs("label[1,1;"..S("FAULT HISTORY").."]") if #mem.faultlog > 0 then for i=0,9,1 do if #mem.faultlog-i >= 1 then @@ -1495,29 +1525,30 @@ elseif mem.screenstate == "faults" then end end else - fs("label[1,2;No Current Faults]") + fs("label[1,2;"..S("No Current Faults").."]") end - fs("button[1,10;3,1;back;Back]") - fs("button[4.5,10;3,1;clear;Clear]") + fs("button[1,10;3,1;back;"..S("Back").."]") + fs("button[4.5,10;3,1;clear;"..S("Clear").."]") elseif mem.screenstate == "carcallsecurity" then - fs("label[1,1;CAR CALL SECURITY]") - fs("button[1,10;3,1;save;Done]") + fs("label[1,1;"..S("CAR CALL SECURITY").."]") + fs("button[1,10;3,1;save;"..S("Done").."]") fs("textlist[1,2;6,7;floor;") for i=#mem.params.floornames,1,-1 do local secmode = mem.params.carcallsecurity[i] if secmode == "auth" then - secmode = "Authorized Users Only" + secmode = S("Authorized Users Only") elseif secmode == "deny" then - secmode = "Locked" + secmode = S("Locked") else - secmode = "Security Disabled" + secmode = S("Security Disabled") end fs(core.formspec_escape(string.format("%s - %s",mem.params.floornames[i],secmode))..(i==1 and "" or ",")) end fs(";"..tostring(#mem.params.floornames-mem.editingfloor+1)..";false]") - fs("checkbox[1,9.5;swingcallwhennotswing;Allow Swing Calls When Not In Swing Operation;"..tostring(mem.params.swingcallwhennotswing).."]") + local swingmsg = S("Allow Swing Calls When Not In Swing Operation") + fs("checkbox[1,9.5;swingcallwhennotswing;"..swingmsg..";"..tostring(mem.params.swingcallwhennotswing).."]") if mem.editingfloor ~= (mem.params.mainlanding or 1) then - fs("dropdown[8,2;4,1;secmode;Security Disabled,Authorized Users Only,Locked;") + fs("dropdown[8,2;4,1;secmode;"..S("Security Disabled")..","..S("Authorized Users Only")..","..S("Locked")..";") if mem.params.carcallsecurity[mem.editingfloor] == "auth" then fs("2;true]") elseif mem.params.carcallsecurity[mem.editingfloor] == "deny" then @@ -1526,8 +1557,8 @@ elseif mem.screenstate == "carcallsecurity" then fs("1;true]") end if mem.params.carcallsecurity[mem.editingfloor] then - fs(string.format("checkbox[8,3.5;indepunlock;Unlock in Independent;%s]",(mem.params.indepunlock[mem.editingfloor] and "true" or "false"))) - fs("label[8,4.7;Extra Allowed Users]") + fs(string.format("checkbox[8,3.5;indepunlock;"..S("Unlock in Independent")..";%s]",(mem.params.indepunlock[mem.editingfloor] and "true" or "false"))) + fs("label[8,4.7;"..S("Extra Allowed Users").."]") if not mem.params.secoverrideusers[mem.editingfloor] then mem.params.secoverrideusers[mem.editingfloor] = {} end if #mem.params.secoverrideusers[mem.editingfloor] > 0 then fs("textlist[8,6;4,2;user;") @@ -1536,14 +1567,14 @@ elseif mem.screenstate == "carcallsecurity" then end fs(";"..tostring(mem.editinguser)..";false]") else - fs("label[8,6.25;(none)]") + fs("label[8,6.25;"..S("(none)").."]") end fs("field[8,5;3,1;username;;]") fs("button[11.25,5;0.5,1;adduser;+]") fs("button[12,5;0.5,1;deluser;-]") end else - fs("label[8,2;Main landing cannot be locked]") + fs("label[8,2;"..S("Main landing cannot be locked").."]") end end @@ -1556,7 +1587,7 @@ end local floorname = mem.params.floornames[getpos()] local modename = modenames[mem.carstate] local doorstate = doorstates[mem.doorstate] -mem.infotext = string.format("ID %d: Floor %s %s - %s - Doors %s",mem.carid,floorname,arrow,modename,doorstate) +mem.infotext = S("ID @1: Floor @2 - @3 - @4",mem.carid,(floorname.." "..arrow),modename,doorstate) if mem.drive.type then mem.showrunning = mem.drive.status.vel ~= 0 @@ -1654,7 +1685,8 @@ end local closelabel = core.formspec_escape(">|<") mem.copformspec = mem.copformspec..string.format("image_button[%f,%f;1.2,1.2;%s;close;%s;false;false;%s]",dcxp,coprows*1.25+2.5,unlitimg,closelabel,litimg) -mem.copformspec = mem.copformspec..string.format("image_button[0.4,0.5;1.4,1.4;%s;callcancel;Call\nCancel;false;false;%s]",unlitimg,litimg) +local callcancellabel = S("Call\nCancel") +mem.copformspec = mem.copformspec..string.format("image_button[0.4,0.5;1.4,1.4;%s;callcancel;"..callcancellabel..";false;false;%s]",unlitimg,litimg) if mem.flashfirehat then mem.copformspec = mem.copformspec.."animated_image[2.2,0.5;1.4,1.4;firehat;celevator_fire_hat_flashing.png;2;750]" @@ -1663,31 +1695,33 @@ else mem.copformspec = mem.copformspec..string.format("image[2.2,0.5;1.4,1.4;%s]",firehat) end +local switchboilerplate = ";false;false;celevator_button_rect_active.png" + mem.switchformspec = "formspec_version[7]size[8,10]no_prepend[]background9[0,0;16,12;celevator_fs_bg.png;true;3]" local fs2ontex = (mem.fs2sw == "on") and "celevator_button_rect_active.png" or "celevator_button_rect.png" local fs2holdtex = (mem.fs2sw == "hold") and "celevator_button_rect_active.png" or "celevator_button_rect.png" local fs2offtex = (mem.fs2sw == "off" or not mem.fs2sw) and "celevator_button_rect_active.png" or "celevator_button_rect.png" -mem.switchformspec = mem.switchformspec..string.format("image_button[1.5,1.5;1.5,1;%s;fs2on;ON;false;false;celevator_button_rect_active.png]",fs2ontex) -mem.switchformspec = mem.switchformspec..string.format("image_button[1.5,2.5;1.5,1;%s;fs2hold;HOLD;false;false;celevator_button_rect_active.png]",fs2holdtex) -mem.switchformspec = mem.switchformspec..string.format("image_button[1.5,3.5;1.5,1;%s;fs2off;OFF;false;false;celevator_button_rect_active.png]",fs2offtex) -mem.switchformspec = mem.switchformspec.."label[1.6,4.75;FIRE SVC]" +mem.switchformspec = mem.switchformspec..string.format("image_button[1.5,1.5;1.5,1;%s;fs2on;"..S("ON")..switchboilerplate.."]",fs2ontex) +mem.switchformspec = mem.switchformspec..string.format("image_button[1.5,2.5;1.5,1;%s;fs2hold;"..S("HOLD")..switchboilerplate.."]",fs2holdtex) +mem.switchformspec = mem.switchformspec..string.format("image_button[1.5,3.5;1.5,1;%s;fs2off;"..S("OFF")..switchboilerplate.."]",fs2offtex) +mem.switchformspec = mem.switchformspec.."label[1.6,4.75;"..S("FIRE SVC").."]" local indontex = mem.indsw and "celevator_button_rect_active.png" or "celevator_button_rect.png" local indofftex = (not mem.indsw) and "celevator_button_rect_active.png" or "celevator_button_rect.png" -mem.switchformspec = mem.switchformspec..string.format("image_button[4.5,1.5;1.5,1;%s;indon;ON;false;false;celevator_button_rect_active.png]",indontex) -mem.switchformspec = mem.switchformspec..string.format("image_button[4.5,3.5;1.5,1;%s;indoff;OFF;false;false;celevator_button_rect_active.png]",indofftex) -mem.switchformspec = mem.switchformspec.."label[4.6,4.75;IND SVC]" +mem.switchformspec = mem.switchformspec..string.format("image_button[4.5,1.5;1.5,1;%s;indon;"..S("ON")..switchboilerplate.."]",indontex) +mem.switchformspec = mem.switchformspec..string.format("image_button[4.5,3.5;1.5,1;%s;indoff;"..S("OFF")..switchboilerplate.."]",indofftex) +mem.switchformspec = mem.switchformspec.."label[4.6,4.75;"..S("IND SVC").."]" local lightontex = mem.lightsw and "celevator_button_rect_active.png" or "celevator_button_rect.png" local lightofftex = (not mem.lightsw) and "celevator_button_rect_active.png" or "celevator_button_rect.png" -mem.switchformspec = mem.switchformspec..string.format("image_button[1.5,5.5;1.5,1;%s;lighton;ON;false;false;celevator_button_rect_active.png]",lightontex) -mem.switchformspec = mem.switchformspec..string.format("image_button[1.5,7.5;1.5,1;%s;lightoff;OFF;false;false;celevator_button_rect_active.png]",lightofftex) -mem.switchformspec = mem.switchformspec.."label[1.6,8.75;CAR LIGHT]" +mem.switchformspec = mem.switchformspec..string.format("image_button[1.5,5.5;1.5,1;%s;lighton;"..S("ON")..switchboilerplate.."]",lightontex) +mem.switchformspec = mem.switchformspec..string.format("image_button[1.5,7.5;1.5,1;%s;lightoff;"..S("OFF")..switchboilerplate.."]",lightofftex) +mem.switchformspec = mem.switchformspec.."label[1.6,8.75;"..S("CAR LIGHT").."]" local fanontex = mem.fansw and "celevator_button_rect_active.png" or "celevator_button_rect.png" local fanofftex = (not mem.fansw) and "celevator_button_rect_active.png" or "celevator_button_rect.png" -mem.switchformspec = mem.switchformspec..string.format("image_button[4.5,5.5;1.5,1;%s;fanon;ON;false;false;celevator_button_rect_active.png]",fanontex) -mem.switchformspec = mem.switchformspec..string.format("image_button[4.5,7.5;1.5,1;%s;fanoff;OFF;false;false;celevator_button_rect_active.png]",fanofftex) -mem.switchformspec = mem.switchformspec.."label[4.6,8.75;CAR FAN]" +mem.switchformspec = mem.switchformspec..string.format("image_button[4.5,5.5;1.5,1;%s;fanon;"..S("ON")..switchboilerplate.."]",fanontex) +mem.switchformspec = mem.switchformspec..string.format("image_button[4.5,7.5;1.5,1;%s;fanoff;"..S("OFF")..switchboilerplate.."]",fanofftex) +mem.switchformspec = mem.switchformspec.."label[4.6,8.75;"..S("CAR FAN").."]" return pos,mem,changedinterrupts diff --git a/dbdkiosk.lua b/dbdkiosk.lua index c76a019..8fa9946 100644 --- a/dbdkiosk.lua +++ b/dbdkiosk.lua @@ -1,8 +1,9 @@ celevator.dbdkiosk = {} +local S = core.get_translator("celevator") + function celevator.dbdkiosk.checkprot(pos,name) if core.is_protected(pos,name) and not core.check_player_privs(name,{protection_bypass=true}) then - core.chat_send_player(name,"Can't open cabinet - cabinet is locked.") core.record_protection_violation(pos,name) return false end @@ -16,15 +17,15 @@ function celevator.dbdkiosk.updatefields(pos) if screenstate == "connect" then meta:set_string("formspec","formspec_version[7]".. "size[8,5]".. - "field[0.5,0.5;7,1;carid;Dispatcher ID;]".. - "field[0.5,2;7,1;landing;Landing Number;]".. - "button[3,3.5;2,1;save;Save]" + "field[0.5,0.5;7,1;carid;"..S("Dispatcher ID")..";]".. + "field[0.5,2;7,1;landing;"..S("Landing Number")..";]".. + "button[3,3.5;2,1;save;"..S("Save").."]" ) elseif screenstate == "main" then local landing = meta:get_int("landing") local fs = "formspec_version[7]" fs = fs.."size[8,14]" - fs = fs.."label[3,0.5;Please select a floor\\:]" + fs = fs.."label[3,0.5;"..core.formspec_escape(S("Please select a floor:")).."]" local floornames = core.deserialize(meta:get_string("floornames")) local floorsavailable = core.deserialize(meta:get_string("floorsavailable")) local showfloors = {} @@ -51,16 +52,16 @@ function celevator.dbdkiosk.updatefields(pos) elseif screenstate == "assignment" then local fs = "formspec_version[7]" fs = fs.."size[8,14]" - fs = fs.."label[3,3;Please use elevator]" + fs = fs.."label[3,3;"..S("Please use elevator").."]" fs = fs.."style_type[label;font_size=*4]" fs = fs.."label[3.5,5;"..meta:get_string("assignedcar").."]" meta:set_string("formspec",fs) elseif screenstate == "error" then local fs = "formspec_version[7]" fs = fs.."size[8,14]" - fs = fs.."label[3.5,0.5;ERROR]" - fs = fs.."label[2.5,3;Could not find a suitable elevator]" - fs = fs.."label[2.5,3.5;Please try again later]" + fs = fs.."label[3.5,0.5;"..S("ERROR").."]" + fs = fs.."label[2.5,3;"..S("Could not find a suitable elevator").."]" + fs = fs.."label[2.5,3.5;"..S("Please try again later").."]" meta:set_string("formspec",fs) end end @@ -146,7 +147,7 @@ function celevator.dbdkiosk.showassignment(pos,assignment) end core.register_node("celevator:dbdkiosk",{ - description = "Elevator Destination Entry Kiosk", + description = S("Elevator Destination Entry Kiosk"), drawtype = "nodebox", paramtype = "light", paramtype2 = "4dir", diff --git a/decorations.lua b/decorations.lua index c61379e..6070d8d 100644 --- a/decorations.lua +++ b/decorations.lua @@ -1,5 +1,7 @@ +local S = core.get_translator("celevator") + core.register_node("celevator:buffer_rubber",{ - description = "Elevator Elastomeric Buffer", + description = S("Elevator Elastomeric Buffer"), groups = { choppy = 1, bouncy = 60, @@ -40,7 +42,7 @@ core.register_node("celevator:buffer_rubber",{ }) core.register_node("celevator:buffer_oil",{ - description = "Elevator Oil-Filled Buffer", + description = S("Elevator Oil-Filled Buffer"), groups = { choppy = 1, }, @@ -97,7 +99,7 @@ core.register_node("celevator:buffer_oil",{ }) core.register_node("celevator:buffer_oil_top",{ - description = "Elevator Oil-Filled Buffer (top half - you hacker you!)", + description = S("Elevator Oil-Filled Buffer (top half - you hacker you!)"), groups = { choppy = 1, not_in_creative_inventory = 1, @@ -117,7 +119,7 @@ core.register_node("celevator:buffer_oil_top",{ }) core.register_node("celevator:guide_rail",{ - description = "Elevator Guide Rail", + description = S("Elevator Guide Rail"), groups = { choppy = 1, }, @@ -141,7 +143,7 @@ core.register_node("celevator:guide_rail",{ }) core.register_node("celevator:guide_rail_bracket",{ - description = "Elevator Guide Rail with Bracket", + description = S("Elevator Guide Rail with Bracket"), groups = { choppy = 1, }, @@ -170,7 +172,7 @@ core.register_node("celevator:guide_rail_bracket",{ }) core.register_node("celevator:tape",{ - description = "Elevator Positioning System Tape", + description = S("Elevator Positioning System Tape"), groups = { choppy = 1, }, @@ -195,7 +197,7 @@ core.register_node("celevator:tape",{ }) core.register_node("celevator:tape_magnets",{ - description = "Elevator Positioning System Tape with Magnets", + description = S("Elevator Positioning System Tape with Magnets"), groups = { choppy = 1, }, @@ -220,7 +222,7 @@ core.register_node("celevator:tape_magnets",{ }) core.register_node("celevator:tape_bracket",{ - description = "Elevator Positioning System Tape with Bracket", + description = S("Elevator Positioning System Tape with Bracket"), groups = { choppy = 1, }, @@ -312,7 +314,7 @@ core.register_abm({ }) core.register_node("celevator:tapehead",{ - description = "Elevator Positioning System Tapehead (off, you hacker you!)", + description = S("Elevator Positioning System Tapehead (off, you hacker you!)"), groups = { not_in_creative_inventory = 1, }, @@ -339,7 +341,7 @@ core.register_node("celevator:tapehead",{ }) core.register_node("celevator:tapehead_ulm",{ - description = "Elevator Positioning System Tapehead (ULM on, you hacker you!)", + description = S("Elevator Positioning System Tapehead (ULM on, you hacker you!)"), groups = { not_in_creative_inventory = 1, }, @@ -366,7 +368,7 @@ core.register_node("celevator:tapehead_ulm",{ }) core.register_node("celevator:tapehead_ulm_dz",{ - description = "Elevator Positioning System Tapehead (ULM and DZ on, you hacker you!)", + description = S("Elevator Positioning System Tapehead (ULM and DZ on, you hacker you!)"), groups = { not_in_creative_inventory = 1, }, @@ -393,7 +395,7 @@ core.register_node("celevator:tapehead_ulm_dz",{ }) core.register_node("celevator:tapehead_ulm_dlm_dz",{ - description = "Elevator Positioning System Tapehead (ULM, DLM, and DZ on, you hacker you!)", + description = S("Elevator Positioning System Tapehead (ULM, DLM, and DZ on, you hacker you!)"), groups = { not_in_creative_inventory = 1, }, @@ -420,7 +422,7 @@ core.register_node("celevator:tapehead_ulm_dlm_dz",{ }) core.register_node("celevator:tapehead_dlm_dz",{ - description = "Elevator Positioning System Tapehead (DLM and DZ on, you hacker you!)", + description = S("Elevator Positioning System Tapehead (DLM and DZ on, you hacker you!)"), groups = { not_in_creative_inventory = 1, }, @@ -447,7 +449,7 @@ core.register_node("celevator:tapehead_dlm_dz",{ }) core.register_node("celevator:tapehead_dlm",{ - description = "Elevator Positioning System Tapehead (DLM on, you hacker you!)", + description = S("Elevator Positioning System Tapehead (DLM on, you hacker you!)"), groups = { not_in_creative_inventory = 1, }, diff --git a/digilines.lua b/digilines.lua index 7cdcce9..d85e8ae 100644 --- a/digilines.lua +++ b/digilines.lua @@ -1,3 +1,5 @@ +local S = core.get_translator("celevator") + local function handledigilines(pos,node,channel,msg) local multi = node.name == "celevator:digilines_multi_io" if msg == "GET" then msg = {command = "GET"} end @@ -175,7 +177,7 @@ local function handledigilines(pos,node,channel,msg) end core.register_node("celevator:digilines_io",{ - description = "Elevator Digilines Input/Output", + description = S("Elevator Digilines Input/Output"), tiles = { "celevator_digilinesio_top.png", "celevator_cabinet_sides.png", @@ -201,9 +203,9 @@ core.register_node("celevator:digilines_io",{ after_place_node = function(pos) local meta = core.get_meta(pos) local fs = "formspec_version[7]size[8,4.5]" - fs = fs.."field[0.5,0.5;3,1;channel;Channel;${channel}]" - fs = fs.."field[4.5,0.5;3,1;carid;Car ID;${carid}]" - fs = fs.."button_exit[2.5,2;3,1;save;Save]" + fs = fs.."field[0.5,0.5;3,1;channel;"..S("Channel")..";${channel}]" + fs = fs.."field[4.5,0.5;3,1;carid;"..S("Car ID")..";${carid}]" + fs = fs.."button_exit[2.5,2;3,1;save;"..S("Save").."]" meta:set_string("formspec",fs) end, on_receive_fields = function(pos,_,fields,player) @@ -231,7 +233,7 @@ core.register_node("celevator:digilines_io",{ if dmode then if core.is_protected(carinfo.dispatcherpos,name) and not core.check_player_privs(name,{protection_bypass=true}) then if player:is_player() then - core.chat_send_player(name,"Can't connect to a dispatcher you don't have access to.") + core.chat_send_player(name,S("Can't connect to a dispatcher you don't have access to.")) core.record_protection_violation(carinfo.dispatcherpos,name) end return @@ -239,7 +241,7 @@ core.register_node("celevator:digilines_io",{ else if core.is_protected(carinfo.controllerpos,name) and not core.check_player_privs(name,{protection_bypass=true}) then if player:is_player() then - core.chat_send_player(name,"Can't connect to a controller you don't have access to.") + core.chat_send_player(name,S("Can't connect to a controller you don't have access to.")) core.record_protection_violation(carinfo.controllerpos,name) end return @@ -253,7 +255,7 @@ core.register_node("celevator:digilines_io",{ }) core.register_node("celevator:digilines_multi_io",{ - description = "Elevator Digilines Multi-Car Input/Output", + description = S("Elevator Digilines Multi-Car Input/Output"), tiles = { "celevator_digilinesio_multi_top.png", "celevator_cabinet_sides.png", @@ -281,7 +283,7 @@ core.register_node("celevator:digilines_multi_io",{ local name = player:get_player_name() if not (core.check_player_privs(name,{protection_bypass=true}) or core.check_player_privs(name,{server=true})) then if player:is_player() then - core.chat_send_player(name,"You need either the 'protection_bypass' or 'server' privilege to use this.") + core.chat_send_player(name,S("You need either the 'protection_bypass' or 'server' privilege to use this.")) core.record_protection_violation(pos,name) end core.remove_node(pos) @@ -289,8 +291,8 @@ core.register_node("celevator:digilines_multi_io",{ end local meta = core.get_meta(pos) local fs = "formspec_version[7]size[8,4.5]" - fs = fs.."field[0.5,0.5;7,1;channel;Channel;${channel}]" - fs = fs.."button_exit[2.5,2;3,1;save;Save]" + fs = fs.."field[0.5,0.5;7,1;channel;"..S("Channel")..";${channel}]" + fs = fs.."button_exit[2.5,2;3,1;save;"..S("Save").."]" meta:set_string("formspec",fs) end, on_receive_fields = function(pos,_,fields,player) @@ -299,7 +301,7 @@ core.register_node("celevator:digilines_multi_io",{ local name = player:get_player_name() if not (core.check_player_privs(name,{protection_bypass=true}) or core.check_player_privs(name,{server=true})) then if player:is_player() then - core.chat_send_player(name,"You need either the 'protection_bypass' or 'server' privilege to use this.") + core.chat_send_player(name,S("You need either the 'protection_bypass' or 'server' privilege to use this.")) core.record_protection_violation(pos,name) end return diff --git a/dispatcher.lua b/dispatcher.lua index 165db68..5a2cef5 100644 --- a/dispatcher.lua +++ b/dispatcher.lua @@ -1,5 +1,7 @@ celevator.dispatcher = {} +local S = core.get_translator("celevator") + celevator.dispatcher.iqueue = core.deserialize(celevator.storage:get_string("dispatcher_iqueue")) or {} celevator.dispatcher.equeue = core.deserialize(celevator.storage:get_string("dispatcher_equeue")) or {} @@ -17,7 +19,7 @@ core.register_chatcommand("celevator_reloaddispatcher",{ local newfw,loaderr = loadfile(core.get_modpath("celevator").."/dispatcherfw.lua") if newfw then fw = newfw - return true,"Firmware reloaded successfully" + return true,S("Firmware reloaded successfully") else return false,loaderr end @@ -31,14 +33,14 @@ local function after_place(pos,placer) local placername = placer:get_player_name() if topnode.name ~= "air" then if placer:is_player() then - core.chat_send_player(placername,"Can't place cabinet - no room for the top half!") + core.chat_send_player(placername,S("Can't place cabinet - no room for the top half!")) end core.set_node(pos,{name="air"}) return true end if core.is_protected(toppos,placername) and not core.check_player_privs(placername,{protection_bypass=true}) then if placer:is_player() then - core.chat_send_player(placername,"Can't place cabinet - top half is protected!") + core.chat_send_player(placername,S("Can't place cabinet - top half is protected!")) core.record_protection_violation(toppos,placername) end core.set_node(pos,{name="air"}) @@ -94,13 +96,13 @@ local function candig(_,player) if controls.sneak then return true else - core.chat_send_player(player:get_player_name(),"Hold the sneak button while digging to remove.") + core.chat_send_player(player:get_player_name(),S("Hold the sneak button while digging to remove.")) return false end end core.register_node("celevator:dispatcher",{ - description = "Elevator Dispatcher", + description = S("Elevator Dispatcher"), groups = { cracky = 1, }, @@ -150,7 +152,7 @@ core.register_node("celevator:dispatcher",{ end local name = puncher:get_player_name() if core.is_protected(pos,name) and not core.check_player_privs(name,{protection_bypass=true}) then - core.chat_send_player(name,"Can't open cabinet - cabinet is locked.") + core.chat_send_player(name,S("Can't open cabinet - cabinet is locked.")) core.record_protection_violation(pos,name) return end @@ -171,7 +173,7 @@ core.register_node("celevator:dispatcher",{ }) core.register_node("celevator:dispatcher_open",{ - description = "Dispatcher (door open - you hacker you!)", + description = S("Dispatcher (door open - you hacker you!)"), groups = { cracky = 1, not_in_creative_inventory = 1, @@ -231,7 +233,7 @@ core.register_node("celevator:dispatcher_open",{ }) core.register_node("celevator:dispatcher_top",{ - description = "Dispatcher (top section - you hacker you!)", + description = S("Dispatcher (top section - you hacker you!)"), groups = { not_in_creative_inventory = 1, }, @@ -262,7 +264,7 @@ core.register_node("celevator:dispatcher_top",{ }) core.register_node("celevator:dispatcher_top_open",{ - description = "Dispatcher (top section, open - you hacker you!)", + description = S("Dispatcher (top section, open - you hacker you!)"), groups = { not_in_creative_inventory = 1, }, @@ -308,7 +310,7 @@ function celevator.dispatcher.finish(pos,mem,changedinterrupts) local carinfo = core.deserialize(celevator.storage:get_string(string.format("car%d",carid))) local carinfodirty = false if not carinfo then - core.log("error","[celevator] [controller] Bad car info for dispatcher at "..core.pos_to_string(pos)) + core.log("error",string.format("[celevator] [dispatcher] Bad car info for dispatcher at %s",core.pos_to_string(pos))) return end local node = celevator.get_node(pos) @@ -384,8 +386,10 @@ function celevator.dispatcher.run(pos,event) table.insert(celevator.dispatcher.equeue[hash],event) celevator.storage:set_string("dispatcher_equeue",core.serialize(celevator.dispatcher.equeue)) if #celevator.dispatcher.equeue[hash] > 20 then - local message = "[celevator] [dispatcher] Async process for dispatcher at %s is falling behind, %d events in queue" - core.log("warning",string.format(message,core.pos_to_string(pos),#celevator.dispatcher.equeue[hash])) + local pstring = core.pos_to_string(pos) + local queuelen = #celevator.dispatcher.equeue[hash] + local message = string.format("[celevator] [dispatcher] Async process for dispatcher at %s is falling behind, %d events in queue",pstring,queuelen) + core.log("warning",message) end return end @@ -393,7 +397,7 @@ function celevator.dispatcher.run(pos,event) local meta = core.get_meta(pos) local mem = core.deserialize(meta:get_string("mem")) if not mem then - core.log("error","[celevator] [controller] Failed to load dispatcher memory at "..core.pos_to_string(pos)) + core.log("error",string.format("[celevator] [dispatcher] Failed to load dispatcher memory at %s",core.pos_to_string(pos))) return end mem.interrupts = celevator.dispatcher.iqueue[core.hash_node_position(pos)] or {} diff --git a/dispatcherfw.lua b/dispatcherfw.lua index ef891a6..d54c4e1 100644 --- a/dispatcherfw.lua +++ b/dispatcherfw.lua @@ -1,5 +1,7 @@ local pos,event,mem = ... +local S = core.get_translator("celevator") + local changedinterrupts = {} local function interrupt(time,iid) @@ -930,134 +932,138 @@ fs("background9[0,0;16,12;celevator_fs_bg.png;true;3]") if mem.screenstate == "oobe_welcome" then fs("image[6,1;4,2;celevator_logo.png]") - fs("label[1,4;Welcome to your new MTronic XT elevator dispatcher!]") - fs("label[1,4.5;Before continuing, make sure you have at least two controllers in group operation mode and ready to connect.]") - fs("label[1,5.5;Press Next to begin.]") - fs("button[1,10;2,1;license;License Info]") - fs("button[13,10;2,1;next;Next >]") + fs("label[1,4;"..S("Welcome to your new MTronic XT elevator dispatcher!").."]") + fs("label[1,4.5;"..S("Before continuing, make sure you have at least two controllers in group operation mode and ready to connect.").."]") + fs("label[1,5.5;"..S("Press Next to begin.").."]") + fs("button[1,10;3,1;license;"..S("License Info").."]") + fs("button[13,10;2,1;next;"..S("Next >").."]") elseif mem.screenstate == "oobe_license" then local licensefile = io.open(core.get_modpath("celevator").."/LICENSE") local license = core.formspec_escape(licensefile:read("*all")) licensefile:close() - fs("textarea[1,1;14,8;license;This applies to the whole celevator mod\\, not just this dispatcher:;"..license.."]") + fs("textarea[1,1;14,8;license;"..core.formspec_escape(S("This applies to the whole celevator mod, not just this dispatcher:"))..";"..license.."]") fs("button[7,10.5;2,1;back;OK]") elseif mem.screenstate == "oobe_floortable" or mem.screenstate == "floortable" then if mem.screenstate == "oobe_floortable" then - fs("label[1,1;Enter details of all floors this group will serve, then press Next.]") - fs("label[1,1.3;Include all floors served by any car in the group, even if not served by all cars.]") - fs("button[1,10;2,1;back;< Back]") - fs("button[13,10;2,1;next;Next >]") + fs("label[1,1;"..S("Enter details of all floors this group will serve, then press Next.").."]") + fs("label[1,1.3;"..S("Include all floors served by any car in the group, even if not served by all cars.").."]") + fs("button[1,10;2,1;back;"..S("< Back").."]") + fs("button[13,10;2,1;next;"..S("Next >").."]") else - fs("label[1,1;EDIT FLOOR TABLE]") - fs("button[1,10;2,1;next;Done]") + fs("label[1,1;"..S("EDIT FLOOR TABLE").."]") + fs("button[1,10;2,1;next;"..S("Done").."]") end fs("textlist[1,2;6,7;floor;") for i=#mem.params.floornames,1,-1 do - fs(core.formspec_escape(string.format("%d - Height: %d - PI: %s",i,mem.params.floorheights[i],mem.params.floornames[i]))..(i==1 and "" or ",")) + local floortext = S("@1 - Height: @2 - PI: @3",i,mem.params.floorheights[i],mem.params.floornames[i]) + fs(core.formspec_escape(floortext)..(i==1 and "" or ",")) end fs(";"..tostring(#mem.params.floornames-mem.editingfloor+1)..";false]") - if #mem.params.floornames < 100 then fs("button[8,2;2,1;add;New Floor]") end - fs("button[8,3.5;2,1;edit;Edit Floor]") - if #mem.params.floornames > 2 then fs("button[8,5;2,1;remove;Remove Floor]") end - if mem.editingfloor < #mem.params.floornames then fs("button[8,6.5;2,1;moveup;Move Up]") end - if mem.editingfloor > 1 then fs("button[8,8;2,1;movedown;Move Down") end + if #mem.params.floornames < 100 then fs("button[8,2;2,1;add;"..S("New Floor").."]") end + fs("button[8,3.5;2,1;edit;"..S("Edit Floor").."]") + if #mem.params.floornames > 2 then fs("button[8,5;2,1;remove;"..S("Remove Floor").."]") end + if mem.editingfloor < #mem.params.floornames then fs("button[8,6.5;2,1;moveup;"..S("Move Up").."]") end + if mem.editingfloor > 1 then fs("button[8,8;2,1;movedown;"..S("Move Down").."]") end elseif mem.screenstate == "oobe_floortable_edit" or mem.screenstate == "floortable_edit" then if mem.screenstate == "oobe_floortable_edit" then - fs("button[7,10.5;2,1;back;OK]") - fs("label[1,5;The Floor Height is the distance (in meters/nodes) from the floor level of this floor to the floor level of the next floor.]") - fs("label[1,5.5;(not used at the highest floor)]") - fs("label[1,6.5;The Floor Name is how the floor will be displayed on the position indicators.]") + fs("button[7,10.5;2,1;back;"..S("OK").."]") + local help1 = S("The Floor Height is the distance (in meters/nodes) from the floor level of this floor to the floor level of the next floor.") + local help2 = S("(not used at the highest floor)") + local help3 = S("The Floor Name is how the floor will be displayed on the position indicators.") + fs("label[1,5;"..help1.."]") + fs("label[1,5.5;"..help2.."]") + fs("label[1,6.5;"..help3.."]") else - fs("button[7,10.5;2,1;save;Save]") + fs("button[7,10.5;2,1;save;"..S("Save").."]") end - fs("label[1,1;Editing floor "..tostring(mem.editingfloor).."]") - fs("field[1,3;3,1;height;Floor Height;"..tostring(mem.params.floorheights[mem.editingfloor]).."]") - fs("field[5,3;3,1;name;Floor Name;"..core.formspec_escape(mem.params.floornames[mem.editingfloor]).."]") + fs("label[1,1;"..S("Editing Floor @1",tostring(mem.editingfloor)).."]") + fs("field[1,3;3,1;height;"..S("Floor Height")..";"..tostring(mem.params.floorheights[mem.editingfloor]).."]") + fs("field[5,3;3,1;name;"..S("Floor Name")..";"..core.formspec_escape(mem.params.floornames[mem.editingfloor]).."]") elseif mem.screenstate == "oobe_connections" or mem.screenstate == "connections" then if mem.screenstate == "oobe_connections" then - fs("label[1,1;Connect to each car in the group, then click Done.]") - fs("button[1,10;2,1;back;< Back]") - if #mem.params.carids > 0 then fs("button[13,10;2,1;next;Done >]") end + fs("label[1,1;"..S("Connect to each car in the group, then click Done.").."]") + fs("button[1,10;2,1;back;"..S("< Back").."]") + if #mem.params.carids > 0 then fs("button[13,10;2,1;next;"..S("Done").."]") end else - fs("label[1,1;EDIT CONNECTIONS]") - if #mem.params.carids > 0 then fs("button[1,10;2,1;next;Done]") end + fs("label[1,1;"..S("EDIT CONNECTIONS").."]") + if #mem.params.carids > 0 then fs("button[1,10;2,1;next;"..S("Done").."]") end end if #mem.params.carids > 0 then fs("textlist[1,2;6,7;connection;") for i=#mem.params.carids,1,-1 do - fs(string.format("Car %d - ID #%d",i,mem.params.carids[i])..(i==1 and "" or ",")) + local connectiontext = S("Car @1 - ID #@2",i,mem.params.carids[i]) + fs(connectiontext..(i==1 and "" or ",")) end fs(";"..tostring(#mem.params.carids-mem.editingconnection+1)..";false]") else - fs("label[1,2;No Connections]") + fs("label[1,2;"..S("No Connections").."]") end - if #mem.params.carids < 16 then fs("button[8,2;3,1;add;New Connection]") end - if #mem.params.carids > 0 then fs("button[8,3.5;3,1;edit;Edit Connection]") end - if #mem.params.carids > 0 then fs("button[8,5;3,1;remove;Remove Connection]") end + if #mem.params.carids < 16 then fs("button[8,2;3,1;add;"..S("New Connection").."]") end + if #mem.params.carids > 0 then fs("button[8,3.5;3,1;edit;"..S("Edit Connection").."]") end + if #mem.params.carids > 0 then fs("button[8,5;3,1;remove;"..S("Remove Connection").."]") end elseif mem.screenstate == "oobe_newconnection" or mem.screenstate == "newconnection" then local numfloors = 0 for _,v in ipairs(mem.newconnfloors) do if v then numfloors = numfloors + 1 end end if mem.screenstate == "oobe_newconnection" then - fs("label[1,1;Enter the car ID and select the floors served (click them to toggle), then click Connect.]") - fs("label[1,1.3;You must select at least two floors.]") - fs("button[1,10;2,1;back;< Back]") - if numfloors >= 2 then fs("button[13,10;2,1;connect;Connect >]") end + fs("label[1,1;"..S("Enter the car ID and select the floors served (click them to toggle), then click Connect.").."]") + fs("label[1,1.3;"..S("You must select at least two floors.").."]") + fs("button[1,10;2,1;back;"..S("< Back").."]") + if numfloors >= 2 then fs("button[13,10;2,1;connect;"..S("Connect").."]") end else - fs("label[1,1;NEW CONNECTION]") - fs("button[1,10;2,1;back;Back]") - if numfloors >= 2 then fs("button[13,10;2,1;connect;Connect]") end + fs("label[1,1;"..S("NEW CONNECTION").."]") + fs("button[1,10;2,1;back;"..S("Back").."]") + if numfloors >= 2 then fs("button[13,10;2,1;connect;"..S("Connect").."]") end end fs("textlist[8,2;6,7;floors;") for i=#mem.params.floornames,1,-1 do - fs(string.format("%s - %s",core.formspec_escape(mem.params.floornames[i]),mem.newconnfloors[i] and "YES" or "NO")..(i==1 and "" or ",")) + fs(string.format("%s - %s",core.formspec_escape(mem.params.floornames[i]),mem.newconnfloors[i] and S("YES") or S("NO"))..(i==1 and "" or ",")) end fs(";0;false]") - fs("field[2,3;4,1;carid;Car ID;]") + fs("field[2,3;4,1;carid;"..S("Car ID")..";]") elseif mem.screenstate == "oobe_connection" or mem.screenstate == "connection" then local numfloors = 0 for _,v in ipairs(mem.newconnfloors) do if v then numfloors = numfloors + 1 end end if mem.screenstate == "oobe_newconnection" then - fs("label[1,1;Enter the car ID and select the floors served (click them to toggle), then click Connect.]") - fs("label[1,1.3;You must select at least two floors.]") - fs("button[1,10;2,1;back;< Back]") - if numfloors >= 2 then fs("button[13,10;2,1;save;Save >]") end + fs("label[1,1;"..S("Enter the car ID and select the floors served (click them to toggle), then click Connect.").."]") + fs("label[1,1.3;"..S("You must select at least two floors.").."]") + fs("button[1,10;2,1;back;"..S("< Back").."]") + if numfloors >= 2 then fs("button[13,10;2,1;save;"..S("Save").."]") end else - fs("label[1,1;EDIT CONNECTION]") - fs("button[1,10;2,1;back;< Back]") - if numfloors >= 2 then fs("button[13,10;2,1;save;Save >]") end + fs("label[1,1;"..S("EDIT CONNECTION").."]") + fs("button[1,10;2,1;back;"..S("< Back").."]") + if numfloors >= 2 then fs("button[13,10;2,1;save;"..S("Save").."]") end end fs("textlist[8,2;6,7;floors;") for i=#mem.params.floornames,1,-1 do - fs(string.format("%s - %s",core.formspec_escape(mem.params.floornames[i]),mem.newconnfloors[i] and "YES" or "NO")..(i==1 and "" or ",")) + fs(string.format("%s - %s",core.formspec_escape(mem.params.floornames[i]),mem.newconnfloors[i] and S("YES") or S("NO"))..(i==1 and "" or ",")) end fs(";0;false]") - fs("label[2,3;Car ID: "..mem.params.carids[mem.editingconnection].."]") + fs("label[2,3;"..S("Car ID: @1",mem.params.carids[mem.editingconnection]).."]") elseif mem.screenstate == "oobe_connecting" or mem.screenstate == "connecting" then - fs("label[1,1;Connecting to controller...]") + fs("label[1,1;"..S("Connecting to controller...").."]") elseif mem.screenstate == "oobe_connectionfailed" or mem.screenstate == "connectionfailed" then - fs("label[4,4;Connection timed out!]") - fs("label[4,5;Make sure the car ID is correct and]") - fs("label[4,5.5;that the controller is ready to pair.]") - fs("button[1,10;2,1;back;< Back]") + fs("label[4,4;"..S("Connection timed out!").."]") + fs("label[4,5;"..S("Make sure the car ID is correct and\nthat the controller is ready to connect.").."]") + fs("button[1,10;2,1;back;"..S("< Back").."]") elseif mem.screenstate == "status" then if not mem.screenpage then mem.screenpage = 1 end - fs("label[1,1;GROUP DISPLAY]") + fs("label[1,1;"..S("GROUP DISPLAY").."]") fs("box[1.5,1.5;0.1,10;#AAAAAAFF]") fs("box[18.5,1.5;0.1,10;#AAAAAAFF]") - fs("label[0.55,11.5;UP]") - fs("label[18.85,11.5;DOWN]") - fs("button[15,0.5;2,1;menu;Menu]") + fs("label[0.55,11.5;^]") + fs("label[19.2,11.5;v]") + fs("button[15,0.5;2,1;menu;"..S("Menu").."]") fs("style_type[image_button;font=mono;font_size=*0.75]") for car=1,#mem.params.carids,1 do local xp = 1.7+(car-1) local carid = mem.params.carids[car] local carstate = mem.carstatus[carid].state - fs(string.format("label[%f,11;CAR %d]",xp,car)) - fs(string.format("label[%f,11.35;%s]",xp+0.1,core.colorize("#ff5555",(carstate == "normal" and " IN" or "OUT")))) + fs(string.format("label[%f,11;%s]",xp,S("CAR @1",car))) + fs(string.format("label[%f,11.35;%s]",xp+0.1,core.colorize("#ff5555",(carstate == "normal" and S(" IN") or S("OUT"))))) end local lowestfloor = (mem.screenpage-1)*10+1 for i=1,math.min(10,#mem.params.floornames-lowestfloor+1),1 do @@ -1108,12 +1114,12 @@ elseif mem.screenstate == "status" then fs("image_button[5,0.5;0.75,0.75;celevator_menu_arrow.png;scrollup;;false;false;celevator_menu_arrow.png]") end elseif mem.screenstate == "menu" then - fs("label[1,1;MAIN MENU]") - fs("button[1,3;3,1;floortable;Edit Floor Table]") - fs("button[1,4.5;3,1;connections;Edit Connections]") - fs("button[1,10;3,1;back;< Back]") + fs("label[1,1;"..S("MAIN MENU").."]") + fs("button[1,3;3,1;floortable;"..S("Edit Floor Table").."]") + fs("button[1,4.5;3,1;connections;"..S("Edit Connections").."]") + fs("button[1,10;3,1;back;"..S("< Back").."]") end -mem.infotext = string.format("ID: %d",mem.carid) +mem.infotext = S("ID: @1",mem.carid) return pos,mem,changedinterrupts diff --git a/doors.lua b/doors.lua index 3d2e0e3..e79aeb5 100644 --- a/doors.lua +++ b/doors.lua @@ -1,5 +1,7 @@ celevator.doors = {} +local S = core.get_translator("celevator") + celevator.doors.erefs = {} --These get overwritten on globalstep and aren't settings. @@ -24,7 +26,7 @@ local function placesill(pos,node) end core.register_node("celevator:hwdoor_fast_glass_bottom",{ - description = "Glass Hoistway Door (fast, bottom - you hacker you!)", + description = S("Glass Hoistway Door (fast, bottom - you hacker you!)"), tiles = { "celevator_transparent.png", "celevator_door_glass_edge.png", @@ -76,7 +78,7 @@ core.register_node("celevator:hwdoor_fast_glass_bottom",{ }) core.register_node("celevator:hwdoor_fast_glass_middle",{ - description = "Glass Hoistway Door (fast, middle - you hacker you!)", + description = S("Glass Hoistway Door (fast, middle - you hacker you!)"), tiles = { "celevator_transparent.png", "celevator_transparent.png", @@ -102,7 +104,7 @@ core.register_node("celevator:hwdoor_fast_glass_middle",{ }) core.register_node("celevator:hwdoor_fast_glass_top",{ - description = "Glass Hoistway Door (fast, top - you hacker you!)", + description = S("Glass Hoistway Door (fast, top - you hacker you!)"), tiles = { "celevator_door_glass_edge.png", "celevator_transparent.png", @@ -128,7 +130,7 @@ core.register_node("celevator:hwdoor_fast_glass_top",{ }) core.register_node("celevator:hwdoor_slow_glass_bottom",{ - description = "Glass Hoistway Door (slow, bottom - you hacker you!)", + description = S("Glass Hoistway Door (slow, bottom - you hacker you!)"), tiles = { "celevator_transparent.png", "celevator_door_glass_edge.png", @@ -154,7 +156,7 @@ core.register_node("celevator:hwdoor_slow_glass_bottom",{ }) core.register_node("celevator:hwdoor_slow_glass_middle",{ - description = "Glass Hoistway Door (slow, middle - you hacker you!)", + description = S("Glass Hoistway Door (slow, middle - you hacker you!)"), tiles = { "celevator_transparent.png", "celevator_transparent.png", @@ -180,7 +182,7 @@ core.register_node("celevator:hwdoor_slow_glass_middle",{ }) core.register_node("celevator:hwdoor_slow_glass_top",{ - description = "Glass Hoistway Door (slow, top - you hacker you!)", + description = S("Glass Hoistway Door (slow, top - you hacker you!)"), tiles = { "celevator_door_glass_edge.png", "celevator_transparent.png", @@ -206,7 +208,7 @@ core.register_node("celevator:hwdoor_slow_glass_top",{ }) core.register_node("celevator:hwdoor_fast_steel_bottom",{ - description = "Steel Hoistway Door (fast, bottom - you hacker you!)", + description = S("Steel Hoistway Door (fast, bottom - you hacker you!)"), tiles = { "celevator_transparent.png", "celevator_door_glass_edge.png", @@ -257,7 +259,7 @@ core.register_node("celevator:hwdoor_fast_steel_bottom",{ }) core.register_node("celevator:hwdoor_fast_steel_middle",{ - description = "Steel Hoistway Door (fast, middle - you hacker you!)", + description = S("Steel Hoistway Door (fast, middle - you hacker you!)"), tiles = { "celevator_transparent.png", "celevator_transparent.png", @@ -282,7 +284,7 @@ core.register_node("celevator:hwdoor_fast_steel_middle",{ }) core.register_node("celevator:hwdoor_fast_steel_top",{ - description = "Steel Hoistway Door (fast, top - you hacker you!)", + description = S("Steel Hoistway Door (fast, top - you hacker you!)"), tiles = { "celevator_door_glass_edge.png", "celevator_transparent.png", @@ -307,7 +309,7 @@ core.register_node("celevator:hwdoor_fast_steel_top",{ }) core.register_node("celevator:hwdoor_slow_steel_bottom",{ - description = "Steel Hoistway Door (slow, bottom - you hacker you!)", + description = S("Steel Hoistway Door (slow, bottom - you hacker you!)"), tiles = { "celevator_transparent.png", "celevator_door_glass_edge.png", @@ -332,7 +334,7 @@ core.register_node("celevator:hwdoor_slow_steel_bottom",{ }) core.register_node("celevator:hwdoor_slow_steel_middle",{ - description = "Steel Hoistway Door (slow, middle - you hacker you!)", + description = S("Steel Hoistway Door (slow, middle - you hacker you!)"), tiles = { "celevator_transparent.png", "celevator_transparent.png", @@ -357,7 +359,7 @@ core.register_node("celevator:hwdoor_slow_steel_middle",{ }) core.register_node("celevator:hwdoor_slow_steel_top",{ - description = "Steel Hoistway Door (slow, top - you hacker you!)", + description = S("Steel Hoistway Door (slow, top - you hacker you!)"), tiles = { "celevator_door_glass_edge.png", "celevator_transparent.png", @@ -382,7 +384,7 @@ core.register_node("celevator:hwdoor_slow_steel_top",{ }) core.register_node("celevator:hwdoor_placeholder",{ - description = "Hoistway Door Open-State Placeholder (you hacker you!)", + description = S("Hoistway Door Open-State Placeholder (you hacker you!)"), groups = { not_in_creative_inventory = 1, }, @@ -854,7 +856,7 @@ core.register_abm({ }) core.register_node("celevator:hwdoor_glass",{ - description = "Glass Elevator Hoistway Door", + description = S("Glass Elevator Hoistway Door"), paramtype2 = "4dir", buildable_to = true, inventory_image = "celevator_door_glass_inventory.png", @@ -880,17 +882,18 @@ core.register_node("celevator:hwdoor_glass",{ } for x=0,1,1 do for y=0,2,1 do - local offsetdesc = string.format("%dm to the right and %dm up",x,y) local placeoffset = vector.new(x,y,0) local placepos = vector.add(pos,vector.rotate_around_axis(placeoffset,vector.new(0,1,0),facedir)) local replaces = core.get_node(placepos).name if not (core.registered_nodes[replaces] and core.registered_nodes[replaces].buildable_to) then - core.chat_send_player(name,string.format("Can't place door here - position %s is blocked!",offsetdesc)) + local errormsg = S("Can't place door here - position @1m to the right and @2m up is blocked!",x,y) + core.chat_send_player(name,errormsg) core.remove_node(pos) return true end if core.is_protected(placepos,name) and not core.check_player_privs(name,{protection_bypass=true}) then - core.chat_send_player(name,string.format("Can't place door here - position %s is protected!",offsetdesc)) + local errormsg = S("Can't place door here - position @1m to the right and @2m up is protected!",x,y) + core.chat_send_player(name,errormsg) core.record_protection_violation(placepos,name) core.remove_node(pos) return true @@ -918,7 +921,7 @@ core.register_node("celevator:hwdoor_glass",{ }) core.register_node("celevator:hwdoor_steel",{ - description = "Steel Elevator Hoistway Door", + description = S("Steel Elevator Hoistway Door"), paramtype2 = "4dir", buildable_to = true, inventory_image = "celevator_door_metal_inventory.png", @@ -944,17 +947,18 @@ core.register_node("celevator:hwdoor_steel",{ } for x=0,1,1 do for y=0,2,1 do - local offsetdesc = string.format("%dm to the right and %dm up",x,y) local placeoffset = vector.new(x,y,0) local placepos = vector.add(pos,vector.rotate_around_axis(placeoffset,vector.new(0,1,0),facedir)) local replaces = core.get_node(placepos).name if not (core.registered_nodes[replaces] and core.registered_nodes[replaces].buildable_to) then - core.chat_send_player(name,string.format("Can't place door here - position %s is blocked!",offsetdesc)) + local errormsg = S("Can't place door here - position @1m to the right and @2m up is blocked!",x,y) + core.chat_send_player(name,errormsg) core.remove_node(pos) return true end if core.is_protected(placepos,name) and not core.check_player_privs(name,{protection_bypass=true}) then - core.chat_send_player(name,string.format("Can't place door here - position %s is protected!",offsetdesc)) + local errormsg = S("Can't place door here - position @1m to the right and @2m up is protected!",x,y) + core.chat_send_player(name,errormsg) core.record_protection_violation(placepos,name) core.remove_node(pos) return true @@ -982,7 +986,7 @@ core.register_node("celevator:hwdoor_steel",{ }) core.register_node("celevator:door_sill_single",{ - description = "Hoistway Door Sill, Single Track (you hacker you!)", + description = S("Hoistway Door Sill, Single Track (you hacker you!)"), drop = "", groups = { not_in_creative_inventory = 1, @@ -1002,7 +1006,7 @@ core.register_node("celevator:door_sill_single",{ }) core.register_node("celevator:door_sill_double",{ - description = "Hoistway Door Sill, Double Track (you hacker you!)", + description = S("Hoistway Door Sill, Double Track (you hacker you!)"), drop = "", groups = { not_in_creative_inventory = 1, diff --git a/drive_entity.lua b/drive_entity.lua index e1c10cd..e2d2655 100644 --- a/drive_entity.lua +++ b/drive_entity.lua @@ -1,6 +1,8 @@ +local S = core.get_translator("celevator") + celevator.drives.entity = { - name = "Drive", - description = "Normal entity-based drive", + name = S("Elevator Drive"), + description = S("Normal entity-based drive"), nname = "celevator:drive", buzzsoundhandles = {}, movementsoundhandles = {}, @@ -17,19 +19,23 @@ local playerposlimits = {} local function update_ui(pos) local meta = core.get_meta(pos) local apos = tonumber(meta:get_string("apos")) or 0 - local status = "Idle" + local status local vel = tonumber(meta:get_string("vel")) or 0 local state = meta:get_string("state") + local velstr = string.format("%0.02f",math.abs(vel)) + local aposstr = string.format("%0.02f",apos) if state == "running" and vel > 0 then - status = string.format("Running: Up, %0.02f m/s",vel) + status = S("Drive - Running: Up, @1m/s - Position: @2m",velstr,aposstr) elseif state == "running" and vel < 0 then - status = string.format("Running: Down, %0.02f m/s",math.abs(vel)) + status = S("Drive - Running: Down, @1m/s - Position: @2m",velstr,aposstr) elseif state == "fakerunning" and vel > 0 then - status = string.format("Running (simulated): Up, %0.02f m/s",vel) + status = S("Drive - Running (simulated): Up, @1m/s - Position: @2m",velstr,aposstr) elseif state == "fakerunning" and vel < 0 then - status = string.format("Running (simulated): Down, %0.02f m/s",math.abs(vel)) + status = S("Drive - Running (simulated): Down, @1m/s - Position: @2m",velstr,aposstr) + else + status = S("Drive - Idle") end - meta:set_string("infotext",string.format("Drive - %s - Position: %0.02f m",status,apos)) + meta:set_string("infotext",status) end local function playbuzz(pos) @@ -183,7 +189,7 @@ local function decelsound(pos) end core.register_node("celevator:drive",{ - description = "Elevator "..celevator.drives.entity.name, + description = celevator.drives.entity.name, groups = { cracky = 1, _celevator_drive = 1, @@ -854,7 +860,7 @@ local function updatecarpos(pos) if carpos then meta:set_string("origin",core.pos_to_string(carpos)) celevator.get_meta(carpos):set_string("machinepos",core.pos_to_string(pos)) - meta:set_string("infotext",string.format("Using car with origin %s",core.pos_to_string(carpos))) + meta:set_string("infotext",S("Using car with origin @1",core.pos_to_string(carpos))) local carid = meta:get_int("carid") local carinfo = core.deserialize(celevator.storage:get_string(string.format("car%d",carid))) if not (carinfo and carinfo.controllerpos) then return end @@ -876,12 +882,12 @@ local function updatecarpos(pos) carmeta:set_int("carid",carid) end else - meta:set_string("infotext","No car found! Punch to try again") + meta:set_string("infotext",S("No car found! Punch to try again")) end end core.register_node("celevator:machine",{ - description = "Elevator Hoist Machine", + description = S("Elevator Hoist Machine"), groups = { dig_immediate = 2, _celevator_machine = 1, @@ -936,29 +942,29 @@ core.register_node("celevator:machine",{ local sheavereplaces = core.get_node(sheavepos).name local name = player:get_player_name() if not (core.registered_nodes[motorreplaces] and core.registered_nodes[motorreplaces].buildable_to) then - core.chat_send_player(name,"Can't place machine here - no room for the motor (to the left)!") + core.chat_send_player(name,S("Can't place machine here - no room for the motor (to the left)!")) core.remove_node(pos) return true end if core.is_protected(motorpos,name) and not core.check_player_privs(name,{protection_bypass=true}) then - core.chat_send_player(name,"Can't place machine here - space for the motor (to the left) is protected!") + core.chat_send_player(name,S("Can't place machine here - space for the motor (to the left) is protected!")) core.record_protection_violation(motorpos,name) core.remove_node(pos) return true end if not (core.registered_nodes[sheavereplaces] and core.registered_nodes[sheavereplaces].buildable_to) then - core.chat_send_player(name,"Can't place machine here - no room for the sheave (in front)!") + core.chat_send_player(name,S("Can't place machine here - no room for the sheave (in front)!")) core.remove_node(pos) return true end if core.is_protected(sheavepos,name) and not core.check_player_privs(name,{protection_bypass=true}) then - core.chat_send_player(name,"Can't place machine here - space for the sheave (in front) is protected!") + core.chat_send_player(name,S("Can't place machine here - space for the sheave (in front) is protected!")) core.record_protection_violation(sheavepos,name) core.remove_node(pos) return true end local meta = core.get_meta(pos) - meta:set_string("formspec","formspec_version[7]size[8,5]field[0.5,0.5;7,1;carid;Car ID;]button[3,3.5;2,1;save;Save]") + meta:set_string("formspec","formspec_version[7]size[8,5]field[0.5,0.5;7,1;carid;"..S("Car ID")..";]button[3,3.5;2,1;save;"..S("Save").."]") core.set_node(motorpos,{name="celevator:motor",param2=newnode.param2}) core.set_node(sheavepos,{name="celevator:sheave",param2=newnode.param2}) end, @@ -1008,7 +1014,7 @@ core.register_node("celevator:machine",{ }) core.register_node("celevator:motor",{ - description = "Hoist Motor (you hacker you!)", + description = S("Hoist Motor (you hacker you!)"), groups = { not_in_creative_inventory = 1, }, @@ -1042,7 +1048,7 @@ core.register_node("celevator:motor",{ }) core.register_node("celevator:sheave",{ - description = "Sheave (you hacker you!)", + description = S("Sheave (you hacker you!)"), groups = { not_in_creative_inventory = 1, }, @@ -1075,7 +1081,7 @@ core.register_node("celevator:sheave",{ }) core.register_node("celevator:sheave_centered",{ - description = "Centered Sheave (you hacker you!)", + description = S("Centered Sheave (you hacker you!)"), groups = { not_in_creative_inventory = 1, }, diff --git a/drive_null.lua b/drive_null.lua index e0607b6..e2eb1f4 100644 --- a/drive_null.lua +++ b/drive_null.lua @@ -1,6 +1,8 @@ +local S = core.get_translator("celevator") + celevator.drives.null = { - name = "Null Drive", - description = "Simulation only, no movement, for testing and demonstration", + name = S("Null Drive"), + description = S("Simulation only, no movement, for testing and demonstration"), nname = "celevator:drive_null", soundhandles = {}, step_enabled = true, --Not a setting, is overwritten on globalstep, true here to check for running drives on startup @@ -9,14 +11,18 @@ celevator.drives.null = { local function update_ui(pos) local meta = core.get_meta(pos) local apos = tonumber(meta:get_string("apos")) or 0 - local status = "Idle" + local status local vel = tonumber(meta:get_string("vel")) or 0 + local velstr = string.format("%0.02f",math.abs(vel)) + local aposstr = string.format("%0.02f",apos) if vel > 0 then - status = string.format("Running: Up, %0.02f m/s",vel) + status = S("Null Drive - Running: Up, @1m/s - Position: @2m",velstr,aposstr) elseif vel < 0 then - status = string.format("Running: Down, %0.02f m/s",math.abs(vel)) + status = S("Null Drive - Running: Down, @1m/s - Position: @2m",velstr,aposstr) + else + status = S("Null Drive - Idle") end - meta:set_string("infotext",string.format("Null Drive - %s - Position: %0.02f m",status,apos)) + meta:set_string("infotext",status) end local function playbuzz(pos) diff --git a/fs1switch.lua b/fs1switch.lua index a5cb2f4..49be80a 100644 --- a/fs1switch.lua +++ b/fs1switch.lua @@ -1,5 +1,7 @@ celevator.fs1switch = {} +local S = core.get_translator("celevator") + local function maketex(switchpos,lit) local tex = "celevator_fs1switch_"..switchpos..".png" if lit then tex = tex.."^celevator_fs1switch_led.png" end @@ -29,7 +31,7 @@ local function rightclick(pos,node,player) if meta:get_string("formspec") ~= "" then return end local name = player:get_player_name() if core.is_protected(pos,name) and not core.check_player_privs(name,{protection_bypass=true}) then - core.chat_send_player(name,"You don't have a key for this switch.") + core.chat_send_player(name,S("You don't have a key for this switch.")) core.record_protection_violation(pos,name) return end @@ -110,9 +112,18 @@ end local switchstates = {"off","on","reset"} +local descriptions = { + off = S("Elevator Fire Service Phase 1 Keyswitch"), + on = S("Elevator Fire Service Phase 1 Keyswitch (on state - you hacker you!)"), + reset = S("Elevator Fire Service Phase 1 Keyswitch (reset state - you hacker you!)"), + offlit = S("Elevator Fire Service Phase 1 Keyswitch (lit - you hacker you!)"), + onlit = S("Elevator Fire Service Phase 1 Keyswitch (on state, lit - you hacker you!)"), + resetlit = S("Elevator Fire Service Phase 1 Keyswitch (reset state, lit - you hacker you!)"), +} + for _,switchpos in ipairs(switchstates) do core.register_node("celevator:fs1switch_"..switchpos,{ - description = "Elevator Fire Service Phase 1 Keyswitch"..(switchpos == "off" and "" or string.format(" (%s state - you hacker you!)",switchpos)), + description = descriptions[switchpos], groups = { dig_immediate = 2, not_in_creative_inventory = (switchpos == "off" and 0 or 1), @@ -137,7 +148,7 @@ for _,switchpos in ipairs(switchstates) do }, after_place_node = function(pos) local meta = core.get_meta(pos) - meta:set_string("formspec","formspec_version[7]size[8,5]field[0.5,0.5;7,1;carid;Car ID;]button[3,3.5;2,1;save;Save]") + meta:set_string("formspec","formspec_version[7]size[8,5]field[0.5,0.5;7,1;carid;"..S("Car ID")..";]button[3,3.5;2,1;save;"..S("Save").."]") end, on_receive_fields = function(pos,_,fields,player) local carid = tonumber(fields.carid or 0) @@ -149,7 +160,7 @@ for _,switchpos in ipairs(switchstates) do local name = player:get_player_name() if core.is_protected(controllerpos,name) and not core.check_player_privs(name,{protection_bypass=true}) then if player:is_player() then - core.chat_send_player(name,"Can't connect to a controller/dispatcher you don't have access to.") + core.chat_send_player(name,S("Can't connect to a controller/dispatcher you don't have access to.")) core.record_protection_violation(controllerpos,name) end return @@ -165,7 +176,7 @@ for _,switchpos in ipairs(switchstates) do on_destruct = unpair, }) core.register_node("celevator:fs1switch_"..switchpos.."_lit",{ - description = "Elevator Fire Service Phase 1 Keyswitch"..string.format(" (%s state, lit - you hacker you!)",switchpos), + description = descriptions[switchpos.."lit"], groups = { dig_immediate = 2, not_in_creative_inventory = 1, diff --git a/genericswitch.lua b/genericswitch.lua index f1936a7..71342f8 100644 --- a/genericswitch.lua +++ b/genericswitch.lua @@ -1,13 +1,15 @@ +local S = core.get_translator("celevator") + local inputoptions = { { id = "none", - desc = "(none)", + desc = S("(none)"), func_on = function() end, needsfloor = false, }, { id = "carcall", - desc = "Car Call at Landing:", + desc = S("Car Call at Landing:"), func_on = function(controllerpos,floor) celevator.controller.run(controllerpos,{ type = "remotemsg", @@ -19,7 +21,7 @@ local inputoptions = { }, { id = "upcall", - desc = "Up Call (simplex car) at Landing:", + desc = S("Up Call (simplex car) at Landing:"), func_on = function(controllerpos,floor) celevator.controller.run(controllerpos,{ type = "remotemsg", @@ -31,7 +33,7 @@ local inputoptions = { }, { id = "downcall", - desc = "Down Call (simplex car) at Landing:", + desc = S("Down Call (simplex car) at Landing:"), func_on = function(controllerpos,floor) celevator.controller.run(controllerpos,{ type = "remotemsg", @@ -43,7 +45,7 @@ local inputoptions = { }, { id = "swingupcall", - desc = "Up Call (swing) at Landing:", + desc = S("Up Call (swing) at Landing:"), func_on = function(controllerpos,floor) celevator.controller.run(controllerpos,{ type = "remotemsg", @@ -55,7 +57,7 @@ local inputoptions = { }, { id = "swingdowncall", - desc = "Down Call (swing) at Landing:", + desc = S("Down Call (swing) at Landing:"), func_on = function(controllerpos,floor) celevator.controller.run(controllerpos,{ type = "remotemsg", @@ -67,7 +69,7 @@ local inputoptions = { }, { id = "fs1off", - desc = "Deactivate Fire Service Phase 1", + desc = S("Deactivate Fire Service Phase 1"), func_on = function(controllerpos) celevator.controller.run(controllerpos,{ type = "fs1switch", @@ -78,7 +80,7 @@ local inputoptions = { }, { id = "fs1on", - desc = "Activate Fire Service (main landing) Phase 1", + desc = S("Activate Fire Service (main landing) Phase 1"), func_on = function(controllerpos) celevator.controller.run(controllerpos,{ type = "fs1switch", @@ -89,7 +91,7 @@ local inputoptions = { }, { id = "fs1onalt", - desc = "Activate Fire Service (alternate landing) Phase 1", + desc = S("Activate Fire Service (alternate landing) Phase 1"), func_on = function(controllerpos) celevator.controller.run(controllerpos,{ type = "fs1switch", @@ -101,7 +103,7 @@ local inputoptions = { }, { id = "mrsmoke", - desc = "Machine Room or Hoistway Smoke Detector", + desc = S("Machine Room or Hoistway Smoke Detector"), func_on = function(controllerpos) celevator.controller.run(controllerpos,{ type = "mrsmoke", @@ -111,7 +113,7 @@ local inputoptions = { }, { id = "secdeny", - desc = "Lock Car Calls at Landing:", + desc = S("Lock Car Calls at Landing:"), func_on = function(controllerpos,floor) celevator.controller.run(controllerpos,{ type = "remotemsg", @@ -126,7 +128,7 @@ local inputoptions = { }, { id = "secauth", - desc = "Require Auth for Car Calls at Landing:", + desc = S("Require Auth for Car Calls at Landing:"), func_on = function(controllerpos,floor) celevator.controller.run(controllerpos,{ type = "remotemsg", @@ -141,7 +143,7 @@ local inputoptions = { }, { id = "secallow", - desc = "Unlock Car Calls at Landing:", + desc = S("Unlock Car Calls at Landing:"), func_on = function(controllerpos,floor) celevator.controller.run(controllerpos,{ type = "remotemsg", @@ -156,7 +158,7 @@ local inputoptions = { }, { id = "swingon", - desc = "Activate Swing Operation", + desc = S("Activate Swing Operation"), func_on = function(controllerpos) celevator.controller.run(controllerpos,{ type = "remotemsg", @@ -168,7 +170,7 @@ local inputoptions = { }, { id = "swingoff", - desc = "Deactivate Swing Operation", + desc = S("Deactivate Swing Operation"), func_on = function(controllerpos) celevator.controller.run(controllerpos,{ type = "remotemsg", @@ -183,13 +185,13 @@ local inputoptions = { local dinputoptions = { { id = "none", - desc = "(none)", + desc = S("(none)"), func_on = function() end, needsfloor = false, }, { id = "upcall", - desc = "Up Call at Landing:", + desc = S("Up Call at Landing:"), func_on = function(dispatcherpos,floor) celevator.dispatcher.run(dispatcherpos,{ type = "remotemsg", @@ -201,7 +203,7 @@ local dinputoptions = { }, { id = "downcall", - desc = "Down Call at Landing:", + desc = S("Down Call at Landing:"), func_on = function(dispatcherpos,floor) celevator.dispatcher.run(dispatcherpos,{ type = "remotemsg", @@ -213,7 +215,7 @@ local dinputoptions = { }, { id = "fs1off", - desc = "Deactivate Fire Service Phase 1", + desc = S("Deactivate Fire Service Phase 1"), func_on = function(dispatcherpos) celevator.dispatcher.run(dispatcherpos,{ type = "fs1switch", @@ -224,7 +226,7 @@ local dinputoptions = { }, { id = "fs1on", - desc = "Activate Fire Service Phase 1", + desc = S("Activate Fire Service Phase 1"), func_on = function(dispatcherpos) celevator.dispatcher.run(dispatcherpos,{ type = "fs1switch", @@ -238,10 +240,10 @@ local dinputoptions = { local function updateinputform(pos) local meta = core.get_meta(pos) local dmode = meta:get_int("dispatcher") == 1 - local fs = "formspec_version[7]size[8,8.5]" - fs = fs.."tabheader[0,0;1;tab;Controller,Dispatcher;"..(dmode and "2" or "1")..";true;true]" - fs = fs.."vertlabel[0.33,1;ON]" - fs = fs.."dropdown[1,0.5;6,1;signal_on;" + local fs = "formspec_version[7]size[9,8.5]" + fs = fs.."tabheader[0,0;1;tab;"..S("Controller")..","..S("Dispatcher")..";"..(dmode and "2" or "1")..";true;true]" + fs = fs.."vertlabel[0.33,1;"..S("ON").."]" + fs = fs.."dropdown[1,0.5;7,1;signal_on;" local selected_on = 1 local currentid_on = meta:get_string("signal_on") for k,v in ipairs(dmode and dinputoptions or inputoptions) do @@ -250,11 +252,11 @@ local function updateinputform(pos) end fs = string.sub(fs,1,-2) fs = fs..";"..selected_on..";false]" - fs = fs.."field[0.5,2;3,1;carid;"..(dmode and "Dispatcher ID" or "Car ID")..";${carid}]" - fs = fs.."field[4.5,2;3,1;floor_on;Landing Number;${floor_on}]" - fs = fs.."box[0,3.25;8,0.1;#CCCCCC]" - fs = fs.."vertlabel[0.33,4;OFF]" - fs = fs.."dropdown[1,3.5;6,1;signal_off;" + fs = fs.."field[0.5,2;3,1;carid;"..(dmode and S("Dispatcher ID") or S("Car ID"))..";${carid}]" + fs = fs.."field[4.5,2;3,1;floor_on;"..S("Landing Number")..";${floor_on}]" + fs = fs.."box[0,3.25;9,0.1;#CCCCCC]" + fs = fs.."vertlabel[0.33,4;"..S("OFF").."]" + fs = fs.."dropdown[1,3.5;7,1;signal_off;" local selected_off = 1 local currentid_off = meta:get_string("signal_off") for k,v in ipairs(dmode and dinputoptions or inputoptions) do @@ -263,9 +265,9 @@ local function updateinputform(pos) end fs = string.sub(fs,1,-2) fs = fs..";"..selected_off..";false]" - fs = fs.."field[4.5,5;3,1;floor_off;Landing Number;${floor_off}]" - fs = fs.."label[1.5,6.5;Not all signal options require a landing number.]" - fs = fs.."button_exit[2.5,7;3,1;save;Save]" + fs = fs.."field[4.5,5;3,1;floor_off;"..S("Landing Number")..";${floor_off}]" + fs = fs.."label[1.5,6.5;"..S("Not all signal options require a landing number.").."]" + fs = fs.."button_exit[2.5,7;3,1;save;"..S("Save").."]" meta:set_string("formspec",fs) end @@ -290,7 +292,7 @@ local function handleinputfields(pos,_,fields,player) if not celevator.dispatcher.isdispatcher(carinfo.dispatcherpos) then return end if core.is_protected(carinfo.dispatcherpos,name) and not core.check_player_privs(name,{protection_bypass=true}) then if player:is_player() then - core.chat_send_player(name,"Can't connect to a dispatcher you don't have access to.") + core.chat_send_player(name,S("Can't connect to a dispatcher you don't have access to.")) core.record_protection_violation(carinfo.dispatcherpos,name) end return @@ -300,7 +302,7 @@ local function handleinputfields(pos,_,fields,player) if not celevator.controller.iscontroller(carinfo.controllerpos) then return end if core.is_protected(carinfo.controllerpos,name) and not core.check_player_privs(name,{protection_bypass=true}) then if player:is_player() then - core.chat_send_player(name,"Can't connect to a controller you don't have access to.") + core.chat_send_player(name,S("Can't connect to a controller you don't have access to.")) core.record_protection_violation(carinfo.controllerpos,name) end return @@ -329,14 +331,14 @@ local function handleinputfields(pos,_,fields,player) meta:set_string("signal_on",def_on.id) meta:set_string("signal_off",def_off.id) updateinputform(pos) - local infotext = carid.." - "..def_on.desc..(def_on.needsfloor and " "..floor_on or "") + local infotext = " - "..def_on.desc..(def_on.needsfloor and " "..floor_on or "") if def_on.id == "none" or def_off.id ~= "none" then infotext = infotext.." / "..def_off.desc..(def_off.needsfloor and " "..floor_off or "") end if dmode then - infotext = "Dispatcher: "..infotext + infotext = S("Dispatcher: @1",carid)..infotext else - infotext = "Car: "..infotext + infotext = S("Car: @1",carid)..infotext end meta:set_string("infotext",infotext) if def_on.id ~= "none" or def_off.id ~= "none" then @@ -383,7 +385,7 @@ local function handleinput(pos,on) end core.register_node("celevator:genericswitch",{ - description = "Elevator Keyswitch", + description = S("Elevator Keyswitch"), tiles = { "celevator_cabinet_sides.png", "celevator_cabinet_sides.png", @@ -413,7 +415,7 @@ core.register_node("celevator:genericswitch",{ }) core.register_node("celevator:genericswitch_maintained_off",{ - description = "Elevator Keyswitch (maintained, off state - you hacker you!)", + description = S("Elevator Keyswitch (maintained, off state - you hacker you!)"), tiles = { "celevator_cabinet_sides.png", "celevator_cabinet_sides.png", @@ -439,7 +441,7 @@ core.register_node("celevator:genericswitch_maintained_off",{ on_rightclick = function(pos,node,player) local name = player:get_player_name() if core.is_protected(pos,name) and not core.check_player_privs(name,{protection_bypass=true}) then - core.chat_send_player(name,"You don't have a key for this switch.") + core.chat_send_player(name,S("You don't have a key for this switch.")) core.record_protection_violation(pos,name) return end @@ -450,7 +452,7 @@ core.register_node("celevator:genericswitch_maintained_off",{ }) core.register_node("celevator:genericswitch_maintained_on",{ - description = "Elevator Keyswitch (maintained, on state - you hacker you!)", + description = S("Elevator Keyswitch (maintained, on state - you hacker you!)"), tiles = { "celevator_cabinet_sides.png", "celevator_cabinet_sides.png", @@ -476,7 +478,7 @@ core.register_node("celevator:genericswitch_maintained_on",{ on_rightclick = function(pos,node,player) local name = player:get_player_name() if core.is_protected(pos,name) and not core.check_player_privs(name,{protection_bypass=true}) then - core.chat_send_player(name,"You don't have a key for this switch.") + core.chat_send_player(name,S("You don't have a key for this switch.")) core.record_protection_violation(pos,name) return end @@ -487,7 +489,7 @@ core.register_node("celevator:genericswitch_maintained_on",{ }) core.register_node("celevator:genericswitch_momentary_off",{ - description = "Elevator Keyswitch (momentary, off state - you hacker you!)", + description = S("Elevator Keyswitch (momentary, off state - you hacker you!)"), tiles = { "celevator_cabinet_sides.png", "celevator_cabinet_sides.png", @@ -513,7 +515,7 @@ core.register_node("celevator:genericswitch_momentary_off",{ on_rightclick = function(pos,node,player) local name = player:get_player_name() if core.is_protected(pos,name) and not core.check_player_privs(name,{protection_bypass=true}) then - core.chat_send_player(name,"You don't have a key for this switch.") + core.chat_send_player(name,S("You don't have a key for this switch.")) core.record_protection_violation(pos,name) return end @@ -531,7 +533,7 @@ core.register_node("celevator:genericswitch_momentary_off",{ }) core.register_node("celevator:genericswitch_momentary_on",{ - description = "Elevator Keyswitch (momentary, on state - you hacker you!)", + description = S("Elevator Keyswitch (momentary, on state - you hacker you!)"), tiles = { "celevator_cabinet_sides.png", "celevator_cabinet_sides.png", diff --git a/governor.lua b/governor.lua index 4e717d8..15700fd 100644 --- a/governor.lua +++ b/governor.lua @@ -1,3 +1,5 @@ +local S = core.get_translator("celevator") + local function spawngovsheave(pos) local entitiesnearby = core.get_objects_inside_radius(pos,0.5) for _,i in pairs(entitiesnearby) do @@ -14,7 +16,7 @@ local function spawngovsheave(pos) end core.register_node("celevator:governor",{ - description = "Elevator Governor", + description = S("Elevator Governor"), groups = { cracky = 1, }, @@ -39,7 +41,7 @@ core.register_node("celevator:governor",{ }, }, on_construct = function(pos) - core.get_meta(pos):set_string("formspec","field[carid;Car ID;]") + core.get_meta(pos):set_string("formspec","field[carid;"..S("Car ID")..";]") spawngovsheave(pos) end, after_dig_node = function(pos) @@ -63,7 +65,7 @@ core.register_node("celevator:governor",{ }) core.register_node("celevator:governor_sheave",{ - description = "Governor Sheave (you hacker you!)", + description = S("Governor Sheave (you hacker you!)"), groups = { not_in_creative_inventory = 1, }, diff --git a/laptop.lua b/laptop.lua index 8f8edb2..f0fcb62 100644 --- a/laptop.lua +++ b/laptop.lua @@ -1,11 +1,13 @@ +local S = core.get_translator("celevator") + laptop.register_app("celevator",{ app_name = "mView", - app_info = "Remote interface for MTronic XT elevator controllers", + app_info = S("Remote interface for MTronic XT elevator controllers"), app_icon = "celevator_laptop_icon.png", formspec_func = function(_,mtos) local ram = mtos.bdev:get_app_storage("ram","celevator") local mem = mtos.bdev:get_app_storage("hdd","celevator") - if not mem then return mtos.theme:get_label("0.5,0.5","This application requires a hard disk drive.") end + if not mem then return mtos.theme:get_label("0.5,0.5",S("This application requires a hard disk drive.")) end if not mem.connections then mem.connections = {} end if not ram.screenstate then ram.screenstate = (#mem.connections > 0 and "connections" or "welcome") end if not mem.selectedconnection then mem.selectedconnection = 1 end @@ -16,55 +18,55 @@ laptop.register_app("celevator",{ if ram.screenstate == "welcome" then fs = fs.."background9[5.5,1;4,2;celevator_fs_bg.png;false;3]" fs = fs.."image[5.75,1;4,2;celevator_logo.png]" - fs = fs..mtos.theme:get_label("2,4","Welcome to the mView remote interface for MTronic XT elevator controllers!") - fs = fs..mtos.theme:get_label("2,6","Add a connection to get started.") - fs = fs..mtos.theme:get_button("5.5,7;4,1","major","connections","Add/Edit Connections") + fs = fs..mtos.theme:get_label("2,4",S("Welcome to the mView remote interface for MTronic XT elevator controllers!")) + fs = fs..mtos.theme:get_label("2,6",S("Add a connection to get started.")) + fs = fs..mtos.theme:get_button("5.5,7;4,1","major","connections",S("Add/Edit Connections")) elseif ram.screenstate == "connections" then - fs = fs..mtos.theme:get_label("0.5,0.5","MANAGE CONNECTIONS") + fs = fs..mtos.theme:get_label("0.5,0.5",S("MANAGE CONNECTIONS")) if #mem.connections > 0 then fs = fs.."textlist[1,2;6,7;connection;" for i=#mem.connections,1,-1 do - local text = string.format("ID %d - %s",mem.connections[i].carid,mem.connections[i].name) + local text = S("ID @1 - @2",mem.connections[i].carid,mem.connections[i].name) fs = fs..core.formspec_escape(text) fs = fs..(i==1 and "" or ",") end fs = fs..";"..tostring(#mem.connections-mem.selectedconnection+1)..";false]" else - fs = fs..mtos.theme:get_label("1,2","No Connections") + fs = fs..mtos.theme:get_label("1,2",S("No Connections")) end - fs = fs..mtos.theme:get_button("8,2;3,1","major","new","New Connection") + fs = fs..mtos.theme:get_button("8,2;3,1","major","new",S("New Connection")) if mem.connections[mem.selectedconnection] then - fs = fs..mtos.theme:get_button("8,3;3,1","major","edit","Edit Connection") - fs = fs..mtos.theme:get_button("8,4;3,1","major","delete","Delete Connection") - fs = fs..mtos.theme:get_button("8,7;3,1","major","connect","Connect >") - if #mem.connections > mem.selectedconnection then fs = fs..mtos.theme:get_button("8,5;3,1","major","moveup","Move Up") end - if mem.selectedconnection > 1 then fs = fs..mtos.theme:get_button("8,6;3,1","major","movedown","Move Down") end + fs = fs..mtos.theme:get_button("8,3;3,1","major","edit",S("Edit Connection")) + fs = fs..mtos.theme:get_button("8,4;3,1","major","delete",S("Delete Connection")) + fs = fs..mtos.theme:get_button("8,7;3,1","major","connect",S("Connect >")) + if #mem.connections > mem.selectedconnection then fs = fs..mtos.theme:get_button("8,5;3,1","major","moveup",S("Move Up")) end + if mem.selectedconnection > 1 then fs = fs..mtos.theme:get_button("8,6;3,1","major","movedown",S("Move Down")) end end elseif ram.screenstate == "newconnection" then - fs = fs..mtos.theme:get_label("0.5,0.5","NEW CONNECTION") - fs = fs..mtos.theme:get_label("0.5,1","Please enter the ID you would like to connect to and a name for the connection.") - fs = fs..mtos.theme:get_label("0.7,1.8","ID") - fs = fs..mtos.theme:get_label("3.7,1.8","Name") + fs = fs..mtos.theme:get_label("0.5,0.5",S("NEW CONNECTION")) + fs = fs..mtos.theme:get_label("0.5,1",S("Please enter the ID you would like to connect to and a name for the connection.")) + fs = fs..mtos.theme:get_label("0.7,1.8",S("ID")) + fs = fs..mtos.theme:get_label("3.7,1.8",S("Name")) fs = fs..string.format("field[1,2.5;2,1;carid;;%s]",core.formspec_escape(mem.newconnection.carid)) fs = fs..string.format("field[4,2.5;4,1;name;;%s]",core.formspec_escape(mem.newconnection.name)) - fs = fs..mtos.theme:get_button("3,4;3,1","major","save","Save") - fs = fs..mtos.theme:get_button("3,5.5;3,1","major","cancel","Cancel") + fs = fs..mtos.theme:get_button("3,4;3,1","major","save",S("Save")) + fs = fs..mtos.theme:get_button("3,5.5;3,1","major","cancel",S("Cancel")) elseif ram.screenstate == "editconnection" then - fs = fs..mtos.theme:get_label("0.5,0.5","EDIT CONNECTION") - fs = fs..mtos.theme:get_label("0.7,1.8","ID: "..mem.connections[mem.selectedconnection].carid) - fs = fs..mtos.theme:get_label("3.7,1.8","Name") + fs = fs..mtos.theme:get_label("0.5,0.5",S("EDIT CONNECTION")) + fs = fs..mtos.theme:get_label("0.7,1.8",S("ID: @1",mem.connections[mem.selectedconnection].carid)) + fs = fs..mtos.theme:get_label("3.7,1.8",S("Name")) fs = fs..string.format("field[4,2.5;4,1;name;;%s]",core.formspec_escape(mem.connections[mem.selectedconnection].name)) - fs = fs..mtos.theme:get_button("3,4;3,1","major","save","Save") - fs = fs..mtos.theme:get_button("3,5.5;3,1","major","cancel","Cancel") + fs = fs..mtos.theme:get_button("3,4;3,1","major","save",S("Save")) + fs = fs..mtos.theme:get_button("3,5.5;3,1","major","cancel",S("Cancel")) elseif ram.screenstate == "notfound" then - fs = fs..mtos.theme:get_label("0.5,0.5","Error") - fs = fs..mtos.theme:get_label("0.5,1","Could not find a controller or dispatcher with the given ID.") - fs = fs..mtos.theme:get_label("0.5,1.3","Please check the ID number and try again.") - fs = fs..mtos.theme:get_button("0.5,3;2,1","major","ok","OK") + fs = fs..mtos.theme:get_label("0.5,0.5",S("Error")) + fs = fs..mtos.theme:get_label("0.5,1",S("Could not find a controller or dispatcher with the given ID.")) + fs = fs..mtos.theme:get_label("0.5,1.3",S("Please check the ID number and try again.")) + fs = fs..mtos.theme:get_button("0.5,3;2,1","major","ok",S("OK")) elseif ram.screenstate == "protected" then - fs = fs..mtos.theme:get_label("0.5,0.5","Error") - fs = fs..mtos.theme:get_label("0.5,1","Controller or dispatcher is protected.") - fs = fs..mtos.theme:get_button("0.5,3;2,1","major","ok","OK") + fs = fs..mtos.theme:get_label("0.5,0.5",S("Error")) + fs = fs..mtos.theme:get_label("0.5,1",S("Controller or dispatcher is protected.")) + fs = fs..mtos.theme:get_button("0.5,3;2,1","major","ok",S("OK")) elseif ram.screenstate == "dispatcherstatus" then local connection = mem.connections[mem.selectedconnection] local pos = connection.pos @@ -73,20 +75,20 @@ laptop.register_app("celevator",{ local dmem = core.deserialize(meta:get_string("mem")) if not dmem then return end fs = fs.."background9[-0.1,0.4;15.2,10.05;celevator_fs_bg.png;false;3]" - fs = fs.."label[0.5,0.5;"..string.format("Connected to %s (ID %d)",connection.name,connection.carid).."]" - fs = fs.."button[1,1;2,1;disconnect;Disconnect]" + fs = fs.."label[0.5,0.5;"..S("Connected to @1 (ID @2)",connection.name,connection.carid).."]" + fs = fs.."button[1,1;2,1;disconnect;"..S("Disconnect").."]" fs = fs.."box[0.5,1;0.1,9;#AAAAAAFF]" fs = fs.."box[14.25,1;0.1,9;#AAAAAAFF]" fs = fs.."style_type[label;font_size=*0.75]" - fs = fs.."label[0.05,10;UP]" - fs = fs.."label[14.35,10;DOWN]" + fs = fs.."label[0.05,10;^]" + fs = fs.."label[14.35,10;v]" fs = fs.."style_type[image_button;font=mono;font_size=*0.66]" for car=1,#dmem.params.carids,1 do local xp = (car-1)*0.75+1 local carid = dmem.params.carids[car] local carstate = dmem.carstatus[carid].state - fs = fs..string.format("label[%f,9.8;CAR %d]",xp,car) - fs = fs..string.format("label[%f,10;%s]",xp+0.1,core.colorize("#ff5555",(carstate == "normal" and " IN" or "OUT"))) + fs = fs..string.format("label[%f,9.8;%s]",xp,S("CAR @1",car)) + fs = fs..string.format("label[%f,10;%s]",xp+0.1,core.colorize("#ff5555",(carstate == "normal" and S(" IN") or S("OUT")))) end local lowestfloor = (mem.screenpage-1)*10+1 local maxfloor = #dmem.params.floornames @@ -190,29 +192,29 @@ laptop.register_app("celevator",{ local cmem = core.deserialize(meta:get_string("mem")) if not cmem then return end local modenames = { - normal = "Normal Operation", - uninit = "Uninitialized", - resync = "Position Sync - Floor", - bfdemand = "Position Sync - Terminal", - fault = "Fault", - stop = "Emergency Stop", - mrinspect = "Machine Room Inspection", - carinspect = "Car Top Inspection", - inspconflict = "Inspection Conflict", - fs1 = "Fire Service - Phase 1", - fs2 = "Fire Service - Phase 2", - fs2hold = "Fire Service - Phase 2 Hold", - indep = "Independent Service", - capture = "Captured", - test = "Test Mode", - swing = "Swing Operation", + normal = S("Normal Operation"), + uninit = S("Uninitialized"), + resync = S("Position Sync - Floor"), + bfdemand = S("Position Sync - Terminal"), + fault = S("Fault"), + stop = S("Emergency Stop"), + mrinspect = S("Machine Room Inspection"), + carinspect = S("Car Top Inspection"), + inspconflict = "Inspection Conflict", -- No longer used + fs1 = S("Fire Service - Phase 1"), + fs2 = S("Fire Service - Phase 2"), + fs2hold = S("Fire Service - Phase 2 Hold"), + indep = S("Independent Service"), + capture = S("Captured"), + test = S("Test Mode"), + swing = S("Swing Operation"), } local doorstates = { - open = "Open", - opening = "Opening", - closing = "Closing", - closed = "Closed", - testtiming = "Closed", + open = S("Doors Open"), + opening = S("Doors Opening"), + closing = S("Doors Closing"), + closed = S("Doors Closed"), + testtiming = S("Doors Closed"), } local carpos = 0 local carfloor = 0 @@ -224,15 +226,18 @@ laptop.register_app("celevator",{ break end end - fs = fs..mtos.theme:get_label("1,1",string.format("Connected to %s (ID %d)",connection.name,connection.carid)) + fs = fs..mtos.theme:get_label("1,1",S("Connected to @1 (ID @2)",connection.name,connection.carid)) fs = fs..mtos.theme:get_label("1,2",modenames[cmem.carstate]) - fs = fs..mtos.theme:get_label("1,2.5",string.format("Doors %s",doorstates[cmem.doorstate])) + fs = fs..mtos.theme:get_label("1,2.5",doorstates[cmem.doorstate]) local pi = core.formspec_escape(cmem.params.floornames[carfloor]) - fs = fs..mtos.theme:get_label("1,3",string.format("Position: %0.02fm Speed: %+0.02fm/s PI: %s",cmem.drive.status.apos,cmem.drive.status.vel,pi)) + local posfmt = string.format("%0.02f",cmem.drive.status.apos) + local speedfmt = string.format("%+0.02f",cmem.drive.status.vel) + local posmsg = S("Position: @1m Speed: @2m/s PI: @3",posfmt,speedfmt,pi) + fs = fs..mtos.theme:get_label("1,3",posmsg) if #cmem.faultlog > 0 then - fs = fs..mtos.theme:get_label("1,3.5","Fault(s) Active") + fs = fs..mtos.theme:get_label("1,3.5",S("Fault(s) Active")) else - fs = fs..mtos.theme:get_label("1,3.5","No Current Faults") + fs = fs..mtos.theme:get_label("1,3.5",S("No Current Faults")) end fs = fs.."background9[8,0.3;6.2,10;celevator_fs_bg.png;false;3]" fs = fs.."style_type[image_button;font=mono;font_size=*0.75]" @@ -240,14 +245,14 @@ laptop.register_app("celevator",{ fs = fs.."box[11.808,0.75;0.05,9;#AAAAAAFF]" fs = fs.."box[12.708,0.75;0.05,9;#AAAAAAFF]" fs = fs.."box[13.725,0.75;0.1,9;#AAAAAAFF]" - fs = fs.."label[11.25,0.3;UP]" - fs = fs.."label[12.042,0.3;CAR]" - fs = fs.."label[12.825,0.3;DOWN]" + fs = fs.."label[11.25,0.3;^]" + fs = fs.."label[12.042,0.3;"..S("CAR").."]" + fs = fs.."label[12.825,0.3;v]" if mem.scrollfollowscar then mem.screenpage = math.floor((carfloor-1)/10)+1 end local maxfloor = #cmem.params.floornames local bottom = (mem.screenpage-1)*10+1 if maxfloor > 10 then - fs = fs..string.format("checkbox[8.4,1.5;scrollfollowscar;Follow Car;%s]",tostring(mem.scrollfollowscar)) + fs = fs..string.format("checkbox[8.4,1.5;scrollfollowscar;"..S("Follow Car")..";%s]",tostring(mem.scrollfollowscar)) if bottom+9 < maxfloor then fs = fs.."image_button[8.5,1;0.75,0.75;celevator_menu_arrow.png;scrollup;;false;false;celevator_menu_arrow.png]" end @@ -297,7 +302,7 @@ laptop.register_app("celevator",{ else ram.screenstate = "notfound" end - fs = fs..mtos.theme:get_button("1,8;3,1","major","disconnect","Disconnect") + fs = fs..mtos.theme:get_button("1,8;3,1","major","disconnect",S("Disconnect")) end return fs end, diff --git a/locale/celevator.es.tr b/locale/celevator.es.tr new file mode 100644 index 0000000..e97c0ff --- /dev/null +++ b/locale/celevator.es.tr @@ -0,0 +1,359 @@ +# textdomain: celevator +Elevator Up Call Button=Botón de llamada de ascensor (subir) +Elevator Down Call Button=Botón de llamada de ascensor (bajar) +Elevator Up and Down Call Buttons=Botón de llamada de ascensor (subir y bajar) +Elevator Call Button (on state - you hacker you!)=Botón de llamada de ascensor (estado activado) +Error reading car information!@nPlease remove and replace this node.=¡Error al leer la información del coche!@nRetire y reemplace este bloque. +Controller/dispatcher is missing!@nPlease remove and replace this node.=¡El controlador/despachador no está presente!@nRetire y reemplace este bloque. +Controller/dispatcher found but with incorrect ID!@nPlease remove and replace this node.=¡El controlador/despachador tiene el número incorrecto!@nRetire y reemplace este bloque. +Car (part @1 - you hacker you!)=Cabina del ascensor (parte @1) +You don't have access to these switches.=No tienes acceso a estos interruptores. +Really remove this car?=¿De verdad quieres eliminar esta cabina? +Yes=Sí +No=No +Car-top Inspection Box, Off State (you hacker you!)=Controles de inspección en el techo de la cabina (estado desactivado) +Car-top Inspection Box, On State (you hacker you!)=Controles de inspección en el techo de la cabina (estado activado) +Glass-Back Elevator Car=Cabina del ascensor con parte trasera en vidrio +Metal Elevator Car=Cabina del ascensor en metal +Metal Glass-Back Elevator Car=Cabina del ascensor en metal con parte trasera en vidrio +Basic Elevator Car=Cabina del ascensor básica +Can't place car here - position @1m to the right, @2m up, and @3m back is blocked!=No se puede colocar la cabina aquí - hay una posición bloqueada @1 m a la derecha, @2 m hacia arriba, y @3 m hacia atrás +Can't place car here - position @1m to the right, @2m up, and @3m back is protected!=No se puede colocar la cabina aquí - hay una posición protegida @1 m a la derecha, @2 m hacia arriba, y @3 m hacia atrás +Places a car call at the specified landing on the specified elevator=Realiza una llamada de cabina en la planta y el ascensor especificado + = +Invalid car ID=Número de ascensor no válido +Invalid landing number=Número de planta no válido +No such car or car info is missing=El ascensor especificado o su información no existe +Controller is missing=El controlador no está presente +Controller found but with wrong ID=El controlador tiene número incorrecto +Controller is protected=El controlador está protegido +Command sent=Comando enviado +Places an up hall call at the specified landing on the specified elevator or dispatcher=Realiza una llamada para subir en la planta y el ascensor/despachador especificado +Dispatcher is missing=Es despachador no está presente +Dispatcher found but with wrong ID=El despachador tiene número incorrecto +Dispatcher is protected=El despachador está protegido +Places a down hall call at the specified landing on the specified elevator or dispatcher=Realiza una llamada para bajar en la planta y el ascensor/despachador especificado +View the status of the specified elevator=Mostrar el estado del ascensor especificado += +Failed to load controller memory=Error al leer la memoria del controlador +Reload celevator controller firmware from disk=Recargar el firmware del controlador celevator +Elevator Controller=Controlador de ascensor +Controller (door open - you hacker you!)=Controlador (con puerta abierta) +Controller (top section - you hacker you!)=Controlador (mitad superior) +Controller (top section, car in motion - you hacker you!)=Controlador (mitad superior con cabina en movimiento) +Controller (top section, open - you hacker you!)=Controlador (mitad superior con puerta abierta) +Controller (top section, open, car in motion - you hacker you!)=Controlador (mitad superior con puerta abierta y cabina en movimiento) +Door Open Timeout=Se acabó el tiempo al abrir las puertas +Door Close Timeout=Se acabó el tiempo al cerrar las puertas +Lost Communication With Drive=Comunicación perdida con el inversor +Drive Not Configured=Inversor no inicializado +Drive Metadata Load Failure=Error al leer la memoria del inversor +Drive Origin Invalid=Error con posición de origen del inversor +Attempted to Move Doors With Car in Motion=Intentó abrir las puertas con la cabina en movimiento +Target Position Out of Bounds=Error con posición objetivo +Hoist Machine Missing=La máquina no está presente +Drive<->Machine ID Mismatch=Desajuste del número inversor <-> máquina +Controller<->Drive ID Mismatch=Desajuste del número controlador <-> inversor +Welcome to your new MTronic XT elevator controller!=¡Bienvenido a su nuevo controlador de ascensor MTronic XT! +This setup wizard is designed to get your elevator up and running as quickly as possible.=Este asistente de configuración está diseñado para poner en funcionamiento su ascensor lo más rápido posible. +This applies to the whole celevator mod, not just this controller:=Esto se aplica a todo el mod «celevator», no solo a este controlador: +Select a group operation mode:=Seleccione un modo de operación en grupo: +Simplex=Único ascensor +This will be the only elevator in the group. Hall calls will be handled by this controller.=Este será el único ascensor del grupo.@nLas llamadas desde los rellanos serán gestionadas por este controlador. +Group=Grupo +This elevator will participate in a group with others. Hall calls will be handled by a dispatcher.=Este ascensor participará en un grupo con otros ascensores.@nLas llamadas desde los rellanos serán gestionadas por un despachador. +Waiting for connection from dispatcher...=Esperando la conexión del despachador... +This controller's car ID is: @1=El número de este ascensor es: @1 +Enter details of all floors this elevator will serve, then press Done.=Introduzca los detalles de todos las plantas a las que dará servicio este ascensor y, a continuación, haz clic en «Listo». +CAR STATUS=ESTADO DE LA CABINA +Fault History=Historial de fallas +Edit Parameters=Editar parámetros +FAULT=FALLA +INSP/ACCESS=INSP/ACCESO +NORMAL OPERATION=FUNCIONAMIENTO NORMAL +UP=SUBIENDO +DRIVE CMD=COMANDO AL INVERSOR +DOWN=BAJANDO +HIGH SPEED=ALTA VELOCIDAD +DOOR ZONE=ZONA DE PUERTA +DOORS LOCKED=PUERTAS BLOQUEADAS +RUN=ARRANQUE +STOP=PARADA +CAPTURE=CAPTURAR +TEST=PRUEBA +INSPECT=INSP. +NORMAL=NORMAL +UP =SUBIR +DOWN =BAJAR +EDIT PARAMETERS=EDITAR PARÁMETROS +Door Dwell Timer=Temporizador de puerta +Contract Speed (m/s)=Velocidad max. (m/s) +Inspection Speed (m/s)=Velocidad insp. (m/s) +Main Egress Landing=Planta principal +Nudging Timer=Temporizador de empuje +Alternate Recall Landing=Planta alterna +Reset Doors=Restablecer puertas +Reset Controller=Restablecer controlador +Car Call Security=Seguridad de llamadas +FAULT HISTORY=HISTORIAL DE FALLAS +Clear=Borrar +CAR CALL SECURITY=SEGURIDAD DE LLAMADAS +Authorized Users Only=Solo usarios autorizados +Locked=Bloqueada +Security Disabled=Función de seguridad deshabilitada +Allow Swing Calls When Not In Swing Operation=Permitir llamadas de modo separado cuando no está en modo separado +Unlock in Independent=Desbloqear en modo de servicio independiente +Extra Allowed Users=Usuarios adicionales permitidos +Main landing cannot be locked=La planta principal no se puede bloquear. +ID @1: Floor @2 - @3 - @4=Número @1: Planta @2 - @3 - @4 +Call@nCancel=Cancelar +HOLD=MANTENER +FIRE SVC=INCENDIO +IND SVC=INDEPENDIENTE +CAR LIGHT=LUZ +CAR FAN=VENTILADOR +Please select a floor:=Por favor, seleccione una planta: +Please use elevator=Por favor, usar ascensor +ERROR=ERROR +Could not find a suitable elevator=No se pudo encontrar un ascensor adecuado. +Please try again later=Por favor, inténtelo de nuevo más tarde. +Elevator Destination Entry Kiosk=Quiosco de selección de destino del ascensor +Elevator Elastomeric Buffer=Amortiguador de goma para ascensor +Elevator Oil-Filled Buffer=Amortiguador lleno de aceite para ascensor +Elevator Oil-Filled Buffer (top half - you hacker you!)=Amortiguador lleno de aceite para ascensor (mitad superior) +Elevator Guide Rail=Riel guía de ascensor +Elevator Guide Rail with Bracket=Riel guía con soporte de ascensor +Elevator Positioning System Tape=Cinta del sistema de posicionamiento de ascensor +Elevator Positioning System Tape with Magnets=Cinta con imanes del sistema de posicionamiento de ascensor +Elevator Positioning System Tape with Bracket=Cinta con soporte del sistema de posicionamiento de ascensor +Elevator Positioning System Tapehead (off, you hacker you!)=Lector de cinta del sistema de posicionamiento de ascensor (desactivado) +Elevator Positioning System Tapehead (ULM on, you hacker you!)=Lector de cinta del sistema de posicionamiento de ascensor (señal ULM activado) +Elevator Positioning System Tapehead (ULM and DZ on, you hacker you!)=Lector de cinta del sistema de posicionamiento de ascensor (señales ULM y DZ activado) +Elevator Positioning System Tapehead (ULM, DLM, and DZ on, you hacker you!)=Lector de cinta del sistema de posicionamiento de ascensor (señales ULM, DLM, y DZ activado) +Elevator Positioning System Tapehead (DLM and DZ on, you hacker you!)=Lector de cinta del sistema de posicionamiento de ascensor (señales DLM y DZ activado) +Elevator Positioning System Tapehead (DLM on, you hacker you!)=Lector de cinta del sistema de posicionamiento de ascensor (señal DLM activado) +Elevator Digilines Input/Output=Módulo de entrada/salida del ascensor para digilines +Channel=Canal +Elevator Digilines Multi-Car Input/Output=Módulo de entrada/salida de múltiples ascensores para digilines +You need either the 'protection_bypass' or 'server' privilege to use this.=Necesitas el privilegio 'protection_bypass' o 'server' para poder usar esto. +Elevator Dispatcher=Despachador de ascensor +Dispatcher (door open - you hacker you!)=Despachador de ascensor (con puerta abierta) +Dispatcher (top section - you hacker you!)=Despachador de ascensor (mitad superior) +Dispatcher (top section, open - you hacker you!)=Despachador de ascensor (mitad superior con puerta abierta) +Firmware reloaded successfully=El firmware se recargó correctamente +Can't place cabinet - no room for the top half!=No se puede colocar el gabinete aquí - no hay espacio para la mitad superior! +Can't place cabinet - top half is protected!=No se puede colocar el gabinete aquí - el espacio para la mitad superior está protegido! +Hold the sneak button while digging to remove.=Mantén pulsado el botón de sigilo mientras cavas para eliminarlo. +Can't open cabinet - cabinet is locked.=No se puede abrir el gabinete - la puerta está bloqueada +Welcome to your new MTronic XT elevator dispatcher!=Bienvenido a su nuevo despachador de ascensores MTronic XT! +Before continuing, make sure you have at least two controllers in group operation mode and ready to connect.=Antes de continuar, asegúrese de tener al menos dos controladores en modo de funcionamiento grupal y listos para conectarse. +This applies to the whole celevator mod, not just this dispatcher:=Esto se aplica a todo el mod «celevator», no solo a este despachador: +Enter details of all floors this group will serve, then press Next.=Introduzca los detalles de todas las plantas a las que dará servicio este grupo y, a continuación, haz clic en «Siguiente». +Include all floors served by any car in the group, even if not served by all cars.=Incluya todas las plantas a las que acceda cualquiera de los ascensores del grupo, incluso si no todas las plantas son accesibles por todos los ascensores. +Connect to each car in the group, then click Done.=Conéctese a cada ascensor del grupo y luego haga clic en «Listo». +EDIT CONNECTIONS=EDITAR CONEXIONES +Car @1 - ID #@2=Ascensor @1 - Número @2 +Remove Connection=Eliminar conexión +Enter the car ID and select the floors served (click them to toggle), then click Connect.=Ingrese la identificación del ascensor y seleccione las plantas servidas (haga clic en ellas para alternar), luego haga clic en «Conectar». +You must select at least two floors.=Debes seleccionar al menos dos plantas. +Connect=Conectar +YES=SÍ +NO=NO +Car ID: @1=Número del ascensor: @1 +Connecting to controller...=Conectando al controlador... +Connection timed out!=Se agotó el tiempo de conexión! +Make sure the car ID is correct and@nthat the controller is ready to connect.=Asegúrese de que el número del ascensor esté correcto@ny que el controlador esté listo para conectar +GROUP DISPLAY=ESTADO DEL GRUPO +Menu=Menú +MAIN MENU=MENÚ PRINCIPAL +Edit Connections=Editar conexiones +Press Next to begin.=Haz clic en «siguiente» para comenzar. +License Info=Información de la licencia +Next >=Siguiente > +< Back=< Atrás +Done=Listo +EDIT FLOOR TABLE=EDICIÓN DE LA TABLA DE PLANTAS +@1 - Height: @2 - PI: @3=@1 - Talla: @2 - Nombre: @3 +New Floor=Planta nueva +Edit Floor=Editar planta +Remove Floor=Eliminar planta +The Floor Height is the distance (in meters/nodes) from the floor level of this floor to the floor level of the next floor.=La talla de la planta es la distancia (en metros/nodos) desde el nivel del suelo de este planta hasta el nivel del suelo de la planta siguiente. +(not used at the highest floor)=(No se utiliza en la planta más alta) +The Floor Name is how the floor will be displayed on the position indicators.=El nombre de la planta es la forma en que se mostrará la planta en los indicadores de posición. +Editing Floor @1=Editando la planta @1 +Floor Height=Talla de la planta +Floor Name=Nombre de la planta +Edit Floor Table=Tabla de plantas +Back=Atrás +No Connections=Nignún conexión +New Connection=Conexión nuevo +Edit Connection=Editar conexión +NEW CONNECTION=CONEXIÓN NUEVO +EDIT CONNECTION=EDITAR CONEXIÓN +ID: @1=Número: @1 +CAR @1=ASC. @1 + IN= OK +OUT= -- +OK=OK +Move Up=Subir +Move Down=Bajar +Glass Hoistway Door (fast, bottom - you hacker you!)=Puerta de ascensor en vidrio (alta velocidad, parte inferior) +Glass Hoistway Door (fast, middle - you hacker you!)=Puerta de ascensor en vidrio (alta velocidad, parte media) +Glass Hoistway Door (fast, top - you hacker you!)=Puerta de ascensor en vidrio (alta velocidad, parte superior) +Glass Hoistway Door (slow, bottom - you hacker you!)=Puerta de ascensor en vidrio (baja velocidad, parte inferior) +Glass Hoistway Door (slow, middle - you hacker you!)=Puerta de ascensor en vidrio (baja velocidad, parte media) +Glass Hoistway Door (slow, top - you hacker you!)=Puerta de ascensor en vidrio (baja velocidad, parte superior) +Steel Hoistway Door (fast, bottom - you hacker you!)=Puerta de ascensor en acero (alta velocidad, parte inferior) +Steel Hoistway Door (fast, middle - you hacker you!)=Puerta de ascensor en acero (alta velocidad, parte media) +Steel Hoistway Door (fast, top - you hacker you!)=Puerta de ascensor en acero (alta velocidad, parte superior) +Steel Hoistway Door (slow, bottom - you hacker you!)=Puerta de ascensor en acero (baja velocidad, parte inferior) +Steel Hoistway Door (slow, middle - you hacker you!)=Puerta de ascensor en acero (baja velocidad, parte media) +Steel Hoistway Door (slow, top - you hacker you!)=Puerta de ascensor en acero (baja velocidad, parte superior) +Hoistway Door Open-State Placeholder (you hacker you!)=Marcador de posición para puertas de ascensor abiertas +Glass Elevator Hoistway Door=Puerta de ascensor en vidrio +Can't place door here - position @1m to the right and @2m up is blocked!=No se puede colocar la puerta aquí - hay una posición bloqueada @1 m a la derecha y @2 m hacia arriba +Can't place door here - position @1m to the right and @2m up is protected!=No se puede colocar la puerta aquí - hay una posición protegida @1 m a la derecha y @2 m hacia arriba +Steel Elevator Hoistway Door=Puerta de ascensor en acero +Hoistway Door Sill, Single Track (you hacker you!)=Alféizar de puerta para ascensor (pista única) +Hoistway Door Sill, Double Track (you hacker you!)=Alféizar de puerta para ascensor (pista doble) +Elevator Drive=Inversor de frequencia para ascensor +Normal entity-based drive=Inversor de frequencia normal basado en entidades +Drive - Running: Up, @1m/s - Position: @2m=Inversor - Subiendo a @1 m/s - Posición: @2 m +Drive - Running: Down, @1m/s - Position: @2m=Inversor - Bajando a @1 m/s - Posición: @2 m +Drive - Running (simulated): Up, @1m/s - Position: @2m=Inversor - Subiendo (simulado) a @1 m/s - Posición: @2 m +Drive - Running (simulated): Down, @1m/s - Position: @2m=Inversor - Bajando (simulado) a @1 m/s - Posición: @2 m +Drive - Idle=Inversor - Inactivo +Using car with origin @1=Usando la cabina con posición de origen @1 +No car found! Punch to try again=¡No se encontró ninguna cabina! Golpea para intentarlo de nuevo +Elevator Hoist Machine=Máquina del ascensor +Can't place machine here - no room for the motor (to the left)!=No se puede colocar la máquina aquí - ¡no hay espacio para el motor (a la izquierda)! +Can't place machine here - space for the motor (to the left) is protected!=No se puede colocar la máquina aquí - ¡el espacio para el motor (a la izquierda) está protegida! +Can't place machine here - no room for the sheave (in front)!=No se puede colocar la máquina aquí - ¡no hay espacio para la polea (al frente)! +Can't place machine here - space for the sheave (in front) is protected!=No se puede colocar la máquina aquí - ¡el espacio para la polea (al frente) está protegida! +Hoist Motor (you hacker you!)=Motor +Sheave (you hacker you!)=Polea +Centered Sheave (you hacker you!)=Polea centrada +Null Drive=Inversor de frequencia simulado +Simulation only, no movement, for testing and demonstration=Sólo para simulación y prueba, sin movimiento +Null Drive - Running: Up, @1m/s - Position: @2m=Inversor Simulado - Subiendo a @1 m/s - Posición: @2 m +Null Drive - Running: Down, @1m/s - Position: @2m=Inversor Simulado - Bajando a @1 m/s - Posición: @2 m +Null Drive - Idle=Inversor Simulado - Inactivo +Elevator Fire Service Phase 1 Keyswitch=Interruptor de la fase 1 del modo de incendio del ascensor +Elevator Fire Service Phase 1 Keyswitch (on state - you hacker you!)=Interruptor de la fase 1 del modo de incendio del ascensor (estado activado) +Elevator Fire Service Phase 1 Keyswitch (reset state - you hacker you!)=Interruptor de la fase 1 del modo de incendio del ascensor (estado de reinicio) +Elevator Fire Service Phase 1 Keyswitch (lit - you hacker you!)=Interruptor de la fase 1 del modo de incendio del ascensor (con luz activado) +Elevator Fire Service Phase 1 Keyswitch (on state, lit - you hacker you!)=Interruptor de la fase 1 del modo de incendio del ascensor (estado activado y con luz activado) +Elevator Fire Service Phase 1 Keyswitch (reset state, lit - you hacker you!)=Interruptor de la fase 1 del modo de incendio del ascensor (estado de reinicio y con luz activado) +Can't connect to a controller/dispatcher you don't have access to.=No se puede conectar a un controlador/despachador al que no se tiene acceso. +You don't have a key for this switch.=No tienes la llave para este interruptor. +Elevator Keyswitch=Interruptor de llave del ascensor +Elevator Keyswitch (maintained, off state - you hacker you!)=Interruptor de llave del ascensor (mantenido, en estado desactivado) +Elevator Keyswitch (maintained, on state - you hacker you!)=Interruptor de llave del ascensor (mantenido, en estado activado) +Elevator Keyswitch (momentary, off state - you hacker you!)=Interruptor de llave del ascensor (momentáneo, en estado desactivado) +Elevator Keyswitch (momentary, on state - you hacker you!)=Interruptor de llave del ascensor (momentáneo, en estado activado) +(none)=(ningún) +ON=ENCENDIDO +OFF=APAGADO +Elevator Governor=Limitador de velocidad del ascensor +Governor Sheave (you hacker you!)=Polea de limitador de velocidad +Remote interface for MTronic XT elevator controllers=Interfaz remota para controladores de ascensores MTronic XT +This application requires a hard disk drive.=Este aplicación necesita un disco duro. +Welcome to the mView remote interface for MTronic XT elevator controllers!=¡Bienvenido a la interfaz remota mView para los controladores de ascensores MTronic XT! +Add a connection to get started.=Añade una conexión para empezar. +Add/Edit Connections=Añadir/editar conexiones +MANAGE CONNECTIONS=GESTIONAR CONEXIONES +ID @1 - @2=Número @1 - @2 +Delete Connection=Eliminar conexión +Connect >=Conectar > +Please enter the ID you would like to connect to and a name for the connection.=Por favor, introduzca el número al que desea conectarse y un nombre para la conexión. +ID=Número +Name=Nombre +Error=Error +Could not find a controller or dispatcher with the given ID.=No se pudo encontrar un controlador o despachador con el número proporcionado. +Please check the ID number and try again.=Por favor, comprueba el número y inténtelo de nuevo. +Controller or dispatcher is protected.=Controlador or despachador está protegido. +Connected to @1 (ID @2)=Conectado a @1 (Número @2) +Disconnect=Desconectar +Uninitialized=No inicializado +Position Sync - Floor=Sincronización de posición - planta +Position Sync - Terminal=Sincronización de posición - terminal +Machine Room Inspection=Modo de inspección (sala de máquinas) +Car Top Inspection=Modo de inspección (techo de la cabina) +Fire Service - Phase 1=Modo de incendio (fase 1) +Fire Service - Phase 2=Modo de incendio (fase 2) +Fire Service - Phase 2 Hold=Modo de incendio (fase 2, modo de retención) +Captured=Capturado +Test Mode=Modo de prueba +Cancel=Cancelar +CAR=CABINA +Follow Car=Seguir la cabina +Position: @1m Speed: @2m/s PI: @3=Posición: @1 m Velocidad: @2 m Planta: @3 +Fault(s) Active=Falla(s) activa(s) +No Current Faults=Ninguna falla +Inspection (Any)=Modo de inspección (cualquier) +Fire Service=Modo de incendio +Fire Service Phase 1=Modo de incendio - fase 1 +Fire Service Phase 2=Modo de incendio - fase 2 +Moving Up=Subiendo +Moving Down=Bajando +Moving (Any Direction)=Moviéndose en cualquier dirección +Collecting Up Calls=Recopilando llamadas para subir +Collecting Down Calls=Recopilando llamadas para bajar +Car Light Switch=Interruptor de luz +Car Fan Switch=Interruptor de ventilador +Up Call Exists at Landing:=Existe una llamada de subida en la planta: +Down Call Exists at Landing:=Existe una llamada de bajada en la planta: +Car Call Exists at Landing:=Existe una llamada entre del ascensor en la planta: +Car at Landing:=Está en la planta: +Moving to Landing:=Está moviéndose a la planta: +Elevator Mesecons Output=Salida mesecons para ascensor +Elevator Mesecons Output (on state - you hacker you!)=Salida mesecons para ascensor (estado activado) +Elevator Mesecons Input=Entrada mesecons para ascensor +Elevator Mesecons Input (on state - you hacker you!)=Entrada mesecons para ascensor (estado activado) +Car Call at Landing:=Llamada de cabina a la planta: +Up Call (simplex car) at Landing:=Llamada para subir (único ascensor) de la planta: +Down Call (simplex car) at Landing:=Llamada para bajar (único ascensor) de la planta: +Up Call (swing) at Landing:=Llamada para subir (modo separado) de la planta: +Down Call (swing) at Landing:=Llamada para bajar (modo separado) de la planta: +Deactivate Fire Service Phase 1=Desactivar la fase 1 del modo de incendio +Activate Fire Service (main landing) Phase 1=Activar (planta primaria) la fase 1 del modo de incendio +Activate Fire Service (alternate landing) Phase 1=Activar (planta alternativa) la fase 1 del modo de incendio +Machine Room or Hoistway Smoke Detector=Detector de humo en la sala de máquinas o en el hueco +Lock Car Calls at Landing:=Bloquea las llamadas a la planta: +Require Auth for Car Calls at Landing:=Requiere autenticación para las llamadas a la planta: +Unlock Car Calls at Landing:=Desbloquea las llamadas a la planta: +Activate Swing Operation=Activar modo separado +Deactivate Swing Operation=Desactivar modo separado +Up Call at Landing:=Llamada para subir de la planta: +Down Call at Landing:=Llamada para bajar de la planta: +Activate Fire Service Phase 1=Activar la fase 1 del modo de incendio +Controller=Controlador +Dispatcher=Despachador +Not all signal options require a landing number.=No todas las opciones de señalización requieren@nun número de planta. +Dispatcher: @1=Despachador: @1 +Car: @1=Ascensor: @1 +Dispatcher ID=Número del despachador +Can't connect to a dispatcher you don't have access to.=No se puede conectar a un despachador al que no se tiene acceso. +Can't connect to a controller you don't have access to.=No se puede conectar a un controlador al que no se tiene acceso. +Normal Operation=Funcionamiento normal +Fault=Falla +Emergency Stop=Parada de emergencia +Independent Service=Modo de servicio independiente +Swing Operation=Modo separado +Doors Opening=Puertas abriéndose +Doors Open=Puertas abiertas +Doors Closing=Puertas cerrándose +Doors Closed=Puertas cerradas +Elevator Position Indicator=Indicador de posición del ascensor +Elevator Up Lantern=Luz indicadora de llegada del ascensor (subiendo) +Elevator Up Lantern (vertical)=Luz vertical indicadora de llegada del ascensor (subiendo) +Elevator Up Position Indicator / Lantern Combo=Luz indicadora de llegada del ascensor (subiendo) y indicador de su posición +Elevator Down Lantern=Luz indicadora de llegada del ascensor (bajando) +Elevator Down Lantern (vertical)=Luz vertical indicadora de llegada del ascensor (bajando) +Elevator Down Position Indicator / Lantern Combo=Luz indicadora de llegada del ascensor (bajando) y indicador de su posición +Elevator Up and Down Lantern=Luz indicadora de llegada del ascensor (subiendo y bajando) +Elevator Up and Down Lantern (vertical)=Luz vertical indicadora de llegada del ascensor (subiendo y bajando) +Elevator Up and Down Position Indicator / Lantern Combo=Luz indicadora de llegada del ascensor (subiendo y bajando) y indicador de su posición +Car ID=Número del ascensor +Save=Guardar +Landing Number=Número de planta diff --git a/locale/template.txt b/locale/template.txt new file mode 100644 index 0000000..023ea26 --- /dev/null +++ b/locale/template.txt @@ -0,0 +1,359 @@ +# textdomain: celevator +Elevator Up Call Button= +Elevator Down Call Button= +Elevator Up and Down Call Buttons= +Elevator Call Button (on state - you hacker you!)= +Error reading car information!@nPlease remove and replace this node.= +Controller/dispatcher is missing!@nPlease remove and replace this node.= +Controller/dispatcher found but with incorrect ID!@nPlease remove and replace this node.= +Car (part @1 - you hacker you!)= +You don't have access to these switches.= +Really remove this car?= +Yes= +No= +Car-top Inspection Box, Off State (you hacker you!)= +Car-top Inspection Box, On State (you hacker you!)= +Glass-Back Elevator Car= +Metal Elevator Car= +Metal Glass-Back Elevator Car= +Basic Elevator Car= +Can't place car here - position @1m to the right, @2m up, and @3m back is blocked!= +Can't place car here - position @1m to the right, @2m up, and @3m back is protected!= +Places a car call at the specified landing on the specified elevator= + = +Invalid car ID= +Invalid landing number= +No such car or car info is missing= +Controller is missing= +Controller found but with wrong ID= +Controller is protected= +Command sent= +Places an up hall call at the specified landing on the specified elevator or dispatcher= +Dispatcher is missing= +Dispatcher found but with wrong ID= +Dispatcher is protected= +Places a down hall call at the specified landing on the specified elevator or dispatcher= +View the status of the specified elevator= += +Failed to load controller memory= +Reload celevator controller firmware from disk= +Elevator Controller= +Controller (door open - you hacker you!)= +Controller (top section - you hacker you!)= +Controller (top section, car in motion - you hacker you!)= +Controller (top section, open - you hacker you!)= +Controller (top section, open, car in motion - you hacker you!)= +Door Open Timeout= +Door Close Timeout= +Lost Communication With Drive= +Drive Not Configured= +Drive Metadata Load Failure= +Drive Origin Invalid= +Attempted to Move Doors With Car in Motion= +Target Position Out of Bounds= +Hoist Machine Missing= +Drive<->Machine ID Mismatch= +Controller<->Drive ID Mismatch= +Welcome to your new MTronic XT elevator controller!= +This setup wizard is designed to get your elevator up and running as quickly as possible.= +This applies to the whole celevator mod, not just this controller:= +Select a group operation mode:= +Simplex= +This will be the only elevator in the group. Hall calls will be handled by this controller.= +Group= +This elevator will participate in a group with others. Hall calls will be handled by a dispatcher.= +Waiting for connection from dispatcher...= +This controller's car ID is: @1= +Enter details of all floors this elevator will serve, then press Done.= +CAR STATUS= +Fault History= +Edit Parameters= +FAULT= +INSP/ACCESS= +NORMAL OPERATION= +UP= +DRIVE CMD= +DOWN= +HIGH SPEED= +DOOR ZONE= +DOORS LOCKED= +RUN= +STOP= +CAPTURE= +TEST= +INSPECT= +NORMAL= +UP = +DOWN = +EDIT PARAMETERS= +Door Dwell Timer= +Contract Speed (m/s)= +Inspection Speed (m/s)= +Main Egress Landing= +Nudging Timer= +Alternate Recall Landing= +Reset Doors= +Reset Controller= +Car Call Security= +FAULT HISTORY= +Clear= +CAR CALL SECURITY= +Authorized Users Only= +Locked= +Security Disabled= +Allow Swing Calls When Not In Swing Operation= +Unlock in Independent= +Extra Allowed Users= +Main landing cannot be locked= +ID @1: Floor @2 - @3 - @4= +Call@nCancel= +HOLD= +FIRE SVC= +IND SVC= +CAR LIGHT= +CAR FAN= +Please select a floor:= +Please use elevator= +ERROR= +Could not find a suitable elevator= +Please try again later= +Elevator Destination Entry Kiosk= +Elevator Elastomeric Buffer= +Elevator Oil-Filled Buffer= +Elevator Oil-Filled Buffer (top half - you hacker you!)= +Elevator Guide Rail= +Elevator Guide Rail with Bracket= +Elevator Positioning System Tape= +Elevator Positioning System Tape with Magnets= +Elevator Positioning System Tape with Bracket= +Elevator Positioning System Tapehead (off, you hacker you!)= +Elevator Positioning System Tapehead (ULM on, you hacker you!)= +Elevator Positioning System Tapehead (ULM and DZ on, you hacker you!)= +Elevator Positioning System Tapehead (ULM, DLM, and DZ on, you hacker you!)= +Elevator Positioning System Tapehead (DLM and DZ on, you hacker you!)= +Elevator Positioning System Tapehead (DLM on, you hacker you!)= +Elevator Digilines Input/Output= +Channel= +Elevator Digilines Multi-Car Input/Output= +You need either the 'protection_bypass' or 'server' privilege to use this.= +Elevator Dispatcher= +Dispatcher (door open - you hacker you!)= +Dispatcher (top section - you hacker you!)= +Dispatcher (top section, open - you hacker you!)= +Firmware reloaded successfully= +Can't place cabinet - no room for the top half!= +Can't place cabinet - top half is protected!= +Hold the sneak button while digging to remove.= +Can't open cabinet - cabinet is locked.= +Welcome to your new MTronic XT elevator dispatcher!= +Before continuing, make sure you have at least two controllers in group operation mode and ready to connect.= +This applies to the whole celevator mod, not just this dispatcher:= +Enter details of all floors this group will serve, then press Next.= +Include all floors served by any car in the group, even if not served by all cars.= +Connect to each car in the group, then click Done.= +EDIT CONNECTIONS= +Car @1 - ID #@2= +Remove Connection= +Enter the car ID and select the floors served (click them to toggle), then click Connect.= +You must select at least two floors.= +Connect= +YES= +NO= +Car ID: @1= +Connecting to controller...= +Connection timed out!= +Make sure the car ID is correct and@nthat the controller is ready to connect.= +GROUP DISPLAY= +Menu= +MAIN MENU= +Edit Connections= +Press Next to begin.= +License Info= +Next >= +< Back= +Done= +EDIT FLOOR TABLE= +@1 - Height: @2 - PI: @3= +New Floor= +Edit Floor= +Remove Floor= +The Floor Height is the distance (in meters/nodes) from the floor level of this floor to the floor level of the next floor.= +(not used at the highest floor)= +The Floor Name is how the floor will be displayed on the position indicators.= +Editing Floor @1= +Floor Height= +Floor Name= +Edit Floor Table= +Back= +No Connections= +New Connection= +Edit Connection= +NEW CONNECTION= +EDIT CONNECTION= +ID: @1= +CAR @1= + IN= +OUT= +OK= +Move Up= +Move Down= +Glass Hoistway Door (fast, bottom - you hacker you!)= +Glass Hoistway Door (fast, middle - you hacker you!)= +Glass Hoistway Door (fast, top - you hacker you!)= +Glass Hoistway Door (slow, bottom - you hacker you!)= +Glass Hoistway Door (slow, middle - you hacker you!)= +Glass Hoistway Door (slow, top - you hacker you!)= +Steel Hoistway Door (fast, bottom - you hacker you!)= +Steel Hoistway Door (fast, middle - you hacker you!)= +Steel Hoistway Door (fast, top - you hacker you!)= +Steel Hoistway Door (slow, bottom - you hacker you!)= +Steel Hoistway Door (slow, middle - you hacker you!)= +Steel Hoistway Door (slow, top - you hacker you!)= +Hoistway Door Open-State Placeholder (you hacker you!)= +Glass Elevator Hoistway Door= +Can't place door here - position @1m to the right and @2m up is blocked!= +Can't place door here - position @1m to the right and @2m up is protected!= +Steel Elevator Hoistway Door= +Hoistway Door Sill, Single Track (you hacker you!)= +Hoistway Door Sill, Double Track (you hacker you!)= +Elevator Drive= +Normal entity-based drive= +Drive - Running: Up, @1m/s - Position: @2m= +Drive - Running: Down, @1m/s - Position: @2m= +Drive - Running (simulated): Up, @1m/s - Position: @2m= +Drive - Running (simulated): Down, @1m/s - Position: @2m= +Drive - Idle= +Using car with origin @1= +No car found! Punch to try again= +Elevator Hoist Machine= +Can't place machine here - no room for the motor (to the left)!= +Can't place machine here - space for the motor (to the left) is protected!= +Can't place machine here - no room for the sheave (in front)!= +Can't place machine here - space for the sheave (in front) is protected!= +Hoist Motor (you hacker you!)= +Sheave (you hacker you!)= +Centered Sheave (you hacker you!)= +Null Drive= +Simulation only, no movement, for testing and demonstration= +Null Drive - Running: Up, @1m/s - Position: @2m= +Null Drive - Running: Down, @1m/s - Position: @2m= +Null Drive - Idle= +Elevator Fire Service Phase 1 Keyswitch= +Elevator Fire Service Phase 1 Keyswitch (on state - you hacker you!)= +Elevator Fire Service Phase 1 Keyswitch (reset state - you hacker you!)= +Elevator Fire Service Phase 1 Keyswitch (lit - you hacker you!)= +Elevator Fire Service Phase 1 Keyswitch (on state, lit - you hacker you!)= +Elevator Fire Service Phase 1 Keyswitch (reset state, lit - you hacker you!)= +Can't connect to a controller/dispatcher you don't have access to.= +You don't have a key for this switch.= +Elevator Keyswitch= +Elevator Keyswitch (maintained, off state - you hacker you!)= +Elevator Keyswitch (maintained, on state - you hacker you!)= +Elevator Keyswitch (momentary, off state - you hacker you!)= +Elevator Keyswitch (momentary, on state - you hacker you!)= +(none)= +ON= +OFF= +Elevator Governor= +Governor Sheave (you hacker you!)= +Remote interface for MTronic XT elevator controllers= +This application requires a hard disk drive.= +Welcome to the mView remote interface for MTronic XT elevator controllers!= +Add a connection to get started.= +Add/Edit Connections= +MANAGE CONNECTIONS= +ID @1 - @2= +Delete Connection= +Connect >= +Please enter the ID you would like to connect to and a name for the connection.= +ID= +Name= +Error= +Could not find a controller or dispatcher with the given ID.= +Please check the ID number and try again.= +Controller or dispatcher is protected.= +Connected to @1 (ID @2)= +Disconnect= +Uninitialized= +Position Sync - Floor= +Position Sync - Terminal= +Machine Room Inspection= +Car Top Inspection= +Fire Service - Phase 1= +Fire Service - Phase 2= +Fire Service - Phase 2 Hold= +Captured= +Test Mode= +Cancel= +CAR= +Follow Car= +Position: @1m Speed: @2m/s PI: @3= +Fault(s) Active= +No Current Faults= +Inspection (Any)= +Fire Service= +Fire Service Phase 1= +Fire Service Phase 2= +Moving Up= +Moving Down= +Moving (Any Direction)= +Collecting Up Calls= +Collecting Down Calls= +Car Light Switch= +Car Fan Switch= +Up Call Exists at Landing:= +Down Call Exists at Landing:= +Car Call Exists at Landing:= +Car at Landing:= +Moving to Landing:= +Elevator Mesecons Output= +Elevator Mesecons Output (on state - you hacker you!)= +Elevator Mesecons Input= +Elevator Mesecons Input (on state - you hacker you!)= +Car Call at Landing:= +Up Call (simplex car) at Landing:= +Down Call (simplex car) at Landing:= +Up Call (swing) at Landing:= +Down Call (swing) at Landing:= +Deactivate Fire Service Phase 1= +Activate Fire Service (main landing) Phase 1= +Activate Fire Service (alternate landing) Phase 1= +Machine Room or Hoistway Smoke Detector= +Lock Car Calls at Landing:= +Require Auth for Car Calls at Landing:= +Unlock Car Calls at Landing:= +Activate Swing Operation= +Deactivate Swing Operation= +Up Call at Landing:= +Down Call at Landing:= +Activate Fire Service Phase 1= +Controller= +Dispatcher= +Not all signal options require a landing number.= +Dispatcher: @1= +Car: @1= +Dispatcher ID= +Can't connect to a dispatcher you don't have access to.= +Can't connect to a controller you don't have access to.= +Normal Operation= +Fault= +Emergency Stop= +Independent Service= +Swing Operation= +Doors Opening= +Doors Open= +Doors Closing= +Doors Closed= +Elevator Position Indicator= +Elevator Up Lantern= +Elevator Up Lantern (vertical)= +Elevator Up Position Indicator / Lantern Combo= +Elevator Down Lantern= +Elevator Down Lantern (vertical)= +Elevator Down Position Indicator / Lantern Combo= +Elevator Up and Down Lantern= +Elevator Up and Down Lantern (vertical)= +Elevator Up and Down Position Indicator / Lantern Combo= +Car ID= +Save= +Landing Number= diff --git a/mesecons.lua b/mesecons.lua index 9eaa6d8..51917ed 100644 --- a/mesecons.lua +++ b/mesecons.lua @@ -1,3 +1,5 @@ +local S = core.get_translator("celevator") + local iorules = { vector.new(-1,0,0), vector.new(1,0,0), @@ -20,7 +22,7 @@ end local outputoptions = { { id = "normal", - desc = "Normal Operation", + desc = S("Normal Operation"), func = function(mem) return (mem.carstate == "normal") end, @@ -28,7 +30,7 @@ local outputoptions = { }, { id = "fault", - desc = "Fault", + desc = S("Fault"), func = function(mem) return (mem.carstate == "fault") end, @@ -36,7 +38,7 @@ local outputoptions = { }, { id = "estop", - desc = "Emergency Stop", + desc = S("Emergency Stop"), func = function(mem) return (mem.carstate == "stop") end, @@ -44,7 +46,7 @@ local outputoptions = { }, { id = "inspect", - desc = "Inspection (Any)", + desc = S("Inspection (Any)"), func = function(mem) return (mem.carstate == "mrinspect" or mem.carstate == "inspconflict" or mem.carstate == "carinspect") end, @@ -52,7 +54,7 @@ local outputoptions = { }, { id = "fire", - desc = "Fire Service", + desc = S("Fire Service"), func = function(mem) return (mem.carstate == "fs1" or mem.carstate == "fs2" or mem.carstate == "fs2hold") end, @@ -60,7 +62,7 @@ local outputoptions = { }, { id = "fire1", - desc = "Fire Service Phase 1", + desc = S("Fire Service Phase 1"), func = function(mem) return (mem.carstate == "fs1") end, @@ -68,7 +70,7 @@ local outputoptions = { }, { id = "fire2", - desc = "Fire Service Phase 2", + desc = S("Fire Service Phase 2"), func = function(mem) return (mem.carstate == "fs2" or mem.carstate == "fs2hold") end, @@ -76,7 +78,7 @@ local outputoptions = { }, { id = "independent", - desc = "Independent Service", + desc = S("Independent Service"), func = function(mem) return (mem.carstate == "indep") end, @@ -84,7 +86,7 @@ local outputoptions = { }, { id = "swing", - desc = "Swing Operation", + desc = S("Swing Operation"), func = function(mem) return (mem.carstate == "swing") end, @@ -92,7 +94,7 @@ local outputoptions = { }, { id = "opening", - desc = "Doors Opening", + desc = S("Doors Opening"), func = function(mem) return (mem.doorstate == "opening") end, @@ -100,7 +102,7 @@ local outputoptions = { }, { id = "open", - desc = "Doors Open", + desc = S("Doors Open"), func = function(mem) return (mem.doorstate == "open") end, @@ -108,7 +110,7 @@ local outputoptions = { }, { id = "closing", - desc = "Doors Closing", + desc = S("Doors Closing"), func = function(mem) return (mem.doorstate == "closing") end, @@ -116,7 +118,7 @@ local outputoptions = { }, { id = "closed", - desc = "Doors Closed", + desc = S("Doors Closed"), func = function(mem) return (mem.doorstate == "closed") end, @@ -124,7 +126,7 @@ local outputoptions = { }, { id = "moveup", - desc = "Moving Up", + desc = S("Moving Up"), func = function(mem) return (mem.drive.status and mem.drive.status.vel > 0) end, @@ -132,7 +134,7 @@ local outputoptions = { }, { id = "movedown", - desc = "Moving Down", + desc = S("Moving Down"), func = function(mem) return (mem.drive.status and mem.drive.status.vel < 0) end, @@ -140,7 +142,7 @@ local outputoptions = { }, { id = "moving", - desc = "Moving (Any Direction)", + desc = S("Moving (Any Direction)"), func = function(mem) return (mem.drive.status and mem.drive.status.vel ~= 0) end, @@ -148,7 +150,7 @@ local outputoptions = { }, { id = "collectorup", - desc = "Collecting Up Calls", + desc = S("Collecting Up Calls"), func = function(mem) return (mem.carstate == "normal" and mem.direction == "up") end, @@ -156,7 +158,7 @@ local outputoptions = { }, { id = "collectordown", - desc = "Collecting Down Calls", + desc = S("Collecting Down Calls"), func = function(mem) return (mem.carstate == "normal" and mem.direction == "down") end, @@ -164,7 +166,7 @@ local outputoptions = { }, { id = "lightsw", - desc = "Car Light Switch", + desc = S("Car Light Switch"), func = function(mem) return mem.lightsw end, @@ -172,7 +174,7 @@ local outputoptions = { }, { id = "fansw", - desc = "Car Fan Switch", + desc = S("Car Fan Switch"), func = function(mem) return mem.fansw end, @@ -180,7 +182,7 @@ local outputoptions = { }, { id = "upcall", - desc = "Up Call Exists at Landing:", + desc = S("Up Call Exists at Landing:"), func = function(mem,floor) return mem.upcalls[floor] end, @@ -188,7 +190,7 @@ local outputoptions = { }, { id = "downcall", - desc = "Down Call Exists at Landing:", + desc = S("Down Call Exists at Landing:"), func = function(mem,floor) return mem.dncalls[floor] end, @@ -196,7 +198,7 @@ local outputoptions = { }, { id = "carcall", - desc = "Car Call Exists at Landing:", + desc = S("Car Call Exists at Landing:"), func = function(mem,floor) return mem.carcalls[floor] end, @@ -204,7 +206,7 @@ local outputoptions = { }, { id = "apos", - desc = "Car at Landing:", + desc = S("Car at Landing:"), func = function(mem,floor) if mem.drive.status then return (getpos(mem,nil,true) == floor) @@ -214,7 +216,7 @@ local outputoptions = { }, { id = "dpos", - desc = "Moving to Landing:", + desc = S("Moving to Landing:"), func = function(mem,floor) if mem.drive.status then return (getpos(mem,mem.drive.status.dpos) == floor) @@ -227,7 +229,7 @@ local outputoptions = { local doutputoptions = { { id = "fire", - desc = "Fire Service", + desc = S("Fire Service"), func = function(mem) return mem.fs1led end, @@ -235,7 +237,7 @@ local doutputoptions = { }, { id = "upcall", - desc = "Up Call Exists at Landing:", + desc = S("Up Call Exists at Landing:"), func = function(mem,floor) return mem.upcalls[floor] end, @@ -243,7 +245,7 @@ local doutputoptions = { }, { id = "downcall", - desc = "Down Call Exists at Landing:", + desc = S("Down Call Exists at Landing:"), func = function(mem,floor) return mem.dncalls[floor] end, @@ -254,7 +256,7 @@ local doutputoptions = { local inputoptions = { { id = "carcall", - desc = "Car Call at Landing:", + desc = S("Car Call at Landing:"), func_on = function(controllerpos,floor) celevator.controller.run(controllerpos,{ type = "remotemsg", @@ -266,7 +268,7 @@ local inputoptions = { }, { id = "upcall", - desc = "Up Call (simplex car) at Landing:", + desc = S("Up Call (simplex car) at Landing:"), func_on = function(controllerpos,floor) celevator.controller.run(controllerpos,{ type = "remotemsg", @@ -278,7 +280,7 @@ local inputoptions = { }, { id = "downcall", - desc = "Down Call (simplex car) at Landing:", + desc = S("Down Call (simplex car) at Landing:"), func_on = function(controllerpos,floor) celevator.controller.run(controllerpos,{ type = "remotemsg", @@ -290,7 +292,7 @@ local inputoptions = { }, { id = "swingupcall", - desc = "Up Call (swing) at Landing:", + desc = S("Up Call (swing) at Landing:"), func_on = function(controllerpos,floor) celevator.controller.run(controllerpos,{ type = "remotemsg", @@ -302,7 +304,7 @@ local inputoptions = { }, { id = "swingdowncall", - desc = "Down Call (swing) at Landing:", + desc = S("Down Call (swing) at Landing:"), func_on = function(controllerpos,floor) celevator.controller.run(controllerpos,{ type = "remotemsg", @@ -314,7 +316,7 @@ local inputoptions = { }, { id = "fs1off", - desc = "Deactivate Fire Service Phase 1", + desc = S("Deactivate Fire Service Phase 1"), func_on = function(controllerpos) celevator.controller.run(controllerpos,{ type = "fs1switch", @@ -325,7 +327,7 @@ local inputoptions = { }, { id = "fs1on", - desc = "Activate Fire Service (main landing) Phase 1", + desc = S("Activate Fire Service (main landing) Phase 1"), func_on = function(controllerpos) celevator.controller.run(controllerpos,{ type = "fs1switch", @@ -336,7 +338,7 @@ local inputoptions = { }, { id = "fs1onalt", - desc = "Activate Fire Service (alternate landing) Phase 1", + desc = S("Activate Fire Service (alternate landing) Phase 1"), func_on = function(controllerpos) celevator.controller.run(controllerpos,{ type = "fs1switch", @@ -348,7 +350,7 @@ local inputoptions = { }, { id = "mrsmoke", - desc = "Machine Room or Hoistway Smoke Detector", + desc = S("Machine Room or Hoistway Smoke Detector"), func_on = function(controllerpos) celevator.controller.run(controllerpos,{ type = "mrsmoke", @@ -358,7 +360,7 @@ local inputoptions = { }, { id = "secdeny", - desc = "Lock Car Calls at Landing:", + desc = S("Lock Car Calls at Landing:"), func_on = function(controllerpos,floor) celevator.controller.run(controllerpos,{ type = "remotemsg", @@ -373,7 +375,7 @@ local inputoptions = { }, { id = "secauth", - desc = "Require Auth for Car Calls at Landing:", + desc = S("Require Auth for Car Calls at Landing:"), func_on = function(controllerpos,floor) celevator.controller.run(controllerpos,{ type = "remotemsg", @@ -388,7 +390,7 @@ local inputoptions = { }, { id = "secallow", - desc = "Unlock Car Calls at Landing:", + desc = S("Unlock Car Calls at Landing:"), func_on = function(controllerpos,floor) celevator.controller.run(controllerpos,{ type = "remotemsg", @@ -403,7 +405,7 @@ local inputoptions = { }, { id = "swingon", - desc = "Activate Swing Operation", + desc = S("Activate Swing Operation"), func_on = function(controllerpos) celevator.controller.run(controllerpos,{ type = "remotemsg", @@ -415,7 +417,7 @@ local inputoptions = { }, { id = "swingoff", - desc = "Deactivate Swing Operation", + desc = S("Deactivate Swing Operation"), func_on = function(controllerpos) celevator.controller.run(controllerpos,{ type = "remotemsg", @@ -430,7 +432,7 @@ local inputoptions = { local dinputoptions = { { id = "upcall", - desc = "Up Call at Landing:", + desc = S("Up Call at Landing:"), func_on = function(dispatcherpos,floor) celevator.dispatcher.run(dispatcherpos,{ type = "remotemsg", @@ -442,7 +444,7 @@ local dinputoptions = { }, { id = "downcall", - desc = "Down Call at Landing:", + desc = S("Down Call at Landing:"), func_on = function(dispatcherpos,floor) celevator.dispatcher.run(dispatcherpos,{ type = "remotemsg", @@ -454,7 +456,7 @@ local dinputoptions = { }, { id = "fs1off", - desc = "Deactivate Fire Service Phase 1", + desc = S("Deactivate Fire Service Phase 1"), func_on = function(dispatcherpos) celevator.dispatcher.run(dispatcherpos,{ type = "fs1switch", @@ -465,7 +467,7 @@ local dinputoptions = { }, { id = "fs1on", - desc = "Activate Fire Service Phase 1", + desc = S("Activate Fire Service Phase 1"), func_on = function(dispatcherpos) celevator.dispatcher.run(dispatcherpos,{ type = "fs1switch", @@ -479,9 +481,9 @@ local dinputoptions = { local function updateoutputform(pos) local meta = core.get_meta(pos) local dmode = meta:get_int("dispatcher") == 1 - local fs = "formspec_version[7]size[8,6.5]" - fs = fs.."tabheader[0,0;1;tab;Controller,Dispatcher;"..(dmode and "2" or "1")..";true;true]" - fs = fs.."dropdown[1,0.5;6,1;signal;" + local fs = "formspec_version[7]size[9,6.5]" + fs = fs.."tabheader[0,0;1;tab;"..S("Controller")..","..S("Dispatcher")..";"..(dmode and "2" or "1")..";true;true]" + fs = fs.."dropdown[1,0.5;7,1;signal;" local selected = 1 local currentid = meta:get_string("signal") for k,v in ipairs(dmode and doutputoptions or outputoptions) do @@ -490,10 +492,10 @@ local function updateoutputform(pos) end fs = string.sub(fs,1,-2) fs = fs..";"..selected..";false]" - fs = fs.."field[0.5,2.5;3,1;carid;"..(dmode and "Dispatcher ID" or "Car ID")..";${carid}]" - fs = fs.."field[4.5,2.5;3,1;floor;Landing Number;${floor}]" - fs = fs.."label[1.5,4;Not all signal options require a landing number.]" - fs = fs.."button_exit[2.5,5;3,1;save;Save]" + fs = fs.."field[0.5,2.5;3,1;carid;"..(dmode and S("Dispatcher ID") or S("Car ID"))..";${carid}]" + fs = fs.."field[4.5,2.5;3,1;floor;"..S("Landing Number")..";${floor}]" + fs = fs.."label[1.5,4;"..S("Not all signal options require a landing number.").."]" + fs = fs.."button_exit[2.5,5;3,1;save;"..S("Save").."]" meta:set_string("formspec",fs) end @@ -518,7 +520,7 @@ local function handleoutputfields(pos,_,fields,player) if not celevator.dispatcher.isdispatcher(carinfo.dispatcherpos) then return end if core.is_protected(carinfo.dispatcherpos,name) and not core.check_player_privs(name,{protection_bypass=true}) then if player:is_player() then - core.chat_send_player(name,"Can't connect to a dispatcher you don't have access to.") + core.chat_send_player(name,S("Can't connect to a dispatcher you don't have access to.")) core.record_protection_violation(carinfo.dispatcherpos,name) end return @@ -528,7 +530,7 @@ local function handleoutputfields(pos,_,fields,player) if not celevator.controller.iscontroller(carinfo.controllerpos) then return end if core.is_protected(carinfo.controllerpos,name) and not core.check_player_privs(name,{protection_bypass=true}) then if player:is_player() then - core.chat_send_player(name,"Can't connect to a controller you don't have access to.") + core.chat_send_player(name,S("Can't connect to a controller you don't have access to.")) core.record_protection_violation(carinfo.controllerpos,name) end return @@ -546,11 +548,11 @@ local function handleoutputfields(pos,_,fields,player) if def.needsfloor and not floor then return end meta:set_string("signal",def.id) updateoutputform(pos) - local infotext = carid.." - "..def.desc..(def.needsfloor and " "..floor or "") + local infotext = " - "..def.desc..(def.needsfloor and " "..floor or "") if dmode then - infotext = "Dispatcher: "..infotext + infotext = S("Dispatcher: @1",carid)..infotext else - infotext = "Car: "..infotext + infotext = S("Car: @1",carid)..infotext end meta:set_string("infotext",infotext) elseif fields.tab then @@ -560,7 +562,7 @@ local function handleoutputfields(pos,_,fields,player) end core.register_node("celevator:mesecons_output_off",{ - description = "Elevator Mesecons Output", + description = S("Elevator Mesecons Output"), tiles = { "celevator_meseconsoutput_top_off.png", "celevator_cabinet_sides.png", @@ -592,7 +594,7 @@ core.register_node("celevator:mesecons_output_off",{ }) core.register_node("celevator:mesecons_output_on",{ - description = "Elevator Mesecons Output (on state - you hacker you!)", + description = S("Elevator Mesecons Output (on state - you hacker you!)"), tiles = { "celevator_meseconsoutput_top_on.png", "celevator_cabinet_sides.png", @@ -671,9 +673,9 @@ core.register_abm({ local function updateinputform(pos) local meta = core.get_meta(pos) local dmode = meta:get_int("dispatcher") == 1 - local fs = "formspec_version[7]size[8,6.5]" - fs = fs.."tabheader[0,0;1;tab;Controller,Dispatcher;"..(dmode and "2" or "1")..";true;true]" - fs = fs.."dropdown[1,0.5;6,1;signal;" + local fs = "formspec_version[7]size[9,6.5]" + fs = fs.."tabheader[0,0;1;tab;"..S("Controller")..","..S("Dispatcher")..";"..(dmode and "2" or "1")..";true;true]" + fs = fs.."dropdown[1,0.5;7,1;signal;" local selected = 1 local currentid = meta:get_string("signal") for k,v in ipairs(dmode and dinputoptions or inputoptions) do @@ -682,10 +684,10 @@ local function updateinputform(pos) end fs = string.sub(fs,1,-2) fs = fs..";"..selected..";false]" - fs = fs.."field[0.5,2.5;3,1;carid;"..(dmode and "Dispatcher ID" or "Car ID")..";${carid}]" - fs = fs.."field[4.5,2.5;3,1;floor;Landing Number;${floor}]" - fs = fs.."label[1.5,4;Not all signal options require a landing number.]" - fs = fs.."button_exit[2.5,5;3,1;save;Save]" + fs = fs.."field[0.5,2.5;3,1;carid;"..(dmode and S("Dispatcher ID") or S("Car ID"))..";${carid}]" + fs = fs.."field[4.5,2.5;3,1;floor;"..S("Landing Number")..";${floor}]" + fs = fs.."label[1.5,4;"..S("Not all signal options require a landing number.").."]" + fs = fs.."button_exit[2.5,5;3,1;save;"..S("Save").."]" meta:set_string("formspec",fs) end @@ -710,7 +712,7 @@ local function handleinputfields(pos,_,fields,player) if not celevator.dispatcher.isdispatcher(carinfo.dispatcherpos) then return end if core.is_protected(carinfo.dispatcherpos,name) and not core.check_player_privs(name,{protection_bypass=true}) then if player:is_player() then - core.chat_send_player(name,"Can't connect to a dispatcher you don't have access to.") + core.chat_send_player(name,S("Can't connect to a dispatcher you don't have access to.")) core.record_protection_violation(carinfo.dispatcherpos,name) end return @@ -720,7 +722,7 @@ local function handleinputfields(pos,_,fields,player) if not celevator.controller.iscontroller(carinfo.controllerpos) then return end if core.is_protected(carinfo.controllerpos,name) and not core.check_player_privs(name,{protection_bypass=true}) then if player:is_player() then - core.chat_send_player(name,"Can't connect to a controller you don't have access to.") + core.chat_send_player(name,S("Can't connect to a controller you don't have access to.")) core.record_protection_violation(carinfo.controllerpos,name) end return @@ -738,11 +740,11 @@ local function handleinputfields(pos,_,fields,player) if def.needsfloor and not floor then return end meta:set_string("signal",def.id) updateinputform(pos) - local infotext = carid.." - "..def.desc..(def.needsfloor and " "..floor or "") + local infotext = " - "..def.desc..(def.needsfloor and " "..floor or "") if dmode then - infotext = "Dispatcher: "..infotext + infotext = S("Dispatcher: @1",carid)..infotext else - infotext = "Car: "..infotext + infotext = S("Car: @1",carid)..infotext end meta:set_string("infotext",infotext) elseif fields.tab then @@ -790,7 +792,7 @@ local function handleinput(pos,on) end core.register_node("celevator:mesecons_input_off",{ - description = "Elevator Mesecons Input", + description = S("Elevator Mesecons Input"), tiles = { "celevator_meseconsinput_top_off.png", "celevator_cabinet_sides.png", @@ -826,7 +828,7 @@ core.register_node("celevator:mesecons_input_off",{ }) core.register_node("celevator:mesecons_input_on",{ - description = "Elevator Mesecons Input (on state - you hacker you!)", + description = S("Elevator Mesecons Input (on state - you hacker you!)"), tiles = { "celevator_meseconsinput_top_on.png", "celevator_cabinet_sides.png", diff --git a/pilantern.lua b/pilantern.lua index 5b2a7e4..c778fed 100644 --- a/pilantern.lua +++ b/pilantern.lua @@ -1,6 +1,8 @@ celevator.pi = {} celevator.lantern = {} +local S = core.get_translator("celevator") + local boringside = "[combine:64x64".. ":0,0=celevator_cabinet_sides.png".. ":32,0=celevator_cabinet_sides.png".. @@ -146,7 +148,7 @@ function celevator.pi.setarrow(pos,which,active) end core.register_node("celevator:pi",{ - description = "Elevator Position Indicator", + description = S("Elevator Position Indicator"), groups = { dig_immediate = 2, _celevator_pi = 1, @@ -172,7 +174,7 @@ core.register_node("celevator:pi",{ }, after_place_node = function(pos) local meta = core.get_meta(pos) - meta:set_string("formspec","formspec_version[7]size[8,5]field[0.5,0.5;7,1;carid;Car ID;]button[3,3.5;2,1;save;Save]") + meta:set_string("formspec","formspec_version[7]size[8,5]field[0.5,0.5;7,1;carid;"..S("Car ID")..";]button[3,3.5;2,1;save;"..S("Save").."]") end, on_receive_fields = function(pos,_,fields) if tonumber(fields.carid) then @@ -328,15 +330,25 @@ local function makeverticallanterntex(dir,upon,downon) return(tex) end +local upname = S("Elevator Up Lantern") +local upvname = S("Elevator Up Lantern (vertical)") +local upcname = S("Elevator Up Position Indicator / Lantern Combo") +local downname = S("Elevator Down Lantern") +local downvname = S("Elevator Down Lantern (vertical)") +local downcname = S("Elevator Down Position Indicator / Lantern Combo") +local bothname = S("Elevator Up and Down Lantern") +local bothvname = S("Elevator Up and Down Lantern (vertical)") +local bothcname = S("Elevator Up and Down Position Indicator / Lantern Combo") + local validstates = { - {"up",false,false,"Up"}, - {"up",true,false,"Up"}, - {"down",false,false,"Down"}, - {"down",false,true,"Down"}, - {"both",false,false,"Up and Down"}, - {"both",true,false,"Up and Down"}, - {"both",false,true,"Up and Down"}, - {"both",true,true,"Up and Down"}, + {"up",false,false,upname,upvname,upcname}, + {"up",true,false,upname,upvname,upcname}, + {"down",false,false,downname,downvname,downcname}, + {"down",false,true,downname,downvname,downcname}, + {"both",false,false,bothname,bothvname,bothcname}, + {"both",true,false,bothname,bothvname,bothcname}, + {"both",false,true,bothname,bothvname,bothcname}, + {"both",true,true,bothname,bothvname,bothcname}, } for _,state in ipairs(validstates) do @@ -352,7 +364,7 @@ for _,state in ipairs(validstates) do light = light + 4 end local idle = not (state[2] or state[3]) - local description = string.format("Elevator %s Position Indicator/Lantern Combo%s",state[4],(idle and "" or " (on state, you hacker you!)")) + local description = state[6] core.register_node(nname,{ description = description, groups = { @@ -387,7 +399,11 @@ for _,state in ipairs(validstates) do }, after_place_node = function(pos) local meta = core.get_meta(pos) - meta:set_string("formspec","formspec_version[7]size[8,5]field[0.5,0.5;7,1;carid;Car ID;]field[0.5,2;7,1;landing;Landing Number;]button[3,3.5;2,1;save;Save]") + local fs = "formspec_version[7]size[8,5]" + fs = fs.."field[0.5,0.5;7,1;carid;"..S("Car ID")..";]" + fs = fs.."field[0.5,2;7,1;landing;"..S("Landing Number")..";]" + fs = fs.."button[3,3.5;2,1;save;"..S("Save").."]" + meta:set_string("formspec",fs) end, on_receive_fields = function(pos,_,fields) if tonumber(fields.carid) and tonumber(fields.landing) then @@ -435,7 +451,7 @@ for _,state in ipairs(validstates) do if state[2] then nname = nname.."_upon" end if state[3] then nname = nname.."_downon" end idle = not (state[2] or state[3]) - description = string.format("Elevator %s Lantern%s",state[4],(idle and "" or " (on state, you hacker you!)")) + description = state[4] core.register_node(nname,{ description = description, inventory_image = string.format("[combine:32x32:0,5=celevator_lantern_background_%s.png",(state[1] == "both" and "updown" or state[1])), @@ -459,7 +475,11 @@ for _,state in ipairs(validstates) do }, after_place_node = function(pos) local meta = core.get_meta(pos) - meta:set_string("formspec","formspec_version[7]size[8,5]field[0.5,0.5;7,1;carid;Car ID;]field[0.5,2;7,1;landing;Landing Number;]button[3,3.5;2,1;save;Save]") + local fs = "formspec_version[7]size[8,5]" + fs = fs.."field[0.5,0.5;7,1;carid;"..S("Car ID")..";]" + fs = fs.."field[0.5,2;7,1;landing;"..S("Landing Number")..";]" + fs = fs.."button[3,3.5;2,1;save;"..S("Save").."]" + meta:set_string("formspec",fs) end, on_receive_fields = function(pos,_,fields) if tonumber(fields.carid) and tonumber(fields.landing) then @@ -502,7 +522,7 @@ for _,state in ipairs(validstates) do dropname = nname if state[2] then nname = nname.."_upon" end if state[3] then nname = nname.."_downon" end - description = string.format("Elevator %s Lantern (vertical)%s",state[4],(idle and "" or " (on state, you hacker you!)")) + description = state[5] core.register_node(nname,{ description = description, inventory_image = string.format("[combine:40x40:10,0=celevator_lantern_vertical_background_%s.png",(state[1] == "both" and "updown" or state[1])), @@ -527,7 +547,11 @@ for _,state in ipairs(validstates) do }, after_place_node = function(pos) local meta = core.get_meta(pos) - meta:set_string("formspec","formspec_version[7]size[8,5]field[0.5,0.5;7,1;carid;Car ID;]field[0.5,2;7,1;landing;Landing Number;]button[3,3.5;2,1;save;Save]") + local fs = "formspec_version[7]size[8,5]" + fs = fs.."field[0.5,0.5;7,1;carid;"..S("Car ID")..";]" + fs = fs.."field[0.5,2;7,1;landing;"..S("Landing Number")..";]" + fs = fs.."button[3,3.5;2,1;save;"..S("Save").."]" + meta:set_string("formspec",fs) end, on_receive_fields = function(pos,_,fields) if tonumber(fields.carid) and tonumber(fields.landing) then -- cgit v1.2.3