Make translatable
parent
fcd8c9ebfe
commit
8e6066b58f
13
init.lua
13
init.lua
|
@ -1,3 +1,6 @@
|
|||
local S = minetest.get_translator("teleports")
|
||||
local F = minetest.formspec_escape
|
||||
|
||||
teleports = {}
|
||||
teleports.teleports = {}
|
||||
teleports.lastplayername =""
|
||||
|
@ -106,20 +109,20 @@ teleports.set_formspec = function(pos)
|
|||
local buttons = "";
|
||||
for i, EachTeleport in ipairs( teleports:find_nearby(pos, 5) ) do
|
||||
if EachTeleport["name"] then
|
||||
buttons = buttons.."button_exit[3,"..(i)..";4,0.5;tp"..i..";GO>"..minetest.formspec_escape(EachTeleport.name).."]";
|
||||
buttons = buttons.."button_exit[3,"..(i)..";4,0.5;tp"..i..";"..F(S("GO>@1",EachTeleport.name)).."]";
|
||||
else
|
||||
buttons = buttons.."button_exit[3,"..(i)..";4,0.5;tp"..i..";GO>"..EachTeleport.pos.x..","..EachTeleport.pos.y..","..EachTeleport.pos.z.."]";
|
||||
buttons = buttons.."button_exit[3,"..(i)..";4,0.5;tp"..i..";"..F(S("GO>@1,@2,@3",EachTeleport.pos.x,EachTeleport.pos.y,EachTeleport.pos.z)).."]";
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
meta:set_string("formspec", "size[8,10;]"
|
||||
.."label[0,0;" .. 'Go to available teleports! Use mossy cobble as fuel!' .. "]"
|
||||
.."label[0,0;" .. F(S("Go to available teleports! Use mossy cobblestone as fuel!")) .. "]"
|
||||
.."list[current_name;price;0,1;1,1;]"
|
||||
|
||||
..buttons
|
||||
|
||||
.."button_exit[1,5;2,0.5;cancel;Cancel]"
|
||||
.."button_exit[1,5;2,0.5;cancel;"..F(S("Cancel")).."]"
|
||||
.."list[current_player;main;0,6;8,4;]")
|
||||
end
|
||||
teleports.on_receive_fields = function(pos, formname, fields, player)
|
||||
|
@ -167,7 +170,7 @@ teleports:load()
|
|||
|
||||
|
||||
minetest.register_node("teleports:teleport", {
|
||||
description = "Teleport",
|
||||
description = S("Teleport"),
|
||||
drawtype = "glasslike",
|
||||
tiles = {"teleports_teleport_top.png"},
|
||||
is_ground_content = false,
|
||||
|
|
Loading…
Reference in New Issue