summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXanthin <Xanthin@users.noreply.github.com>2014-03-12 22:23:43 +0100
committerXanthin <Xanthin@users.noreply.github.com>2014-03-12 22:23:43 +0100
commit17f0826491fb27ef8db5a60ae5f99fa24d87f56a (patch)
tree0a89577b3b650f0933e6a6490da3de5456205935
parentabb5dd355071c678bcaf3dc104ab3ee45a5235ed (diff)
added intllib function for translation
-rw-r--r--crafts.lua22
1 files changed, 15 insertions, 7 deletions
diff --git a/crafts.lua b/crafts.lua
index 45fda47..746f2a1 100644
--- a/crafts.lua
+++ b/crafts.lua
@@ -1,3 +1,11 @@
+-- Boilerplate to support localized strings if intllib mod is installed.
+local S
+if (minetest.get_modpath("intllib")) then
+ dofile(minetest.get_modpath("intllib").."/intllib.lua")
+ S = intllib.Getter(minetest.get_current_modname())
+else
+ S = function ( s ) return s end
+end
for i in ipairs(moretrees.treelist) do
local treename = moretrees.treelist[i][1]
@@ -50,43 +58,43 @@ minetest.register_craft({
-- Food recipes!
minetest.register_craftitem("moretrees:coconut_milk", {
- description = "Coconut Milk",
+ description = S("Coconut Milk"),
inventory_image = "moretrees_coconut_milk_inv.png",
wield_image = "moretrees_coconut_milk.png",
on_use = minetest.item_eat(2),
})
minetest.register_craftitem("moretrees:raw_coconut", {
- description = "Raw Coconut",
+ description = S("Raw Coconut"),
inventory_image = "moretrees_raw_coconut.png",
on_use = minetest.item_eat(4),
})
minetest.register_craftitem("moretrees:acorn_muffin_batter", {
- description = "Acorn Muffin batter",
+ description = S("Acorn Muffin batter"),
inventory_image = "moretrees_acorn_muffin_batter.png",
})
minetest.register_craftitem("moretrees:acorn_muffin", {
- description = "Acorn Muffin",
+ description = S("Acorn Muffin"),
inventory_image = "moretrees_acorn_muffin.png",
on_use = minetest.item_eat(4),
})
minetest.register_craftitem("moretrees:spruce_nuts", {
- description = "Roasted Spruce Cone Nuts",
+ description = S("Roasted Spruce Cone Nuts"),
inventory_image = "moretrees_spruce_nuts.png",
on_use = minetest.item_eat(1),
})
minetest.register_craftitem("moretrees:pine_nuts", {
- description = "Roasted Pine Cone Nuts",
+ description = S("Roasted Pine Cone Nuts"),
inventory_image = "moretrees_pine_nuts.png",
on_use = minetest.item_eat(1),
})
minetest.register_craftitem("moretrees:fir_nuts", {
- description = "Roasted Fir Cone Nuts",
+ description = S("Roasted Fir Cone Nuts"),
inventory_image = "moretrees_fir_nuts.png",
on_use = minetest.item_eat(1),
})