Compare commits

..

2 Commits

Author SHA1 Message Date
3af50a72dd Merge branch 'crabman77-translation' 2022-08-20 20:47:48 +02:00
60e00825cc add translate client-side.
fix global var(code from original mod)
2022-07-24 16:54:18 +02:00
6 changed files with 127 additions and 31 deletions

View File

@ -1,49 +1,51 @@
local S = mtfoods.get_translator
local ing = mtfoods.ingredients
-- Desserts -- -- Desserts --
minetest.register_craftitem("mtfoods:dandelion_milk", { minetest.register_craftitem("mtfoods:dandelion_milk", {
description = "Dandelion Milk", description = S("Dandelion Milk"),
inventory_image = "mtfoods_milk.png", inventory_image = "mtfoods_milk.png",
on_use = minetest.item_eat(1), on_use = minetest.item_eat(1),
}) })
minetest.register_craftitem("mtfoods:sugar", { minetest.register_craftitem("mtfoods:sugar", {
description = "Sugar", description = S("Sugar"),
inventory_image = "mtfoods_sugar.png", inventory_image = "mtfoods_sugar.png",
on_use = minetest.item_eat(1), on_use = minetest.item_eat(1),
}) })
minetest.register_craftitem("mtfoods:short_bread", { minetest.register_craftitem("mtfoods:short_bread", {
description = "Short Bread", description = S("Short Bread"),
inventory_image = "mtfoods_short_bread.png", inventory_image = "mtfoods_short_bread.png",
on_use = minetest.item_eat(3.5), on_use = minetest.item_eat(3.5),
}) })
minetest.register_craftitem("mtfoods:pie_crust", { minetest.register_craftitem("mtfoods:pie_crust", {
description = "Pie Crust", description = S("Pie Crust"),
inventory_image = "mtfoods_pie_crust.png", inventory_image = "mtfoods_pie_crust.png",
on_use = minetest.item_eat(3.5), on_use = minetest.item_eat(3.5),
}) })
minetest.register_craftitem("mtfoods:cream", { minetest.register_craftitem("mtfoods:cream", {
description = "Cream", description = S("Cream"),
inventory_image = "mtfoods_cream.png", inventory_image = "mtfoods_cream.png",
on_use = minetest.item_eat(1.5), on_use = minetest.item_eat(1.5),
}) })
minetest.register_craftitem("mtfoods:chocolate", { minetest.register_craftitem("mtfoods:chocolate", {
description = "Chocolate Bits", description = S("Chocolate Bits"),
inventory_image = "mtfoods_chocolate_bit.png", inventory_image = "mtfoods_chocolate_bit.png",
on_use = minetest.item_eat(2.5), on_use = minetest.item_eat(2.5),
}) })
minetest.register_craftitem("mtfoods:cupcake", { minetest.register_craftitem("mtfoods:cupcake", {
description = "Cup-Cake", description = S("Cup-Cake"),
inventory_image = "mtfoods_cupcake.png", inventory_image = "mtfoods_cupcake.png",
on_use = minetest.item_eat(3.5), on_use = minetest.item_eat(3.5),
}) })
minetest.register_craftitem("mtfoods:strawberry_shortcake", { minetest.register_craftitem("mtfoods:strawberry_shortcake", {
description = "Strawberry Short-Cake", description = S("Strawberry Short-Cake"),
inventory_image = "mtfoods_berry_shortcake.png", inventory_image = "mtfoods_berry_shortcake.png",
on_use = minetest.item_eat(3.5), on_use = minetest.item_eat(3.5),
}) })
@ -243,7 +245,7 @@ minetest.register_craft({
minetest.register_node("mtfoods:cake",{ minetest.register_node("mtfoods:cake",{
drawtype="nodebox", drawtype="nodebox",
paramtype = "light", paramtype = "light",
description = "Cake", description = S("Cake"),
on_use = minetest.item_eat(3), on_use = minetest.item_eat(3),
groups = {cracky=1,choppy=1,crumbly=1,oddly_breakable_by_hand=1}, groups = {cracky=1,choppy=1,crumbly=1,oddly_breakable_by_hand=1},
tiles = {"mtfoods_cake_top.png","mtfoods_cake_bottom.png","mtfoods_cake_side.png","mtfoods_cake_side.png","mtfoods_cake_side.png","mtfoods_cake_side.png"}, tiles = {"mtfoods_cake_top.png","mtfoods_cake_bottom.png","mtfoods_cake_side.png","mtfoods_cake_side.png","mtfoods_cake_side.png","mtfoods_cake_side.png"},
@ -258,7 +260,7 @@ minetest.register_node("mtfoods:cake",{
minetest.register_node("mtfoods:chocolate_cake",{ minetest.register_node("mtfoods:chocolate_cake",{
drawtype="nodebox", drawtype="nodebox",
description = "Chocolate Cake", description = S("Chocolate Cake"),
paramtype = "light", paramtype = "light",
on_use = minetest.item_eat(5), on_use = minetest.item_eat(5),
groups = {cracky=1,choppy=1,crumbly=1,oddly_breakable_by_hand=1}, groups = {cracky=1,choppy=1,crumbly=1,oddly_breakable_by_hand=1},
@ -274,7 +276,7 @@ minetest.register_node("mtfoods:chocolate_cake",{
minetest.register_node("mtfoods:carrot_cake",{ minetest.register_node("mtfoods:carrot_cake",{
drawtype = "nodebox", drawtype = "nodebox",
description = "Carrot Cake", description = S("Carrot Cake"),
on_use = minetest.item_eat(4), on_use = minetest.item_eat(4),
groups = {cracky=1,choppy=1,crumbly=1,oddly_breakable_by_hand=1}, groups = {cracky=1,choppy=1,crumbly=1,oddly_breakable_by_hand=1},
tiles = {"mtfoods_cake_atop.png","mtfoods_cake_bottom.png","mtfoods_cake_aside.png","mtfoods_cake_aside.png","mtfoods_cake_aside.png","mtfoods_cake_aside.png"}, tiles = {"mtfoods_cake_atop.png","mtfoods_cake_bottom.png","mtfoods_cake_aside.png","mtfoods_cake_aside.png","mtfoods_cake_aside.png","mtfoods_cake_aside.png"},
@ -291,7 +293,7 @@ minetest.register_node("mtfoods:carrot_cake",{
minetest.register_node("mtfoods:apple_pie",{ minetest.register_node("mtfoods:apple_pie",{
drawtype = "nodebox", drawtype = "nodebox",
paramtype = "light", paramtype = "light",
description = "Apple Pie", description = S("Apple Pie"),
on_use = minetest.item_eat(5), on_use = minetest.item_eat(5),
groups = {cracky=1,choppy=1,crumbly=1,oddly_breakable_by_hand=1}, groups = {cracky=1,choppy=1,crumbly=1,oddly_breakable_by_hand=1},
tiles = {"mtfoods_apie_top.png","mtfoods_pie_bottom.png","mtfoods_pie_side.png","mtfoods_pie_side.png","mtfoods_pie_side.png","mtfoods_pie_side.png"}, tiles = {"mtfoods_apie_top.png","mtfoods_pie_bottom.png","mtfoods_pie_side.png","mtfoods_pie_side.png","mtfoods_pie_side.png","mtfoods_pie_side.png"},
@ -308,7 +310,7 @@ minetest.register_node("mtfoods:apple_pie",{
minetest.register_node("mtfoods:rhubarb_pie",{ minetest.register_node("mtfoods:rhubarb_pie",{
drawtype="nodebox", drawtype="nodebox",
paramtype = "light", paramtype = "light",
description = "Rhubarb Pie", description = S("Rhubarb Pie"),
on_use = minetest.item_eat(5), on_use = minetest.item_eat(5),
groups = {cracky=1,choppy=1,crumbly=1,oddly_breakable_by_hand=1}, groups = {cracky=1,choppy=1,crumbly=1,oddly_breakable_by_hand=1},
tiles = {"mtfoods_rpie_top.png","mtfoods_pie_bottom.png","mtfoods_pie_side.png","mtfoods_pie_side.png","mtfoods_pie_side.png","mtfoods_pie_side.png"}, tiles = {"mtfoods_rpie_top.png","mtfoods_pie_bottom.png","mtfoods_pie_side.png","mtfoods_pie_side.png","mtfoods_pie_side.png","mtfoods_pie_side.png"},
@ -325,7 +327,7 @@ minetest.register_node("mtfoods:rhubarb_pie",{
minetest.register_node("mtfoods:banana_pie",{ minetest.register_node("mtfoods:banana_pie",{
drawtype="nodebox", drawtype="nodebox",
paramtype = "light", paramtype = "light",
description = "Banana Pie", description = S("Banana Pie"),
on_use = minetest.item_eat(5), on_use = minetest.item_eat(5),
groups = {cracky=1,choppy=1,crumbly=1,oddly_breakable_by_hand=1}, groups = {cracky=1,choppy=1,crumbly=1,oddly_breakable_by_hand=1},
tiles = {"mtfoods_bpie_top.png","mtfoods_pie_bottom.png","mtfoods_pie_side.png","mtfoods_pie_side.png","mtfoods_pie_side.png","mtfoods_pie_side.png"}, tiles = {"mtfoods_bpie_top.png","mtfoods_pie_bottom.png","mtfoods_pie_side.png","mtfoods_pie_side.png","mtfoods_pie_side.png","mtfoods_pie_side.png"},
@ -342,7 +344,7 @@ minetest.register_node("mtfoods:banana_pie",{
minetest.register_node("mtfoods:pumpkin_pie",{ minetest.register_node("mtfoods:pumpkin_pie",{
drawtype="nodebox", drawtype="nodebox",
paramtype = "light", paramtype = "light",
description = "Pumpkin Pie", description = S("Pumpkin Pie"),
on_use = minetest.item_eat(5), on_use = minetest.item_eat(5),
groups = {cracky=1,choppy=1,crumbly=1,oddly_breakable_by_hand=1}, groups = {cracky=1,choppy=1,crumbly=1,oddly_breakable_by_hand=1},
tiles = {"mtfoods_ppie_top.png","mtfoods_pie_bottom.png","mtfoods_pie_side.png","mtfoods_pie_side.png","mtfoods_pie_side.png","mtfoods_pie_side.png"}, tiles = {"mtfoods_ppie_top.png","mtfoods_pie_bottom.png","mtfoods_pie_side.png","mtfoods_pie_side.png","mtfoods_pie_side.png","mtfoods_pie_side.png"},
@ -359,7 +361,7 @@ minetest.register_node("mtfoods:pumpkin_pie",{
minetest.register_node("mtfoods:boston_cream",{ minetest.register_node("mtfoods:boston_cream",{
drawtype="nodebox", drawtype="nodebox",
paramtype = "light", paramtype = "light",
description = "Boston Cream Pie", description = S("Boston Cream Pie"),
on_use = minetest.item_eat(5), on_use = minetest.item_eat(5),
groups = {cracky=1,choppy=1,crumbly=1,oddly_breakable_by_hand=1}, groups = {cracky=1,choppy=1,crumbly=1,oddly_breakable_by_hand=1},
tiles = {"mtfoods_cake_cbottom.png","mtfoods_pie_bottom.png","mtfoods_bcpie_side.png","mtfoods_bcpie_side.png","mtfoods_bcpie_side.png","mtfoods_bcpie_side.png"}, tiles = {"mtfoods_cake_cbottom.png","mtfoods_pie_bottom.png","mtfoods_bcpie_side.png","mtfoods_bcpie_side.png","mtfoods_bcpie_side.png","mtfoods_bcpie_side.png"},
@ -377,7 +379,7 @@ minetest.register_node("mtfoods:boston_cream",{
minetest.register_node("mtfoods:cookies",{ minetest.register_node("mtfoods:cookies",{
drawtype = "nodebox", drawtype = "nodebox",
paramtype = "light", paramtype = "light",
description = "Cookies", description = S("Cookies"),
on_use = minetest.item_eat(3), on_use = minetest.item_eat(3),
groups = {cracky=1,choppy=1,crumbly=1,oddly_breakable_by_hand=1}, groups = {cracky=1,choppy=1,crumbly=1,oddly_breakable_by_hand=1},
tiles = {"mtfoods_cookies.png","mtfoods_cookies.png","mtfoods_cookies.png","mtfoods_cookies.png","mtfoods_cookies.png","mtfoods_cookies.png"}, tiles = {"mtfoods_cookies.png","mtfoods_cookies.png","mtfoods_cookies.png","mtfoods_cookies.png","mtfoods_cookies.png","mtfoods_cookies.png"},
@ -394,7 +396,7 @@ minetest.register_node("mtfoods:cookies",{
minetest.register_node("mtfoods:chocolate",{ minetest.register_node("mtfoods:chocolate",{
drawtype = "nodebox", drawtype = "nodebox",
paramtype = "light", paramtype = "light",
description = "Chocolate Bars", description = S("Chocolate Bars"),
on_use = minetest.item_eat(2), on_use = minetest.item_eat(2),
groups = {cracky=1,choppy=1,crumbly=1,oddly_breakable_by_hand=1}, groups = {cracky=1,choppy=1,crumbly=1,oddly_breakable_by_hand=1},
tiles = {"mtfoods_chocolate.png","mtfoods_chocolate.png","mtfoods_chocolate.png","mtfoods_chocolate.png","mtfoods_chocolate.png","mtfoods_chocolate.png"}, tiles = {"mtfoods_chocolate.png","mtfoods_chocolate.png","mtfoods_chocolate.png","mtfoods_chocolate.png","mtfoods_chocolate.png","mtfoods_chocolate.png"},
@ -410,7 +412,7 @@ minetest.register_node("mtfoods:chocolate",{
minetest.register_node("mtfoods:cupcake",{ minetest.register_node("mtfoods:cupcake",{
drawtype = "nodebox", drawtype = "nodebox",
paramtype = "light", paramtype = "light",
description = "Cupcakes", description = S("Cupcakes"),
on_use = minetest.item_eat(3.5), on_use = minetest.item_eat(3.5),
groups = {cracky=1,choppy=1,crumbly=1,oddly_breakable_by_hand=1}, groups = {cracky=1,choppy=1,crumbly=1,oddly_breakable_by_hand=1},
tiles = {"mtfoods_cupcake_top.png","mtfoods_cake_bottom.png","mtfoods_cupcake_side.png","mtfoods_cupcake_side.png","mtfoods_cupcake_side.png","mtfoods_cupcake_side.png"}, tiles = {"mtfoods_cupcake_top.png","mtfoods_cake_bottom.png","mtfoods_cupcake_side.png","mtfoods_cupcake_side.png","mtfoods_cupcake_side.png","mtfoods_cupcake_side.png"},

View File

@ -1,6 +1,9 @@
local S = mtfoods.get_translator
local ing = mtfoods.ingredients
-- Flute Glass -- -- Flute Glass --
minetest.register_craftitem("mtfoods:glass_flute", { minetest.register_craftitem("mtfoods:glass_flute", {
description = "Glass Flute", description = S("Glass Flute"),
inventory_image = "mtfoods_flute.png", inventory_image = "mtfoods_flute.png",
}) })
@ -17,7 +20,7 @@ minetest.register_craft({
--orange-- --orange--
minetest.register_craftitem("mtfoods:orange_juice", { minetest.register_craftitem("mtfoods:orange_juice", {
description = "Orange Juice", description = S("Orange Juice"),
inventory_image = "mtfoods_orange_juice.png", inventory_image = "mtfoods_orange_juice.png",
on_use = minetest.item_eat(0.5), on_use = minetest.item_eat(0.5),
}) })
@ -31,7 +34,7 @@ minetest.register_craft({
--apple-- --apple--
minetest.register_craftitem("mtfoods:apple_juice", { minetest.register_craftitem("mtfoods:apple_juice", {
description = "Apple Juice", description = S("Apple Juice"),
inventory_image = "mtfoods_apple_juice.png", inventory_image = "mtfoods_apple_juice.png",
on_use = minetest.item_eat(0.5), on_use = minetest.item_eat(0.5),
}) })
@ -48,7 +51,7 @@ minetest.register_node("mtfoods:apple_cider", {
drawtype = 'plantlike', drawtype = 'plantlike',
paramtype = 'light', paramtype = 'light',
tiles = {"mtfoods_apple_cider.png"}, tiles = {"mtfoods_apple_cider.png"},
description = "Apple Cider in Bottle", description = S("Apple Cider in Bottle"),
inventory_image = "mtfoods_apple_cider.png", inventory_image = "mtfoods_apple_cider.png",
wield_image = "mtfoods_apple_cider.png", wield_image = "mtfoods_apple_cider.png",
on_use = minetest.item_eat(1), on_use = minetest.item_eat(1),
@ -72,7 +75,7 @@ minetest.register_node("mtfoods:cider_rack", {
paramtype = 'light', paramtype = 'light',
paramtype2 = "facedir", paramtype2 = "facedir",
tiles = {"mtfoods_ciderrack_other_sides.png", "mtfoods_ciderrack_other_sides.png", "mtfoods_ciderrack_other_sides.png", "mtfoods_ciderrack_other_sides.png", "mtfoods_ciderrack_other_sides.png", "mtfoods_ciderrack.png",}, tiles = {"mtfoods_ciderrack_other_sides.png", "mtfoods_ciderrack_other_sides.png", "mtfoods_ciderrack_other_sides.png", "mtfoods_ciderrack_other_sides.png", "mtfoods_ciderrack_other_sides.png", "mtfoods_ciderrack.png",},
description = "A Cider Rack", description = S("A Cider Rack"),
inventory_image = "mtfoods_ciderrack.png", inventory_image = "mtfoods_ciderrack.png",
wield_image = "mtfoods_ciderrack.png", wield_image = "mtfoods_ciderrack.png",
groups = {oddly_breakable_by_hand=3, choppy=3}, groups = {oddly_breakable_by_hand=3, choppy=3},

View File

@ -1,9 +1,12 @@
local S = mtfoods.get_translator
-- Foods -- -- Foods --
--MLT-- --MLT--
local ing = mtfoods.ingredients
minetest.register_craftitem( "mtfoods:mlt_burger", { minetest.register_craftitem( "mtfoods:mlt_burger", {
description = "MLT (Mutton, Lettuce, Tomato)", description = S("MLT (Mutton, Lettuce, Tomato)"),
inventory_image = "mtfoods_mlt.png", inventory_image = "mtfoods_mlt.png",
wield_image = "mtfoods_mlt.png", wield_image = "mtfoods_mlt.png",
on_use = minetest.item_eat(6.5), on_use = minetest.item_eat(6.5),
@ -21,7 +24,7 @@ minetest.register_craft({
--Potato uses-- --Potato uses--
minetest.register_craftitem( "mtfoods:potato_slices", { minetest.register_craftitem( "mtfoods:potato_slices", {
description = "Sliced Potato", description = S("Sliced Potato"),
inventory_image = "mtfoods_potato_slices.png", inventory_image = "mtfoods_potato_slices.png",
wield_image = "mtfoods_potato_slices.png", wield_image = "mtfoods_potato_slices.png",
on_use = minetest.item_eat(2), on_use = minetest.item_eat(2),
@ -35,7 +38,7 @@ minetest.register_craft({
}) })
minetest.register_craftitem( "mtfoods:potato_chips", { minetest.register_craftitem( "mtfoods:potato_chips", {
description = "Potato Chips", description = S("Potato Chips"),
inventory_image = "mtfoods_potato_chips.png", inventory_image = "mtfoods_potato_chips.png",
wield_image = "mtfoods_potato_chips.png", wield_image = "mtfoods_potato_chips.png",
on_use = minetest.item_eat(3), on_use = minetest.item_eat(3),
@ -50,7 +53,7 @@ minetest.register_craft({
-- Medicine -- -- Medicine --
minetest.register_craftitem( "mtfoods:medicine", { minetest.register_craftitem( "mtfoods:medicine", {
description = "Medicine", description = S("Medicine"),
inventory_image = "mtfoods_medicine.png", inventory_image = "mtfoods_medicine.png",
wield_image = "mtfoods_medicine.png", wield_image = "mtfoods_medicine.png",
on_use = minetest.item_eat(8), on_use = minetest.item_eat(8),
@ -67,7 +70,7 @@ minetest.register_craft({
minetest.register_node( "mtfoods:casserole",{ minetest.register_node( "mtfoods:casserole",{
drawtype = "nodebox", drawtype = "nodebox",
description = "Casserole", description = S("Casserole"),
paramtype = "light", paramtype = "light",
on_use = minetest.item_eat(5), on_use = minetest.item_eat(5),
groups = {cracky=1,choppy=1,crumbly=1,oddly_breakable_by_hand=1}, groups = {cracky=1,choppy=1,crumbly=1,oddly_breakable_by_hand=1},

View File

@ -1,13 +1,17 @@
--MTFoods-- --MTFoods--
--By: Philipbenr-- --By: Philipbenr--
--Licence: GPLv3-- --Licence: GPLv3--
mtfoods = {}
local S = minetest.get_translator("mtfoods")
mtfoods.get_translator = S
local orange_ing = "farming_plus:orange" local orange_ing = "farming_plus:orange"
if minetest.get_modpath("ethereal") then if minetest.get_modpath("ethereal") then
orange_ing = "ethereal:orange" orange_ing = "ethereal:orange"
end end
ing = { mtfoods.ingredients = {
orange = orange_ing, orange = orange_ing,
apple = "default:apple", apple = "default:apple",
meat = "mobs:meat", meat = "mobs:meat",
@ -26,7 +30,7 @@ ing = {
-- Add support for the food mod's ingredient list -- Add support for the food mod's ingredient list
if minetest.get_modpath("food") then if minetest.get_modpath("food") then
ing = { mtfoods.ingredients = {
orange = "group:food_orange", orange = "group:food_orange",
apple = "default:apple", apple = "default:apple",
meat = "group:food_meat", meat = "group:food_meat",

38
locale/mtfoods.fr.tr Normal file
View File

@ -0,0 +1,38 @@
# textdomain: mtfoods
## desserts.lua ##
Dandelion Milk=Lait de pissenlit
Sugar=Sucre
Short Bread=Petit pain
Pie Crust=Pâte à tarte
Cream=Crème
Chocolate Bits=Morceaux de chocolat
Cup-Cake=Petit gâteau
Strawberry Short-Cake=Petit gâteaux à la fraise
Cake=Gâteau
Chocolate Cake=Gateau au chocolat
Carrot Cake=Gâteau à la carotte
Apple Pie=Tarte aux pommes
Rhubarb Pie=tarte à la rhubarbe
Banana Pie=Tarte aux bananes
Pumpkin Pie=Tarte à la citrouille
Boston Cream Pie=Tarte à la crème de Boston
Cookies=Biscuits
Chocolate Bars=Barres de chocolat
Cupcakes=Petits gâteaux
## drinks.lua ##
Glass Flute=Flûte en verre
Orange Juice=Jus d'orange
Apple Juice=Jus de pomme
Apple Cider in Bottle=Cidre de pomme en bouteille
A Cider Rack=Un casier à cidre
## foods.lua ##
MLT (Mutton, Lettuce, Tomato)=MLT (Mouton, Laitue, Tomate)
Sliced Potato=Pomme de terre en tranches
Potato Chips=Chips de pommes de terre
Medicine=Médecine
Casserole=Casserole

46
locale/template.txt Normal file
View File

@ -0,0 +1,46 @@
# textdomain: mtfoods
## desserts.lua ##
Dandelion Milk=
Sugar=
Short Bread=
Pie Crust=
Cream=
Chocolate Bits=
Cup-Cake=
Strawberry Short-Cake=
Cake=
Chocolate Cake=
Carrot Cake=
Apple Pie=
Rhubarb Pie=
Banana Pie=
Pumpkin Pie=
Boston Cream Pie=
Cookies=
Chocolate Bars=
Cupcakes=
## drinks.lua ##
Glass Flute=
Orange Juice=
Apple Juice=
Apple Cider in Bottle=
A Cider Rack=
## foods.lua ##
MLT (Mutton, Lettuce, Tomato)=
Sliced Potato=
Potato Chips=
Medicine=
Casserole=