* Adicionando tradução

This commit is contained in:
Lunovox 2017-03-15 17:34:41 -03:00
parent d78a216648
commit cb8c852cd4
4 changed files with 34 additions and 127 deletions

View file

@ -1,5 +1,5 @@
minetest.register_node("minertrade:atm", {
description = "Caixa Eletronico (ATM) - Guarde o seu dinheiro neste Caixa Eletrônico, e retire seu dinheiro em seu Cofre Pessoal ou qualquer outro Caixa Eletrônico espalhado pelo mapa.",
description = modMinerTrade.translate("PUBLIC ATM\n* Save your money in the ATM, and withdraw your money in your Personal Safe or other ATM in the shops scattered around the map."),
--inventory_image = minetest.inventorycube("text_atm_front_1.png"),
--inventory_image = "text_atm_front_1.png",
paramtype = "light",
@ -60,7 +60,7 @@ minetest.register_node("minertrade:atm", {
param2 = facedir,
})
local meta = minetest.get_meta(posAbove)
meta:set_string("infotext", "Caixa Eletronico (ATM) - Guarde o seu dinheiro neste Caixa Eletrônico, e retire seu dinheiro em seu Cofre Pessoal ou qualquer outro Caixa Eletrônico espalhado pelo mapa.")
meta:set_string("infotext", modMinerTrade.translate("PUBLIC ATM\n* Save your money in the ATM, and withdraw your money in your Personal Safe or other ATM in the shops scattered around the map."))
local now = os.time() --Em milisegundos
if not minetest.get_player_privs(playername).server then
meta:set_string("opentime", now+modMinerTrade.delayConstruct)
@ -69,7 +69,7 @@ minetest.register_node("minertrade:atm", {
end
itemstack:take_item() -- itemstack:take_item() = Ok
else
minetest.chat_send_player(playername, "[ATM] Voce nao pode por este caixa eletronico muito longe de uma Maquina Dispensadora!")
minetest.chat_send_player(playername, modMinerTrade.translate("[MINERTRADE] You can not install this 'ATM' too far from a 'Dispensing Machine'!"))
--return itemstack -- = Cancel
end
@ -79,6 +79,7 @@ minetest.register_node("minertrade:atm", {
on_rightclick = function(pos, node, clicker)
local playername = clicker:get_player_name()
local meta = minetest.get_meta(pos)
meta:set_string("infotext", modMinerTrade.translate("PUBLIC ATM\n* Save your money in the ATM, and withdraw your money in your Personal Safe or other ATM in the shops scattered around the map."))
local opentime = tonumber(meta:get_string("opentime")) or 0
local now = os.time() --Em milisegundos
if now >= opentime or minetest.get_player_privs(playername).server then
@ -89,7 +90,7 @@ minetest.register_node("minertrade:atm", {
modMinerTrade.getFormspec(playername)
)
else
minetest.chat_send_player(playername, "[ATM] O Caixa Eletronico so vai funcionar "..(opentime-now).." segundos depois de instalado!")
minetest.chat_send_player(playername, modMinerTrade.translate("[MINERTRADE] The ATM will only run %02d seconds after it is installed!"):format(opentime-now))
end
end,
})
@ -103,6 +104,8 @@ minetest.register_craft({
}
})
minetest.register_alias("atm" ,"minertrade:atm")
minetest.register_alias("atmbox" ,"minertrade:atm")
minetest.register_alias("caixaeletronico" ,"minertrade:atm")
minetest.register_alias("atm" ,"minertrade:atm")
minetest.register_alias(
modMinerTrade.translate("atm"),
"minertrade:atm"
)

View file

@ -1,5 +1,5 @@
minetest.register_node("minertrade:strongbox", {
description = "Cofre - Guarde seu dinheiro neste cofre e retire seu dinheiro em qualquer loja que possua um Caixa Eletrônico",
description = modMinerTrade.translate("STRONGBOX\n* Save your money in this safe and withdraw your money at any store that has an ATM."),
--inventory_image = "safe_front.png",
paramtype = "light",
@ -19,17 +19,15 @@ minetest.register_node("minertrade:strongbox", {
},
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", "Cofre (Propriedade de "..meta:get_string("owner")..") - Guarde seu dinheiro neste cofre e retire seu dinheiro em qualquer loja que possua um Caixa Eletrônico.")
local ownername = placer:get_player_name() or ""
meta:set_string("owner", ownername)
meta:set_string("infotext", modMinerTrade.translate("STRONGBOX (Property of '%s')\n* Save your money in this safe and withdraw your money at any store that has an ATM."):format(ownername))
local now = os.time() --Em milisegundos
meta:set_string("opentime", now+modMinerTrade.delayConstruct)
end,
can_dig = function(pos,player)
local meta = minetest.get_meta(pos);
if modMinerTrade.isOpen(meta, player) then
--local inv = meta:get_inventory()
--inv:set_list("safe", { })
--return inv:is_empty("main") and modMinerTrade.isOpen(meta, player)
return true
else
return false
@ -39,6 +37,7 @@ minetest.register_node("minertrade:strongbox", {
local playername = clicker:get_player_name()
local meta = minetest.get_meta(pos)
local ownername = meta:get_string("owner")
meta:set_string("infotext", modMinerTrade.translate("STRONGBOX (Property of '%s')\n* Save your money in this safe and withdraw your money at any store that has an ATM."):format(ownername))
if modMinerTrade.isOpen(meta, clicker) then
local opentime = tonumber(meta:get_string("opentime")) or 0
local now = os.time() --Em milisegundos
@ -50,10 +49,10 @@ minetest.register_node("minertrade:strongbox", {
modMinerTrade.getFormspec(ownername)
)
else
minetest.chat_send_player(playername, "[COFRE] O cofre so vai funcionar "..(opentime-now).." segundos depois de instalado!")
minetest.chat_send_player(playername, modMinerTrade.translate("[MINERTRADE] The safe is going to work %02d seconds after it is installed!"):format(opentime-now))
end
else
minetest.chat_send_player(playername, "[COFRE] Este cofre pertence a '"..ownername.."'!")
minetest.chat_send_player(playername, modMinerTrade.translate("[MINERTRADE] You do not have access to the safe belonging to '%s'!"):format(ownername))
end
end,
})
@ -68,6 +67,7 @@ minetest.register_craft({
})
minetest.register_alias("strongbox" ,"minertrade:strongbox")
minetest.register_alias("cofre" ,"minertrade:strongbox")
minetest.register_alias("cofreforte" ,"minertrade:strongbox")
minetest.register_alias("caixaforte" ,"minertrade:strongbox")
minetest.register_alias(
modMinerTrade.translate("strongbox"),
"minertrade:strongbox"
)

View file

@ -1,109 +0,0 @@
minetest.register_node("strongbox:safe", {
description = "Cofre (12 Espacos)",
--inventory_image = "safe_front.png",
paramtype = "light",
sunlight_propagates = true,
light_source = default.LIGHT_MAX,
paramtype2 = "facedir",
tiles = {
"safe_side.png",
"safe_side.png",
"safe_side.png",
"safe_side.png",
"safe_side.png",
"safe_front.png",
},
is_ground_content = false,
--groups = {cracky=1},
groups = {cracky=3,oddly_breakable_by_hand=3},
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", "Cofre (Propriedade de "..meta:get_string("owner")..")")
end,
on_construct = function(pos)
local meta = minetest.get_meta(pos)
meta:set_string("owner", "")
meta:set_string("infotext", "Cofre")
local inv = meta:get_inventory()
inv:set_size("main", 6*2)
end,
can_dig = function(pos,player)
local meta = minetest.get_meta(pos);
local inv = meta:get_inventory()
return inv:is_empty("main") and strongbox.isOpen(meta, player)
end,
allow_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player)
local meta = minetest.get_meta(pos)
if not strongbox.isOpen(meta, player) then
minetest.log("action",
player:get_player_name().." tentou mover um objeto no cofre de "..meta:get_string("owner").." em "..minetest.pos_to_string(pos)
)
return 0
end
return count
end,
allow_metadata_inventory_put = function(pos, listname, index, stack, player)
local meta = minetest.get_meta(pos)
if not strongbox.isOpen(meta, player) then
minetest.log("action", player:get_player_name()..
" tentou por um objeto no cofre de "..
meta:get_string("owner").." em "..
minetest.pos_to_string(pos))
return 0
end
return stack:get_count()
end,
allow_metadata_inventory_take = function(pos, listname, index, stack, player)
local meta = minetest.get_meta(pos)
if not strongbox.isOpen(meta, player) then
minetest.log("action", player:get_player_name()..
" tentou pegar um objeto no cofre de "..
meta:get_string("owner").." em "..
minetest.pos_to_string(pos))
return 0
end
return stack:get_count()
end,
on_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player)
minetest.log("action", player:get_player_name()..
" moveu um item no cofre em "..minetest.pos_to_string(pos))
end,
on_metadata_inventory_put = function(pos, listname, index, stack, player)
minetest.log("action", player:get_player_name()..
" colocou um item no cofre em "..minetest.pos_to_string(pos))
end,
on_metadata_inventory_take = function(pos, listname, index, stack, player)
minetest.log("action", player:get_player_name()..
" removeu um item no cofre em "..minetest.pos_to_string(pos))
end,
on_rightclick = function(pos, node, clicker)
local meta = minetest.get_meta(pos)
if strongbox.isOpen(meta, clicker) then
minetest.show_formspec(
clicker:get_player_name(),
"strongbox:safe",
strongbox.getFormspec(pos)
)
end
end,
})
minetest.register_craft({
output = 'strongbox:safe',
recipe = {
{"default:steelblock" ,"default:steelblock" ,"default:steelblock"},
{"default:steelblock" ,"" ,"default:mese"},
{"default:steelblock" ,"default:steelblock" ,"default:steelblock"},
}
})
minetest.register_alias("strongbox" ,"strongbox:safe")
minetest.register_alias("safe" ,"strongbox:safe")
minetest.register_alias("safeall" ,"strongbox:safe")
minetest.register_alias("safe-all" ,"strongbox:safe")
minetest.register_alias("caixaforte" ,"strongbox:safe")
minetest.register_alias("cofreforte" ,"strongbox:safe")
minetest.register_alias("cofre" ,"strongbox:safe")

View file

@ -46,6 +46,17 @@ Offer=Oferecer
Cancel=Cancelar
Confirm=Confirmar
#------- item_strongbox.lua ---------------------------------------------------------------------------
STRONGBOX\n* Save your money in this safe and withdraw your money at any store that has an ATM.=COFRE\n* Guarde seu dinheiro neste cofre e retire seu dinheiro em qualquer loja que possua um Caixa Eletrônico.
STRONGBOX (Property of '%s')\n* Save your money in this safe and withdraw your money at any store that has an ATM.=COFRE (Propriedade de '%s')\n* Guarde seu dinheiro neste cofre e retire seu dinheiro em qualquer loja que possua um Caixa Eletrônico.
[MINERTRADE] The safe is going to work %02d seconds after it is installed!=[MINERTRADE] O cofre sá vai funcionar %02d segundos depois de instalado!
[MINERTRADE] You do not have access to the safe belonging to '%s'!=[MINERTRADE] Você não tem acesso ao cofre pertencente a '%s'!
#------- item_atm.lua ---------------------------------------------------------------------------
PUBLIC ATM\n* Save your money in the ATM, and withdraw your money in your Personal Safe or other ATM in the shops scattered around the map.=CAIXA ELETRÔNICO\n* Guarde o seu dinheiro neste Caixa Eletrônico, e retire seu dinheiro em seu Cofre Pessoal ou qualquer outro Caixa Eletrônico nas lojas espalhadas pelo mapa.
[MINERTRADE] You can not install this 'ATM' too far from a 'Dispensing Machine'!=[MINERTRADE] Você não pode instalar este 'Caixa Eletrônico' muito longe de uma 'Máquina Dispensadora'!
[MINERTRADE] The ATM will only run %02d seconds after it is installed!=[MINERTRADE] O Caixa Eletrônico só vai funcionar %02d segundos depois de instalado!
#------- on_final.lua ---------------------------------------------------------------------------
Saving strongbox from all players in the file '%s'!=Salvando cofre de todos os jogadores no arquivo '%s'!
@ -56,3 +67,5 @@ piggybank=cofreporquinho
creditcard=cartaodecredito
dispensingmachine=dispensadora
exchangetable=mesadetroca
strongbox=caixaforte
atm=caixaeletronico