Added support for localization
parent
441019f3c3
commit
0aee054523
|
@ -0,0 +1,9 @@
|
|||
# textdomain:hardtorch
|
||||
|
||||
Oil=Olio
|
||||
Without fuel=Senza combustibile
|
||||
Without heat source or lighter=Senza fonte di calore o acciarino
|
||||
Torch (used)=Torcia (usata)
|
||||
Oil Lamp=Lampada a olio
|
||||
Oil Lamp Lit=Lampada a olio accesa
|
||||
Candle (used)=Candela (usata)
|
|
@ -0,0 +1,9 @@
|
|||
# textdomain:hardtorch
|
||||
|
||||
Oil=
|
||||
Without fuel=
|
||||
Without heat source or lighter=
|
||||
Torch (used)=
|
||||
Oil Lamp=
|
||||
Oil Lamp Lit=
|
||||
Candle (used)=
|
6
oil.lua
6
oil.lua
|
@ -10,6 +10,10 @@
|
|||
]]
|
||||
|
||||
|
||||
-- Used for localization
|
||||
|
||||
local S = minetest.get_translator("hardtorch")
|
||||
|
||||
-- Noites de durabilidade da tocha da lamparina
|
||||
local oil_nights = math.abs(tonumber(minetest.settings:get("hardtorch_oil_nights") or 1.2))
|
||||
if oil_nights <= 0 then oil_nights = 1.2 end
|
||||
|
@ -17,7 +21,7 @@ if oil_nights <= 0 then oil_nights = 1.2 end
|
|||
|
||||
-- Oleo de lamparina
|
||||
minetest.register_tool("hardtorch:oil", {
|
||||
description = "Oil",
|
||||
description = S("Oil"),
|
||||
inventory_image = "hardtorch_oil.png",
|
||||
|
||||
})
|
||||
|
|
8
tool.lua
8
tool.lua
|
@ -11,6 +11,10 @@
|
|||
]]
|
||||
|
||||
|
||||
-- Used for localization
|
||||
|
||||
local S = minetest.get_translator("hardtorch")
|
||||
|
||||
-- Acender tocha
|
||||
hardtorch.acender_tocha = function(itemstack, player)
|
||||
local name = player:get_player_name()
|
||||
|
@ -108,7 +112,7 @@ hardtorch.loop_tocha = function(name, torchname)
|
|||
else
|
||||
-- Aviso de "sem combustivel"
|
||||
if torchname ~= def.fuel[1] then
|
||||
minetest.chat_send_player(player:get_player_name(), "Sem combustivel")
|
||||
minetest.chat_send_player(player:get_player_name(), S("Without fuel"))
|
||||
end
|
||||
-- Encerra loop
|
||||
hardtorch.apagar_tocha(player, torchname)
|
||||
|
@ -167,7 +171,7 @@ hardtorch.register_tool = function(torchname, def)
|
|||
return hardtorch.acender_tocha(itemstack, user)
|
||||
end
|
||||
end
|
||||
minetest.chat_send_player(user:get_player_name(), "Sem fonte de calor ou acendedor")
|
||||
minetest.chat_send_player(user:get_player_name(), S("Without heat source or lighter"))
|
||||
return itemstack
|
||||
end
|
||||
return hardtorch.acender_tocha(itemstack, user)
|
||||
|
|
|
@ -10,6 +10,10 @@
|
|||
]]
|
||||
|
||||
|
||||
-- Used for localization
|
||||
|
||||
local S = minetest.get_translator("hardtorch")
|
||||
|
||||
-- Luminosidade da lamparina
|
||||
local lamp_light_source = hardtorch.check_light_number(minetest.settings:get("hardtorch_lamp_light_source") or 13)
|
||||
|
||||
|
@ -62,7 +66,7 @@ local node_nodebox = {
|
|||
|
||||
-- Register node de lamparina
|
||||
local def_lamp = minetest.serialize({
|
||||
description = "Oil Lamp",
|
||||
description = S("Oil Lamp"),
|
||||
stack_max = 1,
|
||||
tiles = {
|
||||
"hardtorch_lamp_wield_cima.png",
|
||||
|
@ -112,7 +116,7 @@ minetest.override_item("hardtorch:lamp", {
|
|||
-- Node-ferramenta ativo
|
||||
minetest.register_node("hardtorch:lamp_on", minetest.deserialize(def_lamp))
|
||||
minetest.override_item("hardtorch:lamp_on", {
|
||||
description = "Oil Lamp Lit",
|
||||
description = S("Oil Lamp Lit"),
|
||||
paramtype = "light",
|
||||
paramtype = nil,
|
||||
groups = {choppy=2, dig_immediate=3, flammable=1, attached_node=1, torch=1, not_in_creative_inventory = 1},
|
||||
|
|
|
@ -9,6 +9,11 @@
|
|||
Registro de Tochas padrao
|
||||
]]
|
||||
|
||||
|
||||
-- Used for localization
|
||||
|
||||
local S = minetest.get_translator("hardtorch")
|
||||
|
||||
-- Luminosidade da lamparina
|
||||
local torch_light_source = hardtorch.check_light_number(minetest.settings:get("hardtorch_torch_light_source") or 11)
|
||||
|
||||
|
@ -35,7 +40,7 @@ hardtorch.register_fuel("hardtorch:torch_on", {
|
|||
|
||||
-- Registrar ferramentas
|
||||
minetest.register_tool("hardtorch:torch", {
|
||||
description = "Torch (used)",
|
||||
description = S("Torch (used)"),
|
||||
inventory_image = "hardtorch_torch_tool_off.png",
|
||||
wield_image = "hardtorch_torch_tool_off.png",
|
||||
groups = {not_in_creative_inventory = 1},
|
||||
|
|
|
@ -11,6 +11,10 @@
|
|||
|
||||
if minetest.registered_nodes["xdecor:candle"] == nil then return end
|
||||
|
||||
-- Used for localization
|
||||
|
||||
local S = minetest.get_translator("hardtorch")
|
||||
|
||||
-- Luminosidade da lamparina
|
||||
local candle_light_source = hardtorch.check_light_number(minetest.settings:get("hardtorch_xdecor_candle_light_source") or 7)
|
||||
|
||||
|
@ -37,7 +41,7 @@ hardtorch.register_fuel("hardtorch:xdecor_candle_on", {
|
|||
|
||||
-- Registrar ferramentas
|
||||
minetest.register_tool("hardtorch:xdecor_candle", {
|
||||
description = "Candle (used)",
|
||||
description = S("Candle (used)"),
|
||||
inventory_image = "xdecor_candle_wield.png",
|
||||
wield_image = "xdecor_candle_wield.png",
|
||||
groups = {not_in_creative_inventory = 1},
|
||||
|
|
Loading…
Reference in New Issue