diff options
Diffstat (limited to 'advtrains/couple.lua')
-rw-r--r-- | advtrains/couple.lua | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/advtrains/couple.lua b/advtrains/couple.lua index 4933dd8..cb325a0 100644 --- a/advtrains/couple.lua +++ b/advtrains/couple.lua @@ -18,6 +18,9 @@ -- train.couple_* contain references to ObjectRefs of couple objects, which contain all relevant information -- These objectRefs will delete themselves once the couples no longer match (see below) +-- Get current translator +local S = advtrains.translate + advtrains.coupler_types = {} function advtrains.register_coupler_type(code, name) @@ -25,8 +28,8 @@ function advtrains.register_coupler_type(code, name) end -- Register some default couplers -advtrains.register_coupler_type("chain", attrans("Buffer and Chain Coupler")) -advtrains.register_coupler_type("scharfenberg", attrans("Scharfenberg Coupler")) +advtrains.register_coupler_type("chain", S("Buffer and Chain Coupler")) +advtrains.register_coupler_type("scharfenberg", S("Scharfenberg Coupler")) for _, name in pairs {"couple", "decouple"} do local t = {} @@ -245,7 +248,7 @@ function advtrains.couple_trains(init_train, invert_init_train, stat_train, stat -- sanity check, prevent coupling if train would be longer than 20 after coupling local tot_len = init_wagoncnt + stat_wagoncnt if tot_len > advtrains.TRAIN_MAX_WAGONS then - atwarn("Cannot couple",stat_train.id,"and",init_train.id,"- train would have length",tot_len,"which is above the limit of",advtrains.TRAIN_MAX_WAGONS) + atwarn(S("Cannot couple @1 and @2 - train would have length @3 which is above the limit of @4", stat_train.id, init_train.id, tot_len, advtrains.TRAIN_MAX_WAGONS)) return end @@ -351,12 +354,12 @@ function advtrains.check_matching_coupler_types(t1, t1_front, t2, t2_front) for typ,_ in pairs(t1_cplt) do table.insert(t1_cplhr, advtrains.coupler_types[typ] or typ) end - if #t1_cplhr==0 then t1_cplhr[1]=attrans("<No coupler>") end + if #t1_cplhr==0 then t1_cplhr[1]=S("<No coupler>") end for typ,_ in pairs(t2_cplt) do table.insert(t2_cplhr, advtrains.coupler_types[typ] or typ) end - if #t2_cplhr==0 then t2_cplhr[1]=attrans("<No coupler>") end - return false, attrans("Can not couple: The couplers of the trains do not match (@1 and @2).", table.concat(t1_cplhr, ","), table.concat(t2_cplhr, ",")) + if #t2_cplhr==0 then t2_cplhr[1]=S("<No coupler>") end + return false, S("Can not couple: The couplers of the trains do not match (@1 and @2).", table.concat(t1_cplhr, ","), table.concat(t2_cplhr, ",")) end -- DECOUPLING -- |