aboutsummaryrefslogtreecommitdiff
path: root/steles/nodes.lua
diff options
context:
space:
mode:
authorfat115 <fat115@framasoft.org>2017-08-05 10:12:43 +0200
committerfat115 <fat115@framasoft.org>2017-08-05 10:12:43 +0200
commit2fef15d878f00c72a799aebc5b8a6bd61489296e (patch)
tree5d5ec63f18bb317fa7c56dcb00c8ffa7f3a62b10 /steles/nodes.lua
parent54108e8054ee21e1a3b229f4a4e9e521f5700aa6 (diff)
downloaddisplay_modpack-2fef15d878f00c72a799aebc5b8a6bd61489296e.tar.gz
display_modpack-2fef15d878f00c72a799aebc5b8a6bd61489296e.tar.bz2
display_modpack-2fef15d878f00c72a799aebc5b8a6bd61489296e.zip
add intllib support (i18n)
-> mods ontime_clocks, signs, signs_roads & steles add french translations add updatepo.sh script to update po/pot files add specific array for full description of steles
Diffstat (limited to 'steles/nodes.lua')
-rw-r--r--steles/nodes.lua16
1 files changed, 10 insertions, 6 deletions
diff --git a/steles/nodes.lua b/steles/nodes.lua
index 36515f0..a298293 100644
--- a/steles/nodes.lua
+++ b/steles/nodes.lua
@@ -18,6 +18,9 @@
along with steles. If not, see <http://www.gnu.org/licenses/>.
--]]
+local S = steles.intllib
+local F = function(...) return minetest.formspec_escape(S(...)) end
+
function steles.on_receive_fields(pos, formname, fields, player)
if not minetest.is_protected(pos, player:get_player_name()) then
local meta = minetest.get_meta(pos)
@@ -31,7 +34,7 @@ end
display_lib.register_display_entity("steles:text")
-for _, material in ipairs(steles.materials) do
+for i, material in ipairs(steles.materials) do
local ndef = minetest.registered_nodes[material]
@@ -39,7 +42,7 @@ for _, material in ipairs(steles.materials) do
local parts = material:split(":")
minetest.register_node("steles:"..parts[2].."_stele", {
- description = ndef.description.." Stele",
+ description = steles.materials_desc[i],
sunlight_propagates = true,
paramtype = "light",
paramtype2 = "facedir",
@@ -65,9 +68,11 @@ for _, material in ipairs(steles.materials) do
on_place = display_lib.on_place,
on_construct = function(pos)
local meta = minetest.get_meta(pos)
- meta:set_string("formspec", "size[6,4]"..
- "textarea[0.5,0.7;5.5,2;display_text;Displayed text (3 lines max);${display_text}]"..
- "button_exit[2,3;2,1;ok;Write]")
+ meta:set_string("formspec", "size[6,4]"
+ .."textarea[0.5,0.7;5.5,2;display_text;"
+ ..F("Displayed text (3 lines max)")
+ ..";${display_text}]"
+ .."button_exit[2,3;2,1;ok;"..F("Write").."]")
display_lib.on_construct(pos)
end,
on_destruct = display_lib.on_destruct,
@@ -85,4 +90,3 @@ for _, material in ipairs(steles.materials) do
})
end
end
-