mirror of
https://github.com/minetest/minetest_game.git
synced 2025-06-29 05:10:25 +02:00
Add support for MT 5 game translation (rebasing ) (#2466)
rebased #2368
This commit is contained in:
@ -1,5 +1,8 @@
|
||||
default.chest = {}
|
||||
|
||||
-- support for MT game translation.
|
||||
local S = default.get_translator
|
||||
|
||||
function default.chest.get_chest_formspec(pos)
|
||||
local spos = pos.x .. "," .. pos.y .. "," .. pos.z
|
||||
local formspec =
|
||||
@ -84,7 +87,7 @@ function default.chest.register_chest(name, d)
|
||||
if def.protected then
|
||||
def.on_construct = function(pos)
|
||||
local meta = minetest.get_meta(pos)
|
||||
meta:set_string("infotext", "Locked Chest")
|
||||
meta:set_string("infotext", S("Locked Chest"))
|
||||
meta:set_string("owner", "")
|
||||
local inv = meta:get_inventory()
|
||||
inv:set_size("main", 8*4)
|
||||
@ -92,8 +95,7 @@ function default.chest.register_chest(name, d)
|
||||
def.after_place_node = function(pos, placer)
|
||||
local meta = minetest.get_meta(pos)
|
||||
meta:set_string("owner", placer:get_player_name() or "")
|
||||
meta:set_string("infotext", "Locked Chest (owned by " ..
|
||||
meta:get_string("owner") .. ")")
|
||||
meta:set_string("infotext", S("Locked Chest (owned by @1)", meta:get_string("owner")))
|
||||
end
|
||||
def.can_dig = function(pos,player)
|
||||
local meta = minetest.get_meta(pos);
|
||||
@ -171,7 +173,7 @@ function default.chest.register_chest(name, d)
|
||||
-- verify placer is owner of lockable chest
|
||||
if owner ~= pn then
|
||||
minetest.record_protection_violation(pos, pn)
|
||||
minetest.chat_send_player(pn, "You do not own this chest.")
|
||||
minetest.chat_send_player(pn, S("You do not own this chest."))
|
||||
return nil
|
||||
end
|
||||
|
||||
@ -181,12 +183,12 @@ function default.chest.register_chest(name, d)
|
||||
meta:set_string("key_lock_secret", secret)
|
||||
end
|
||||
|
||||
return secret, "a locked chest", owner
|
||||
return secret, S("a locked chest"), owner
|
||||
end
|
||||
else
|
||||
def.on_construct = function(pos)
|
||||
local meta = minetest.get_meta(pos)
|
||||
meta:set_string("infotext", "Chest")
|
||||
meta:set_string("infotext", S("Chest"))
|
||||
local inv = meta:get_inventory()
|
||||
inv:set_size("main", 8*4)
|
||||
end
|
||||
@ -285,7 +287,7 @@ function default.chest.register_chest(name, d)
|
||||
end
|
||||
|
||||
default.chest.register_chest("chest", {
|
||||
description = "Chest",
|
||||
description = S("Chest"),
|
||||
tiles = {
|
||||
"default_chest_top.png",
|
||||
"default_chest_top.png",
|
||||
@ -301,7 +303,7 @@ default.chest.register_chest("chest", {
|
||||
})
|
||||
|
||||
default.chest.register_chest("chest_locked", {
|
||||
description = "Locked Chest",
|
||||
description = S("Locked Chest"),
|
||||
tiles = {
|
||||
"default_chest_top.png",
|
||||
"default_chest_top.png",
|
||||
|
Reference in New Issue
Block a user