Add support for i18n
This commit is contained in:
parent
85c2284da5
commit
aab75fe361
12
init.lua
12
init.lua
@ -10,20 +10,16 @@ for i, size in ipairs(sizes) do
|
|||||||
local description
|
local description
|
||||||
local drop
|
local drop
|
||||||
local tiles
|
local tiles
|
||||||
local not_in_creative_inventory
|
|
||||||
|
|
||||||
if slice == 0 then
|
if slice == 0 then
|
||||||
name = "cake:cake"
|
name = "cake:cake"
|
||||||
description = "Cake"
|
description = "Cake"
|
||||||
drop = nil
|
drop = nil
|
||||||
tiles = {"cake_top.png", "cake_bottom.png", "cake_side.png"}
|
tiles = {"cake_top.png", "cake_bottom.png", "cake_side.png"}
|
||||||
not_in_creative_inventory = 0
|
|
||||||
else
|
else
|
||||||
name = "cake:cake_"..slice
|
name = "cake:cake_"..slice
|
||||||
description = "Cake (Slice "..slice..")"
|
|
||||||
drop = ''
|
drop = ''
|
||||||
tiles = {"cake_top.png", "cake_bottom.png", "cake_side.png", "cake_inner.png", "cake_side.png", "cake_side.png"}
|
tiles = {"cake_top.png", "cake_bottom.png", "cake_side.png", "cake_inner.png", "cake_side.png", "cake_side.png"}
|
||||||
not_in_creative_inventory = 1
|
|
||||||
end
|
end
|
||||||
|
|
||||||
minetest.register_node(name, {
|
minetest.register_node(name, {
|
||||||
@ -33,7 +29,7 @@ for i, size in ipairs(sizes) do
|
|||||||
tiles = tiles,
|
tiles = tiles,
|
||||||
paramtype = "light",
|
paramtype = "light",
|
||||||
is_ground_content = false,
|
is_ground_content = false,
|
||||||
groups = {crumbly=3,not_in_creative_inventory=not_in_creative_inventory},
|
groups = {crumbly=3},
|
||||||
--sounds = sounds,
|
--sounds = sounds,
|
||||||
node_box = {
|
node_box = {
|
||||||
type = "fixed",
|
type = "fixed",
|
||||||
@ -124,3 +120,9 @@ if throwable_cake then
|
|||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if minetest.get_modpath("i18n") then
|
||||||
|
local separator = package.config:sub(1,1)
|
||||||
|
dofile(minetest.get_modpath("i18n")..separator.."init.lua")
|
||||||
|
i18n.localize_mod()
|
||||||
|
end
|
||||||
|
4
lang/en_US.lua
Normal file
4
lang/en_US.lua
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
local l10n = {}
|
||||||
|
l10n["cake:cake"] = "Cake"
|
||||||
|
l10n["cake:sugar"] = "Sugar"
|
||||||
|
return l10n
|
Loading…
x
Reference in New Issue
Block a user