Add intllib support

This commit is contained in:
Wuzzy 2016-11-10 15:13:26 +01:00
parent bcfd8e73e5
commit 3e15c497c3
4 changed files with 28 additions and 6 deletions

View File

@ -1,3 +1,4 @@
default
farming?
treasurer?
intllib?

7
locale/template.txt Normal file
View File

@ -0,0 +1,7 @@
Cracked sandstone brick =
Fallen cracked sandstone brick =
Mummy spawn-egg =
Mummy spawner =
Sandstone with eye engraving =
Sandstone with man engraving =
Sandstone with sun engraving =

View File

@ -1,4 +1,10 @@
--pyramids = {}
-- Boilerplate to support localized strings if intllib mod is installed.
local S
if minetest.get_modpath("intllib") then
S = intllib.Getter()
else
S = function(s) return s end
end
local mummy_walk_limit = 1
local mummy_chillaxin_speed = 1
@ -305,7 +311,7 @@ minetest.register_entity("tsm_pyramids:mummy_spawner", spawner_DEF)
--spawn-egg/spawner
minetest.register_craftitem("tsm_pyramids:spawn_egg", {
description = "Mummy spawn-egg",
description = S("Mummy spawn-egg"),
inventory_image = "tsm_pyramids_mummy_egg.png",
liquids_pointable = false,
stack_max = 99,
@ -333,7 +339,7 @@ else
end
minetest.register_node("tsm_pyramids:spawner_mummy", {
description = "Mummy spawner",
description = S("Mummy spawner"),
paramtype = "light",
tiles = {"tsm_pyramids_spawner.png"},
is_ground_content = false,

View File

@ -1,4 +1,12 @@
local desc = {"Sandstone with eye engraving", "Sandstone with man engraving", "Sandstone with sun engraving"}
-- Boilerplate to support localized strings if intllib mod is installed.
local S
if minetest.get_modpath("intllib") then
S = intllib.Getter()
else
S = function(s) return s end
end
local desc = {S("Sandstone with eye engraving"), S("Sandstone with man engraving"), S("Sandstone with sun engraving")}
local img = {"eye", "men", "sun"}
for i=1,3 do
@ -26,7 +34,7 @@ local trap_on_timer = function (pos, elapsed)
end
minetest.register_node("tsm_pyramids:trap", {
description = "Cracked sandstone brick",
description = S("Cracked sandstone brick"),
tiles = {"default_sandstone_brick.png^tsm_pyramids_crack.png"},
is_ground_content = false,
groups = {crumbly=3,cracky=3},
@ -40,7 +48,7 @@ minetest.register_node("tsm_pyramids:trap", {
})
minetest.register_node("tsm_pyramids:trap_2", {
description = "Fallen cracked sandstone brick",
description = S("Fallen cracked sandstone brick"),
tiles = {"default_sandstone_brick.png^tsm_pyramids_crack.png^[transformR90"},
is_ground_content = false,
groups = {crumbly=3,cracky=3,falling_node=1,not_in_creative_inventory=1},