forked from mtcontrib/3d_armor
added complete intllib support (i18n)
added french translation
This commit is contained in:
@ -1,13 +1,6 @@
|
||||
local S = function(s) return s end
|
||||
if minetest.global_exists("intllib") then
|
||||
if intllib.make_gettext_pair then
|
||||
-- New method using gettext.
|
||||
S = intllib.make_gettext_pair()
|
||||
else
|
||||
-- Old method using text files.
|
||||
S = intllib.Getter()
|
||||
end
|
||||
end
|
||||
-- support for i18n
|
||||
local S = armor_i18n.gettext
|
||||
|
||||
local armor_stand_formspec = "size[8,7]" ..
|
||||
default.gui_bg ..
|
||||
default.gui_bg_img ..
|
||||
@ -172,7 +165,7 @@ minetest.register_node("3d_armor_stand:armor_stand", {
|
||||
on_construct = function(pos)
|
||||
local meta = minetest.get_meta(pos)
|
||||
meta:set_string("formspec", armor_stand_formspec)
|
||||
meta:set_string("infotext", "Armor Stand")
|
||||
meta:set_string("infotext", S("Armor Stand"))
|
||||
local inv = meta:get_inventory()
|
||||
for _, element in pairs(elements) do
|
||||
inv:set_size("armor_"..element, 1)
|
||||
@ -240,7 +233,7 @@ minetest.register_node("3d_armor_stand:locked_armor_stand", {
|
||||
on_construct = function(pos)
|
||||
local meta = minetest.get_meta(pos)
|
||||
meta:set_string("formspec", armor_stand_formspec)
|
||||
meta:set_string("infotext", "Armor Stand")
|
||||
meta:set_string("infotext", S("Armor Stand"))
|
||||
meta:set_string("owner", "")
|
||||
local inv = meta:get_inventory()
|
||||
for _, element in pairs(elements) do
|
||||
@ -261,8 +254,7 @@ minetest.register_node("3d_armor_stand:locked_armor_stand", {
|
||||
minetest.add_entity(pos, "3d_armor_stand:armor_entity")
|
||||
local meta = minetest.get_meta(pos)
|
||||
meta:set_string("owner", placer:get_player_name() or "")
|
||||
meta:set_string("infotext", "Armor Stand (owned by " ..
|
||||
meta:get_string("owner") .. ")")
|
||||
meta:set_string("infotext", S("Armor Stand (owned by @1)", meta:get_string("owner")))
|
||||
add_hidden_node(pos, placer)
|
||||
end,
|
||||
allow_metadata_inventory_put = function(pos, listname, index, stack, player)
|
||||
@ -344,4 +336,3 @@ minetest.register_craft({
|
||||
{"3d_armor_stand:armor_stand", "default:steel_ingot"},
|
||||
}
|
||||
})
|
||||
|
||||
|
Reference in New Issue
Block a user