aboutsummaryrefslogtreecommitdiff
path: root/advtrains_interlocking/smartroute.lua
diff options
context:
space:
mode:
Diffstat (limited to 'advtrains_interlocking/smartroute.lua')
-rw-r--r--advtrains_interlocking/smartroute.lua13
1 files changed, 8 insertions, 5 deletions
diff --git a/advtrains_interlocking/smartroute.lua b/advtrains_interlocking/smartroute.lua
index 76c7814..2b9138c 100644
--- a/advtrains_interlocking/smartroute.lua
+++ b/advtrains_interlocking/smartroute.lua
@@ -1,6 +1,9 @@
-- smartroute.lua
-- Implementation of the advtrains auto-route search
+-- Get current translator
+local S = advtrains.interlocking.translate
+
local atil = advtrains.interlocking
local ildb = atil.db
local sr = {}
@@ -143,10 +146,10 @@ local players_smartroute_actions = {}
function sr.propose_next(pname, sigd, find_more_than, searching_shunt)
local tcbs = ildb.get_tcbs(sigd)
if not tcbs or not tcbs.routes then
- minetest.chat_send_player(pname, "Smartroute: TCBS or routes don't exist here!")
+ minetest.chat_send_player(pname, S("Smartroute: TCBS or routes don't exist here!"))
return
elseif not tcbs.ts_id then
- minetest.chat_send_player(pname, "Smartroute: No track section directly ahead!")
+ minetest.chat_send_player(pname, S("Smartroute: No track section directly ahead!"))
return
end
-- Step 1: search for routes using the current settings
@@ -158,7 +161,7 @@ function sr.propose_next(pname, sigd, find_more_than, searching_shunt)
found_routes = found_routes
}
-- step 3: build form
- local form = "size[8,5]label[0,0;Route search: "..#found_routes.." found]"
+ local form = "size[8,5]label[0,0;"..S("Route search: @1 found", #found_routes).."]"
local tab = {}
for idx, froute in ipairs(found_routes) do
local secfl = table.copy(froute.secseq)
@@ -172,8 +175,8 @@ function sr.propose_next(pname, sigd, find_more_than, searching_shunt)
tab[idx] = minetest.formspec_escape(froute.name..viatext)
end
form=form.."textlist[0.5,1;7,3;rtelist;"..table.concat(tab, ",").."]"
- form=form.."button[0.5,4;2,1;continue;Search further]"
- form=form.."button[2.5,4;2,1;apply;Apply]"
+ form=form.."button[0.5,4;2,1;continue;"..S("Search further").."]"
+ form=form.."button[2.5,4;2,1;apply;"..S("Apply").."]"
minetest.show_formspec(pname, "at_il_smartroute_propose", form)
end