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,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},