diff options
| author | cheapie <no-email-for-you@example.com> | 2025-12-13 19:25:48 -0600 |
|---|---|---|
| committer | cheapie <no-email-for-you@example.com> | 2025-12-13 19:27:24 -0600 |
| commit | f885c04e95cf9291330a42ceb0612dd3568ac7c7 (patch) | |
| tree | ec234363aacb95490fd3ca89287e62e8b0998d72 /car_metal.lua | |
| parent | 8869adfb33e0c0109dad606331fe239b1af6e75f (diff) | |
| download | celevator-f885c04e95cf9291330a42ceb0612dd3568ac7c7.tar celevator-f885c04e95cf9291330a42ceb0612dd3568ac7c7.tar.gz celevator-f885c04e95cf9291330a42ceb0612dd3568ac7c7.tar.bz2 celevator-f885c04e95cf9291330a42ceb0612dd3568ac7c7.tar.xz celevator-f885c04e95cf9291330a42ceb0612dd3568ac7c7.zip | |
Add translation support and rudimentary Spanish locale
Diffstat (limited to 'car_metal.lua')
| -rw-r--r-- | car_metal.lua | 17 |
1 files changed, 10 insertions, 7 deletions
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 |
