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_standard.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_standard.lua')
| -rw-r--r-- | car_standard.lua | 11 |
1 files changed, 7 insertions, 4 deletions
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 |
