Atualização do mod compost

master
BrunoMine 2017-03-01 19:40:05 -03:00
parent bc9f87bbbf
commit 86c9334e32
13 changed files with 48 additions and 10 deletions

View File

@ -37,6 +37,12 @@ If there is nothing in the bin, it looks empty when viewed from top (node
"compost:wood_barrel_empty"). If there's anything in it (inputs or soil), it "compost:wood_barrel_empty"). If there's anything in it (inputs or soil), it
looks full of dirt (node "compost:wood_barrel"). looks full of dirt (node "compost:wood_barrel").
Internationalization
--------------------
The mod is compatible with intllib. Currently available translations:
* Romanian
* Russian
License License
------- -------
see LICENSE.txt see LICENSE.txt

View File

@ -1,2 +1,3 @@
default default
stairs stairs
intllib?

View File

@ -9,9 +9,24 @@
-- Checks if the original mod is active -- Checks if the original mod is active
if minetest.get_modpath("compost") then return end if minetest.get_modpath("compost") then return end
minetest.log('action', 'MOD: Compost loading...') minetest.log('action', 'MOD: Compost loading...')
compost_version = '0.0.1' compost_version = '0.0.1'
local i18n --internationalization
if minetest.get_modpath("intllib") then
minetest.log('action', 'intllib loaded')
i18n = intllib.Getter()
else
i18n = function(s,a,...)
a={a,...}
local v = s:gsub("@(%d+)", function(n)
return a[tonumber(n)]
end)
return v
end
end
compost = {} compost = {}
compost.compostable_groups = {'flora', 'leaves', 'flower'} compost.compostable_groups = {'flora', 'leaves', 'flower'}
compost.compostable_nodes = { compost.compostable_nodes = {
@ -111,12 +126,12 @@ local function update_timer(pos)
if not timer:is_started() and count >= 8 then if not timer:is_started() and count >= 8 then
timer:start(30) timer:start(30)
meta:set_int('progress', 0) meta:set_int('progress', 0)
meta:set_string('infotext', 'progress: 0%') meta:set_string('infotext', i18n('progress: @1%', '0'))
return return
end end
if timer:is_started() and count < 8 then if timer:is_started() and count < 8 then
timer:stop() timer:stop()
meta:set_string('infotext', 'Empty composting bin.\nTo get compost, add some organic matter.') meta:set_string('infotext', i18n('To start composting, place some organic matter inside.'))
meta:set_int('progress', 0) meta:set_int('progress', 0)
end end
end end
@ -155,11 +170,11 @@ local function on_timer(pos)
meta:set_int('progress', progress) meta:set_int('progress', progress)
end end
if count_input(pos) >= 8 then if count_input(pos) >= 8 then
meta:set_string('infotext', 'progress: ' .. progress .. '%') meta:set_string('infotext', i18n('progress: @1%', progress))
return true return true
else else
timer:stop() timer:stop()
meta:set_string('infotext', 'Empty composting bin.\nTo get compost, add some organic matter.') meta:set_string('infotext', i18n('To start composting, place some organic matter inside.'))
meta:set_int('progress', 0) meta:set_int('progress', 0)
return false return false
end end
@ -170,7 +185,7 @@ local function on_construct(pos)
local inv = meta:get_inventory() local inv = meta:get_inventory()
inv:set_size('src', 8) inv:set_size('src', 8)
inv:set_size('dst', 1) inv:set_size('dst', 1)
meta:set_string('infotext','Empty composting bin.\nTo get compost, add some organic matter.') meta:set_string('infotext', i18n('To start composting, place some organic matter inside.'))
meta:set_int('progress', 0) meta:set_int('progress', 0)
end end
@ -250,7 +265,7 @@ local function on_punch(pos, node, player, pointed_thing)
end end
minetest.register_node(":compost:wood_barrel_empty", { minetest.register_node(":compost:wood_barrel_empty", {
description = "Empty Compost Bin", description = i18n('Empty Compost Bin'),
tiles = { tiles = {
"default_wood.png", "default_wood.png",
}, },
@ -283,7 +298,7 @@ minetest.register_node(":compost:wood_barrel_empty", {
}) })
minetest.register_node(":compost:wood_barrel", { minetest.register_node(":compost:wood_barrel", {
description = "Compost Bin", description = i18n('Compost Bin'),
tiles = { tiles = {
"default_wood.png^compost_compost.png", "default_wood.png^compost_compost.png",
"default_wood.png", "default_wood.png",

View File

@ -0,0 +1,6 @@
# Translations by BrunoMine, 2017 <borgesdossantosbruno@gmail.com>
Compost Bin = Silo de Compostagem
Empty Compost Bin = Silo de Compostagem Vazio
To start composting, place some organic matter inside. = Para iniciar a compostagem, coloque alguma materia organica dentro.
progress: @1% = progresso: @1%

View File

@ -0,0 +1,4 @@
Compost Bin = Cutie de compost
Empty Compost Bin = Cutie de compost goală
To start composting, place some organic matter inside. = Pentru a începe compostarea, adaugă materie organică
progress: @1% = progres: @1%

View File

@ -0,0 +1,4 @@
Compost Bin = Компостный ящик
Empty Compost Bin = Пустой компостный ящик
To start composting, place some organic matter inside. = Чтобы начать компостирование, добавьте органику внутрь
progress: @1% = прогресс: @1%

View File

@ -0,0 +1,4 @@
Compost Bin =
Empty Compost Bin =
To start composting, place some organic matter inside. =
progress: @1% =

View File

Before

Width:  |  Height:  |  Size: 327 KiB

After

Width:  |  Height:  |  Size: 327 KiB

View File

Before

Width:  |  Height:  |  Size: 461 B

After

Width:  |  Height:  |  Size: 461 B

View File

@ -13,4 +13,4 @@ xpanes
stairs stairs
doors doors
farming farming
sunos_compost sociedades_compost

View File

@ -1,2 +0,0 @@
# Backup files
*~