mirror of
https://github.com/ElCeejo/animalia.git
synced 2025-04-30 13:31:39 -04:00
Internationalize craftitems
This commit is contained in:
parent
259e741282
commit
1efd1df6cc
2 changed files with 64 additions and 30 deletions
|
@ -8,6 +8,9 @@ local vec_add, vec_sub = vector.add, vector.subtract
|
||||||
|
|
||||||
local color = minetest.colorize
|
local color = minetest.colorize
|
||||||
|
|
||||||
|
-- Load support for MT game translation.
|
||||||
|
local S = minetest.get_translator("animalia")
|
||||||
|
|
||||||
local function correct_name(str)
|
local function correct_name(str)
|
||||||
if str then
|
if str then
|
||||||
if str:match(":") then str = str:split(":")[2] end
|
if str:match(":") then str = str:split(":")[2] end
|
||||||
|
@ -99,7 +102,7 @@ local function register_egg(name, def)
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_craftitem(name .. "_fried", {
|
minetest.register_craftitem(name .. "_fried", {
|
||||||
description = "Fried " .. def.description,
|
description = S("Fried @1", def.description),
|
||||||
inventory_image = def.inventory_image .. "_fried.png",
|
inventory_image = def.inventory_image .. "_fried.png",
|
||||||
on_use = minetest.item_eat(4),
|
on_use = minetest.item_eat(4),
|
||||||
groups = {food_egg = 1, flammable = 2},
|
groups = {food_egg = 1, flammable = 2},
|
||||||
|
@ -157,19 +160,19 @@ end
|
||||||
-----------
|
-----------
|
||||||
|
|
||||||
minetest.register_craftitem("animalia:leather", {
|
minetest.register_craftitem("animalia:leather", {
|
||||||
description = "Leather",
|
description = S("Leather"),
|
||||||
inventory_image = "animalia_leather.png",
|
inventory_image = "animalia_leather.png",
|
||||||
groups = {flammable = 2, leather = 1},
|
groups = {flammable = 2, leather = 1},
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_craftitem("animalia:feather", {
|
minetest.register_craftitem("animalia:feather", {
|
||||||
description = "Feather",
|
description = S("Feather"),
|
||||||
inventory_image = "animalia_feather.png",
|
inventory_image = "animalia_feather.png",
|
||||||
groups = {flammable = 2, feather = 1},
|
groups = {flammable = 2, feather = 1},
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_craftitem("animalia:pelt_bear", {
|
minetest.register_craftitem("animalia:pelt_bear", {
|
||||||
description = "Bear Pelt",
|
description = S("Bear Pelt"),
|
||||||
inventory_image = "animalia_pelt_bear.png",
|
inventory_image = "animalia_pelt_bear.png",
|
||||||
groups = {flammable = 2, pelt = 1},
|
groups = {flammable = 2, pelt = 1},
|
||||||
})
|
})
|
||||||
|
@ -177,14 +180,14 @@ minetest.register_craftitem("animalia:pelt_bear", {
|
||||||
-- Meat --
|
-- Meat --
|
||||||
|
|
||||||
minetest.register_craftitem("animalia:beef_raw", {
|
minetest.register_craftitem("animalia:beef_raw", {
|
||||||
description = "Raw Beef",
|
description = S("Raw Beef"),
|
||||||
inventory_image = "animalia_beef_raw.png",
|
inventory_image = "animalia_beef_raw.png",
|
||||||
on_use = minetest.item_eat(1),
|
on_use = minetest.item_eat(1),
|
||||||
groups = {flammable = 2, meat = 1, food_meat = 1},
|
groups = {flammable = 2, meat = 1, food_meat = 1},
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_craftitem("animalia:beef_cooked", {
|
minetest.register_craftitem("animalia:beef_cooked", {
|
||||||
description = "Steak",
|
description = S("Steak"),
|
||||||
inventory_image = "animalia_beef_cooked.png",
|
inventory_image = "animalia_beef_cooked.png",
|
||||||
on_use = minetest.item_eat(8),
|
on_use = minetest.item_eat(8),
|
||||||
groups = {flammable = 2, meat = 1, food_meat = 1},
|
groups = {flammable = 2, meat = 1, food_meat = 1},
|
||||||
|
@ -197,14 +200,14 @@ minetest.register_craft({
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_craftitem("animalia:mutton_raw", {
|
minetest.register_craftitem("animalia:mutton_raw", {
|
||||||
description = "Raw Mutton",
|
description = S("Raw Mutton"),
|
||||||
inventory_image = "animalia_mutton_raw.png",
|
inventory_image = "animalia_mutton_raw.png",
|
||||||
on_use = minetest.item_eat(1),
|
on_use = minetest.item_eat(1),
|
||||||
groups = {flammable = 2, meat = 1, food_meat = 1},
|
groups = {flammable = 2, meat = 1, food_meat = 1},
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_craftitem("animalia:mutton_cooked", {
|
minetest.register_craftitem("animalia:mutton_cooked", {
|
||||||
description = "Cooked Mutton",
|
description = S("Cooked Mutton"),
|
||||||
inventory_image = "animalia_mutton_cooked.png",
|
inventory_image = "animalia_mutton_cooked.png",
|
||||||
on_use = minetest.item_eat(6),
|
on_use = minetest.item_eat(6),
|
||||||
groups = {flammable = 2, meat = 1, food_meat = 1},
|
groups = {flammable = 2, meat = 1, food_meat = 1},
|
||||||
|
@ -217,14 +220,14 @@ minetest.register_craft({
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_craftitem("animalia:rat_raw", {
|
minetest.register_craftitem("animalia:rat_raw", {
|
||||||
description = "Raw Rat",
|
description = S("Raw Rat"),
|
||||||
inventory_image = "animalia_rat_raw.png",
|
inventory_image = "animalia_rat_raw.png",
|
||||||
on_use = minetest.item_eat(1),
|
on_use = minetest.item_eat(1),
|
||||||
groups = {flammable = 2, meat = 1, food_meat = 1},
|
groups = {flammable = 2, meat = 1, food_meat = 1},
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_craftitem("animalia:rat_cooked", {
|
minetest.register_craftitem("animalia:rat_cooked", {
|
||||||
description = "Cooked Rat",
|
description = S("Cooked Rat"),
|
||||||
inventory_image = "animalia_rat_cooked.png",
|
inventory_image = "animalia_rat_cooked.png",
|
||||||
on_use = minetest.item_eat(2),
|
on_use = minetest.item_eat(2),
|
||||||
groups = {flammable = 2, meat = 1, food_meat = 1},
|
groups = {flammable = 2, meat = 1, food_meat = 1},
|
||||||
|
@ -237,14 +240,14 @@ minetest.register_craft({
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_craftitem("animalia:porkchop_raw", {
|
minetest.register_craftitem("animalia:porkchop_raw", {
|
||||||
description = "Raw Porkchop",
|
description = S("Raw Porkchop"),
|
||||||
inventory_image = "animalia_porkchop_raw.png",
|
inventory_image = "animalia_porkchop_raw.png",
|
||||||
on_use = minetest.item_eat(1),
|
on_use = minetest.item_eat(1),
|
||||||
groups = {flammable = 2, meat = 1, food_meat = 1},
|
groups = {flammable = 2, meat = 1, food_meat = 1},
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_craftitem("animalia:porkchop_cooked", {
|
minetest.register_craftitem("animalia:porkchop_cooked", {
|
||||||
description = "Cooked Porkchop",
|
description = S("Cooked Porkchop"),
|
||||||
inventory_image = "animalia_porkchop_cooked.png",
|
inventory_image = "animalia_porkchop_cooked.png",
|
||||||
on_use = minetest.item_eat(7),
|
on_use = minetest.item_eat(7),
|
||||||
groups = {flammable = 2, meat = 1, food_meat = 1},
|
groups = {flammable = 2, meat = 1, food_meat = 1},
|
||||||
|
@ -257,14 +260,14 @@ minetest.register_craft({
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_craftitem("animalia:poultry_raw", {
|
minetest.register_craftitem("animalia:poultry_raw", {
|
||||||
description = "Raw Poultry",
|
description = S("Raw Poultry"),
|
||||||
inventory_image = "animalia_poultry_raw.png",
|
inventory_image = "animalia_poultry_raw.png",
|
||||||
on_use = minetest.item_eat(1),
|
on_use = minetest.item_eat(1),
|
||||||
groups = {flammable = 2, meat = 1, food_meat = 1},
|
groups = {flammable = 2, meat = 1, food_meat = 1},
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_craftitem("animalia:poultry_cooked", {
|
minetest.register_craftitem("animalia:poultry_cooked", {
|
||||||
description = "Cooked Poultry",
|
description = S("Cooked Poultry"),
|
||||||
inventory_image = "animalia_poultry_cooked.png",
|
inventory_image = "animalia_poultry_cooked.png",
|
||||||
on_use = minetest.item_eat(6),
|
on_use = minetest.item_eat(6),
|
||||||
groups = {flammable = 2, meat = 1, food_meat = 1},
|
groups = {flammable = 2, meat = 1, food_meat = 1},
|
||||||
|
@ -277,14 +280,14 @@ minetest.register_craft({
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_craftitem("animalia:venison_raw", {
|
minetest.register_craftitem("animalia:venison_raw", {
|
||||||
description = "Raw Venison",
|
description = S("Raw Venison"),
|
||||||
inventory_image = "animalia_venison_raw.png",
|
inventory_image = "animalia_venison_raw.png",
|
||||||
on_use = minetest.item_eat(1),
|
on_use = minetest.item_eat(1),
|
||||||
groups = {flammable = 2, meat = 1, food_meat = 1},
|
groups = {flammable = 2, meat = 1, food_meat = 1},
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_craftitem("animalia:venison_cooked", {
|
minetest.register_craftitem("animalia:venison_cooked", {
|
||||||
description = "Venison Steak",
|
description = S("Venison Steak"),
|
||||||
inventory_image = "animalia_venison_cooked.png",
|
inventory_image = "animalia_venison_cooked.png",
|
||||||
on_use = minetest.item_eat(10),
|
on_use = minetest.item_eat(10),
|
||||||
groups = {flammable = 2, meat = 1, food_meat = 1},
|
groups = {flammable = 2, meat = 1, food_meat = 1},
|
||||||
|
@ -297,19 +300,19 @@ minetest.register_craft({
|
||||||
})
|
})
|
||||||
|
|
||||||
register_egg("animalia:chicken_egg", {
|
register_egg("animalia:chicken_egg", {
|
||||||
description = "Chicken Egg",
|
description = S("Chicken Egg"),
|
||||||
inventory_image = "animalia_egg",
|
inventory_image = "animalia_egg",
|
||||||
mob = "animalia:chicken"
|
mob = "animalia:chicken"
|
||||||
})
|
})
|
||||||
|
|
||||||
register_egg("animalia:turkey_egg", {
|
register_egg("animalia:turkey_egg", {
|
||||||
description = "Turkey Egg",
|
description = S("Turkey Egg"),
|
||||||
inventory_image = "animalia_egg",
|
inventory_image = "animalia_egg",
|
||||||
mob = "animalia:turkey"
|
mob = "animalia:turkey"
|
||||||
})
|
})
|
||||||
|
|
||||||
register_egg("animalia:song_bird_egg", {
|
register_egg("animalia:song_bird_egg", {
|
||||||
description = "Song Bird Egg",
|
description = S("Song Bird Egg"),
|
||||||
inventory_image = "animalia_song_bird_egg",
|
inventory_image = "animalia_song_bird_egg",
|
||||||
mob = "animalia:bird"
|
mob = "animalia:bird"
|
||||||
})
|
})
|
||||||
|
@ -319,7 +322,7 @@ register_egg("animalia:song_bird_egg", {
|
||||||
----------
|
----------
|
||||||
|
|
||||||
minetest.register_craftitem("animalia:bucket_milk", {
|
minetest.register_craftitem("animalia:bucket_milk", {
|
||||||
description = "Bucket of Milk",
|
description = S("Bucket of Milk"),
|
||||||
inventory_image = "animalia_milk_bucket.png",
|
inventory_image = "animalia_milk_bucket.png",
|
||||||
stack_max = 1,
|
stack_max = 1,
|
||||||
on_use = minetest.item_eat(8, "bucket:bucket_empty"),
|
on_use = minetest.item_eat(8, "bucket:bucket_empty"),
|
||||||
|
@ -327,7 +330,7 @@ minetest.register_craftitem("animalia:bucket_milk", {
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_craftitem("animalia:bucket_guano", {
|
minetest.register_craftitem("animalia:bucket_guano", {
|
||||||
description = "Bucket of Guano",
|
description = S("Bucket of Guano"),
|
||||||
inventory_image = "animalia_guano_bucket.png",
|
inventory_image = "animalia_guano_bucket.png",
|
||||||
stack_max = 1,
|
stack_max = 1,
|
||||||
groups = {flammable = 3},
|
groups = {flammable = 3},
|
||||||
|
@ -368,7 +371,7 @@ minetest.register_craftitem("animalia:bucket_guano", {
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_node("animalia:nest_song_bird", {
|
minetest.register_node("animalia:nest_song_bird", {
|
||||||
description = "Song Bird Nest",
|
description = S("Song Bird Nest"),
|
||||||
paramtype = "light",
|
paramtype = "light",
|
||||||
drawtype = "mesh",
|
drawtype = "mesh",
|
||||||
mesh = "animalia_nest.obj",
|
mesh = "animalia_nest.obj",
|
||||||
|
@ -407,7 +410,7 @@ minetest.register_node("animalia:nest_song_bird", {
|
||||||
-----------
|
-----------
|
||||||
|
|
||||||
minetest.register_craftitem("animalia:cat_toy", {
|
minetest.register_craftitem("animalia:cat_toy", {
|
||||||
description = "Cat Toy",
|
description = S("Cat Toy"),
|
||||||
inventory_image = "animalia_cat_toy.png",
|
inventory_image = "animalia_cat_toy.png",
|
||||||
wield_image = "animalia_cat_toy.png^[transformFYR90",
|
wield_image = "animalia_cat_toy.png^[transformFYR90",
|
||||||
stack_max = 1
|
stack_max = 1
|
||||||
|
@ -457,25 +460,25 @@ local function nametag_rightclick(itemstack, player, pointed_thing)
|
||||||
end
|
end
|
||||||
|
|
||||||
minetest.register_craftitem("animalia:nametag", {
|
minetest.register_craftitem("animalia:nametag", {
|
||||||
description = "Nametag",
|
description = S("Nametag"),
|
||||||
inventory_image = "animalia_nametag.png",
|
inventory_image = "animalia_nametag.png",
|
||||||
on_rightclick = nametag_rightclick,
|
on_rightclick = nametag_rightclick,
|
||||||
on_secondary_use = nametag_rightclick
|
on_secondary_use = nametag_rightclick
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_craftitem("animalia:saddle", {
|
minetest.register_craftitem("animalia:saddle", {
|
||||||
description = "Saddle",
|
description = S("Saddle"),
|
||||||
inventory_image = "animalia_saddle.png",
|
inventory_image = "animalia_saddle.png",
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_tool("animalia:shears", {
|
minetest.register_tool("animalia:shears", {
|
||||||
description = "Shears",
|
description = S("Shears"),
|
||||||
inventory_image = "animalia_shears.png",
|
inventory_image = "animalia_shears.png",
|
||||||
groups = {flammable = 2}
|
groups = {flammable = 2}
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_craftitem("animalia:net", {
|
minetest.register_craftitem("animalia:net", {
|
||||||
description = "Animal Net",
|
description = S("Animal Net"),
|
||||||
inventory_image = "animalia_net.png",
|
inventory_image = "animalia_net.png",
|
||||||
stack_max = 1,
|
stack_max = 1,
|
||||||
on_secondary_use = mob_storage_use,
|
on_secondary_use = mob_storage_use,
|
||||||
|
@ -540,7 +543,7 @@ if minetest.get_modpath("3d_armor") then
|
||||||
end
|
end
|
||||||
|
|
||||||
armor:register_armor("animalia:coat_bear_pelt", {
|
armor:register_armor("animalia:coat_bear_pelt", {
|
||||||
description = "Bear Pelt Coat",
|
description = S("Bear Pelt Coat"),
|
||||||
inventory_image = "animalia_inv_coat_bear_pelt.png",
|
inventory_image = "animalia_inv_coat_bear_pelt.png",
|
||||||
groups = {armor_torso = 1, armor_heal = 0, armor_heavy_pelt = 1, armor_use = 1000},
|
groups = {armor_torso = 1, armor_heal = 0, armor_heavy_pelt = 1, armor_use = 1000},
|
||||||
armor_groups = {fleshy = 5}
|
armor_groups = {fleshy = 5}
|
||||||
|
@ -563,7 +566,7 @@ end
|
||||||
-----------
|
-----------
|
||||||
|
|
||||||
minetest.register_node("animalia:guano", {
|
minetest.register_node("animalia:guano", {
|
||||||
description = "Guano",
|
description = S("Guano"),
|
||||||
tiles = {"animalia_guano.png"},
|
tiles = {"animalia_guano.png"},
|
||||||
paramtype = "light",
|
paramtype = "light",
|
||||||
buildable_to = true,
|
buildable_to = true,
|
||||||
|
@ -594,7 +597,7 @@ minetest.register_node("animalia:guano", {
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_node("animalia:crate", {
|
minetest.register_node("animalia:crate", {
|
||||||
description = "Animal Crate",
|
description = S("Animal Crate"),
|
||||||
tiles = {"animalia_crate.png", "animalia_crate.png", "animalia_crate_side.png"},
|
tiles = {"animalia_crate.png", "animalia_crate.png", "animalia_crate_side.png"},
|
||||||
groups = {choppy = 2},
|
groups = {choppy = 2},
|
||||||
stack_max = 1,
|
stack_max = 1,
|
||||||
|
|
31
locale/template.txt
Normal file
31
locale/template.txt
Normal file
|
@ -0,0 +1,31 @@
|
||||||
|
# textdomain: animalia
|
||||||
|
Animal Crate=
|
||||||
|
Animal Net=
|
||||||
|
Bear Pelt=
|
||||||
|
Bear Pelt Coat=
|
||||||
|
Bucket of Guano=
|
||||||
|
Bucket of Milk=
|
||||||
|
Cat Toy=
|
||||||
|
Chicken Egg=
|
||||||
|
Cooked Mutton=
|
||||||
|
Cooked Porkchop=
|
||||||
|
Cooked Poultry=
|
||||||
|
Cooked Rat=
|
||||||
|
Feather=
|
||||||
|
Fried @1=
|
||||||
|
Guano=
|
||||||
|
Leather=
|
||||||
|
Nametag=
|
||||||
|
Raw Beef=
|
||||||
|
Raw Mutton=
|
||||||
|
Raw Porkchop=
|
||||||
|
Raw Poultry=
|
||||||
|
Raw Rat=
|
||||||
|
Raw Venison=
|
||||||
|
Saddle=
|
||||||
|
Shears=
|
||||||
|
Song Bird Egg=
|
||||||
|
Song Bird Nest=
|
||||||
|
Steak=
|
||||||
|
Turkey Egg=
|
||||||
|
Venison Steak=
|
Loading…
Add table
Reference in a new issue