Add translation for itemframe

pull/131/head
Louis Royer 2020-08-26 19:11:02 +02:00
parent b828df2644
commit 82f068fce1
3 changed files with 16 additions and 5 deletions

View File

@ -67,3 +67,8 @@ Your weapon inflicts more damages=
Artificial Hive=
Bees are busy making honey…=
Honey=
### itemframe.lua ###
@1 (owned by @2)=
Item Frame=

View File

@ -67,3 +67,8 @@ Your weapon inflicts more damages=Votre arme inflige plus de dégâts
Artificial Hive=Ruche artificielle
Bees are busy making honey…=Les abeilles sont occupées à fabriquer du miel…
Honey=Miel
### itemframe.lua ###
@1 (owned by @2)=@1 (propriété de @2)
Item Frame=Cadre

View File

@ -1,4 +1,5 @@
local itemframe, tmp = {}, {}
local S = minetest.get_translator("xdecor")
screwdriver = screwdriver or {}
local function remove_item(pos, node)
@ -56,7 +57,7 @@ function itemframe.after_place(pos, placer, itemstack)
local meta = minetest.get_meta(pos)
local name = placer:get_player_name()
meta:set_string("owner", name)
meta:set_string("infotext", "Item Frame (owned by " .. name .. ")")
meta:set_string("infotext", S("@1 (owned by @2)", S("Item Frame"), name))
end
function itemframe.timer(pos)
@ -86,9 +87,9 @@ function itemframe.rightclick(pos, node, clicker, itemstack)
meta:set_string("item", itemstring)
update_item(pos, node)
if itemstring == "" then
meta:set_string("infotext", "Item Frame (owned by " .. owner .. ")")
meta:set_string("infotext", S("@1 (owned by @2)", S("Item Frame"), owner))
else
meta:set_string("infotext", itemstring.." (owned by " .. owner .. ")")
meta:set_string("infotext", S("@1 (owned by @2)", itemstring, owner))
end
return itemstack
end
@ -115,7 +116,7 @@ function itemframe.dig(pos, player)
end
xdecor.register("itemframe", {
description = "Item Frame",
description = S("Item Frame"),
groups = {choppy = 3, oddly_breakable_by_hand = 2, flammable = 3},
sounds = default.node_sound_wood_defaults(),
on_rotate = screwdriver.disallow,
@ -182,4 +183,4 @@ minetest.register_craft({
{"group:stick", "default:paper", "group:stick"},
{"group:stick", "group:stick", "group:stick"}
}
})
})