translate engine swich to minetest butilin

fork-master
Emojigit 2021-04-24 12:56:28 +08:00
parent 774a2d79bc
commit 37fd93d9ae
7 changed files with 43 additions and 89 deletions

View File

@ -1,15 +1,6 @@
-- 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
local armchairs_list = { local armchairs_list = {
{ "Red Armchair", "red"}, { "Red Armchair", "red"},
{ "Orange Armchair", "orange"}, { "Orange Armchair", "orange"},
{ "Yellow Armchair", "yellow"}, { "Yellow Armchair", "yellow"},
{ "Green Armchair", "green"}, { "Green Armchair", "green"},
{ "Blue Armchair", "blue"}, { "Blue Armchair", "blue"},
@ -40,13 +31,13 @@ for i in ipairs(armchairs_list) do
{0.375, -0.5, -0.4375, 0.4375, -0.375, -0.375}, {0.375, -0.5, -0.4375, 0.4375, -0.375, -0.375},
{-0.4375, -0.5, 0.375, -0.375, -0.375, 0.4375}, {-0.4375, -0.5, 0.375, -0.375, -0.375, 0.4375},
{0.375, -0.5, 0.375, 0.4375, -0.375, 0.4375}, {0.375, -0.5, 0.375, 0.4375, -0.375, 0.4375},
--base/cushion --base/cushion
{-0.5, -0.375, -0.5, 0.5, 0, 0.5}, {-0.5, -0.375, -0.5, 0.5, 0, 0.5},
--back --back
{-0.5, 0, 0.3125, 0.5, 0.5, 0.5}, {-0.5, 0, 0.3125, 0.5, 0.5, 0.5},
--arms --arms
{-0.5, 0, -0.5, -0.3125, 0.25, 0.3125}, {-0.5, 0, -0.5, -0.3125, 0.25, 0.3125},
{0.3125, 0, -0.5, 0.5, 0.25, 0.3125}, {0.3125, 0, -0.5, 0.5, 0.25, 0.3125},
@ -68,7 +59,7 @@ for i in ipairs(armchairs_list) do
clicker:set_hp(20) clicker:set_hp(20)
end end
}) })
minetest.register_craft({ minetest.register_craft({
output = "lrfurn:armchair_"..colour, output = "lrfurn:armchair_"..colour,
recipe = { recipe = {
@ -77,7 +68,7 @@ for i in ipairs(armchairs_list) do
{"default:stick", "", "", } {"default:stick", "", "", }
} }
}) })
minetest.register_craft({ minetest.register_craft({
output = "lrfurn:armchair_"..colour, output = "lrfurn:armchair_"..colour,
recipe = { recipe = {

View File

@ -1,13 +1,3 @@
-- 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
minetest.register_node("lrfurn:coffeetable_back", { minetest.register_node("lrfurn:coffeetable_back", {
description = S("Coffee Table"), description = S("Coffee Table"),
drawtype = "nodebox", drawtype = "nodebox",
@ -23,9 +13,9 @@ minetest.register_node("lrfurn:coffeetable_back", {
--legs --legs
{-0.375, -0.5, -0.375, -0.3125, -0.0625, -0.3125}, {-0.375, -0.5, -0.375, -0.3125, -0.0625, -0.3125},
{0.3125, -0.5, -0.375, 0.375, -0.0625, -0.3125}, {0.3125, -0.5, -0.375, 0.375, -0.0625, -0.3125},
--tabletop --tabletop
{-0.4375, -0.0625, -0.4375, 0.4375, 0, 0.5}, {-0.4375, -0.0625, -0.4375, 0.4375, 0, 0.5},
} }
}, },
selection_box = { selection_box = {
@ -52,7 +42,7 @@ minetest.register_node("lrfurn:coffeetable_back", {
minetest.env:set_node(pos, node) minetest.env:set_node(pos, node)
end end
end, end,
on_destruct = function(pos) on_destruct = function(pos)
local node = minetest.env:get_node(pos) local node = minetest.env:get_node(pos)
local param2 = node.param2 local param2 = node.param2
@ -68,7 +58,7 @@ minetest.register_node("lrfurn:coffeetable_back", {
if( minetest.env:get_node({x=pos.x, y=pos.y, z=pos.z}).name == "lrfurn:coffeetable_front" ) then if( minetest.env:get_node({x=pos.x, y=pos.y, z=pos.z}).name == "lrfurn:coffeetable_front" ) then
if( minetest.env:get_node({x=pos.x, y=pos.y, z=pos.z}).param2 == param2 ) then if( minetest.env:get_node({x=pos.x, y=pos.y, z=pos.z}).param2 == param2 ) then
minetest.env:remove_node(pos) minetest.env:remove_node(pos)
end end
end end
end, end,
}) })
@ -86,7 +76,7 @@ minetest.register_node("lrfurn:coffeetable_front", {
--legs --legs
{-0.375, -0.5, 0.3125, -0.3125, -0.0625, 0.375}, {-0.375, -0.5, 0.3125, -0.3125, -0.0625, 0.375},
{0.3125, -0.5, 0.3125, 0.375, -0.0625, 0.375}, {0.3125, -0.5, 0.3125, 0.375, -0.0625, 0.375},
--tabletop --tabletop
{-0.4375, -0.0625, -0.5, 0.4375, 0, 0.4375}, {-0.4375, -0.0625, -0.5, 0.4375, 0, 0.4375},
} }

View File

@ -1,12 +1,3 @@
-- 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
minetest.register_node("lrfurn:endtable", { minetest.register_node("lrfurn:endtable", {
description = S("End Table"), description = S("End Table"),
drawtype = "nodebox", drawtype = "nodebox",
@ -24,9 +15,9 @@ minetest.register_node("lrfurn:endtable", {
{0.3125, -0.5, -0.375, 0.375, -0.0625, -0.3125}, {0.3125, -0.5, -0.375, 0.375, -0.0625, -0.3125},
{-0.375, -0.5, 0.3125, -0.3125, -0.0625, 0.375}, {-0.375, -0.5, 0.3125, -0.3125, -0.0625, 0.375},
{0.3125, -0.5, 0.3125, 0.375, -0.0625, 0.375}, {0.3125, -0.5, 0.3125, 0.375, -0.0625, 0.375},
--tabletop --tabletop
{-0.4375, -0.0625, -0.4375, 0.4375, 0, 0.4375}, {-0.4375, -0.0625, -0.4375, 0.4375, 0, 0.4375},
} }
}, },
selection_box = { selection_box = {

View File

@ -1,3 +1,4 @@
local S = minetest.get_translator("lrfurn")
dofile(minetest.get_modpath("lrfurn").."/longsofas.lua") dofile(minetest.get_modpath("lrfurn").."/longsofas.lua")
dofile(minetest.get_modpath("lrfurn").."/sofas.lua") dofile(minetest.get_modpath("lrfurn").."/sofas.lua")
dofile(minetest.get_modpath("lrfurn").."/armchairs.lua") dofile(minetest.get_modpath("lrfurn").."/armchairs.lua")

View File

@ -1,3 +1,4 @@
# textdomain: lrfurn
# Translation by Xanthin # Translation by Xanthin
### armchairs.lua ### ### armchairs.lua ###

View File

@ -1,16 +1,6 @@
-- 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
local longsofas_list = { local longsofas_list = {
{ "Red Long Sofa", "red"}, { "Red Long Sofa", "red"},
{ "Orange Long Sofa", "orange"}, { "Orange Long Sofa", "orange"},
{ "Yellow Long Sofa", "yellow"}, { "Yellow Long Sofa", "yellow"},
{ "Green Long Sofa", "green"}, { "Green Long Sofa", "green"},
{ "Blue Long Sofa", "blue"}, { "Blue Long Sofa", "blue"},
@ -39,13 +29,13 @@ for i in ipairs(longsofas_list) do
--legs --legs
{-0.4375, -0.5, -0.4375, -0.375, -0.375, -0.375}, {-0.4375, -0.5, -0.4375, -0.375, -0.375, -0.375},
{0.375, -0.5, -0.4375, 0.4375, -0.375, -0.375}, {0.375, -0.5, -0.4375, 0.4375, -0.375, -0.375},
--base/cushion --base/cushion
{-0.5, -0.375, -0.5, 0.5, 0, 0.5}, {-0.5, -0.375, -0.5, 0.5, 0, 0.5},
--back --back
{-0.5, 0, -0.5, -0.3125, 0.5, 0.5}, {-0.5, 0, -0.5, -0.3125, 0.5, 0.5},
--arm --arm
{-0.3125, 0, -0.5, 0.5, 0.25, -0.3125}, {-0.3125, 0, -0.5, 0.5, 0.25, -0.3125},
} }
@ -87,7 +77,7 @@ for i in ipairs(longsofas_list) do
end end
end end
end, end,
on_destruct = function(pos) on_destruct = function(pos)
local node = minetest.env:get_node(pos) local node = minetest.env:get_node(pos)
local param2 = node.param2 local param2 = node.param2
@ -115,12 +105,12 @@ for i in ipairs(longsofas_list) do
if( minetest.env:get_node({x=pos.x, y=pos.y, z=pos.z}).name == "lrfurn:longsofa_left_"..colour ) then if( minetest.env:get_node({x=pos.x, y=pos.y, z=pos.z}).name == "lrfurn:longsofa_left_"..colour ) then
if( minetest.env:get_node({x=pos.x, y=pos.y, z=pos.z}).param2 == param2 ) then if( minetest.env:get_node({x=pos.x, y=pos.y, z=pos.z}).param2 == param2 ) then
minetest.env:remove_node(pos) minetest.env:remove_node(pos)
end end
end end
end end
end end
end, end,
on_rightclick = function(pos, node, clicker) on_rightclick = function(pos, node, clicker)
if not clicker:is_player() then if not clicker:is_player() then
return return
@ -144,10 +134,10 @@ for i in ipairs(longsofas_list) do
--legs --legs
{-0.4375, -0.5, -0.03125, -0.375, -0.375, 0.03125}, {-0.4375, -0.5, -0.03125, -0.375, -0.375, 0.03125},
{0.375, -0.5, -0.03125, 0.4375, -0.375, 0.03125}, {0.375, -0.5, -0.03125, 0.4375, -0.375, 0.03125},
--base/cushion --base/cushion
{-0.5, -0.375, -0.5, 0.5, 0, 0.5}, {-0.5, -0.375, -0.5, 0.5, 0, 0.5},
--back --back
{-0.5, 0, -0.5, -0.3125, 0.5, 0.5}, {-0.5, 0, -0.5, -0.3125, 0.5, 0.5},
} }
@ -159,7 +149,7 @@ for i in ipairs(longsofas_list) do
} }
}, },
}) })
minetest.register_node("lrfurn:longsofa_left_"..colour, { minetest.register_node("lrfurn:longsofa_left_"..colour, {
drawtype = "nodebox", drawtype = "nodebox",
tiles = {"lrfurn_sofa_left_top_"..colour..".png", "lrfurn_coffeetable_back.png", "lrfurn_sofa_left_front_"..colour..".png", "lrfurn_sofa_back_"..colour..".png", "lrfurn_sofa_left_side_"..colour..".png", "lrfurn_sofa_right_side_"..colour..".png"}, tiles = {"lrfurn_sofa_left_top_"..colour..".png", "lrfurn_coffeetable_back.png", "lrfurn_sofa_left_front_"..colour..".png", "lrfurn_sofa_back_"..colour..".png", "lrfurn_sofa_left_side_"..colour..".png", "lrfurn_sofa_right_side_"..colour..".png"},
@ -173,13 +163,13 @@ for i in ipairs(longsofas_list) do
--legs --legs
{-0.4375, -0.5, 0.375, -0.375, -0.375, 0.4375}, {-0.4375, -0.5, 0.375, -0.375, -0.375, 0.4375},
{0.375, -0.5, 0.375, 0.4375, -0.375, 0.4375}, {0.375, -0.5, 0.375, 0.4375, -0.375, 0.4375},
--base/cushion --base/cushion
{-0.5, -0.375, -0.5, 0.5, 0, 0.5}, {-0.5, -0.375, -0.5, 0.5, 0, 0.5},
--back --back
{-0.5, 0, -0.5, -0.3125, 0.5, 0.5}, {-0.5, 0, -0.5, -0.3125, 0.5, 0.5},
--arm --arm
{-0.3125, 0, 0.3125, 0.5, 0.25, 0.5}, {-0.3125, 0, 0.3125, 0.5, 0.25, 0.5},
} }
@ -191,9 +181,9 @@ for i in ipairs(longsofas_list) do
} }
}, },
}) })
minetest.register_alias("lrfurn:longsofa_"..colour, "lrfurn:longsofa_right_"..colour) minetest.register_alias("lrfurn:longsofa_"..colour, "lrfurn:longsofa_right_"..colour)
minetest.register_craft({ minetest.register_craft({
output = "lrfurn:longsofa_"..colour, output = "lrfurn:longsofa_"..colour,
recipe = { recipe = {

View File

@ -1,16 +1,6 @@
-- 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
local sofas_list = { local sofas_list = {
{ "Red Sofa", "red"}, { "Red Sofa", "red"},
{ "Orange Sofa", "orange"}, { "Orange Sofa", "orange"},
{ "Yellow Sofa", "yellow"}, { "Yellow Sofa", "yellow"},
{ "Green Sofa", "green"}, { "Green Sofa", "green"},
{ "Blue Sofa", "blue"}, { "Blue Sofa", "blue"},
@ -39,13 +29,13 @@ for i in ipairs(sofas_list) do
--legs --legs
{-0.4375, -0.5, -0.4375, -0.375, -0.375, -0.375}, {-0.4375, -0.5, -0.4375, -0.375, -0.375, -0.375},
{0.375, -0.5, -0.4375, 0.4375, -0.375, -0.375}, {0.375, -0.5, -0.4375, 0.4375, -0.375, -0.375},
--base/cushion --base/cushion
{-0.5, -0.375, -0.5, 0.5, 0, 0.5}, {-0.5, -0.375, -0.5, 0.5, 0, 0.5},
--back --back
{-0.5, 0, -0.5, -0.3125, 0.5, 0.5}, {-0.5, 0, -0.5, -0.3125, 0.5, 0.5},
--arm --arm
{-0.3125, 0, -0.5, 0.5, 0.25, -0.3125}, {-0.3125, 0, -0.5, 0.5, 0.25, -0.3125},
} }
@ -74,7 +64,7 @@ for i in ipairs(sofas_list) do
minetest.env:set_node(pos, node) minetest.env:set_node(pos, node)
end end
end, end,
on_destruct = function(pos) on_destruct = function(pos)
local node = minetest.env:get_node(pos) local node = minetest.env:get_node(pos)
local param2 = node.param2 local param2 = node.param2
@ -90,10 +80,10 @@ for i in ipairs(sofas_list) do
if( minetest.env:get_node({x=pos.x, y=pos.y, z=pos.z}).name == "lrfurn:sofa_left_"..colour ) then if( minetest.env:get_node({x=pos.x, y=pos.y, z=pos.z}).name == "lrfurn:sofa_left_"..colour ) then
if( minetest.env:get_node({x=pos.x, y=pos.y, z=pos.z}).param2 == param2 ) then if( minetest.env:get_node({x=pos.x, y=pos.y, z=pos.z}).param2 == param2 ) then
minetest.env:remove_node(pos) minetest.env:remove_node(pos)
end end
end end
end, end,
on_rightclick = function(pos, node, clicker) on_rightclick = function(pos, node, clicker)
if not clicker:is_player() then if not clicker:is_player() then
return return
@ -103,7 +93,7 @@ for i in ipairs(sofas_list) do
clicker:set_hp(20) clicker:set_hp(20)
end end
}) })
minetest.register_node("lrfurn:sofa_left_"..colour, { minetest.register_node("lrfurn:sofa_left_"..colour, {
drawtype = "nodebox", drawtype = "nodebox",
tiles = {"lrfurn_sofa_left_top_"..colour..".png", "lrfurn_coffeetable_back.png", "lrfurn_sofa_left_front_"..colour..".png", "lrfurn_sofa_back_"..colour..".png", "lrfurn_sofa_left_side_"..colour..".png", "lrfurn_sofa_right_side_"..colour..".png"}, tiles = {"lrfurn_sofa_left_top_"..colour..".png", "lrfurn_coffeetable_back.png", "lrfurn_sofa_left_front_"..colour..".png", "lrfurn_sofa_back_"..colour..".png", "lrfurn_sofa_left_side_"..colour..".png", "lrfurn_sofa_right_side_"..colour..".png"},
@ -117,13 +107,13 @@ for i in ipairs(sofas_list) do
--legs --legs
{-0.4375, -0.5, 0.375, -0.375, -0.375, 0.4375}, {-0.4375, -0.5, 0.375, -0.375, -0.375, 0.4375},
{0.375, -0.5, 0.375, 0.4375, -0.375, 0.4375}, {0.375, -0.5, 0.375, 0.4375, -0.375, 0.4375},
--base/cushion --base/cushion
{-0.5, -0.375, -0.5, 0.5, 0, 0.5}, {-0.5, -0.375, -0.5, 0.5, 0, 0.5},
--back --back
{-0.5, 0, -0.5, -0.3125, 0.5, 0.5}, {-0.5, 0, -0.5, -0.3125, 0.5, 0.5},
--arm --arm
{-0.3125, 0, 0.3125, 0.5, 0.25, 0.5}, {-0.3125, 0, 0.3125, 0.5, 0.25, 0.5},
} }
@ -135,7 +125,7 @@ for i in ipairs(sofas_list) do
} }
}, },
}) })
minetest.register_alias("lrfurn:sofa_"..colour, "lrfurn:sofa_right_"..colour) minetest.register_alias("lrfurn:sofa_"..colour, "lrfurn:sofa_right_"..colour)
minetest.register_craft({ minetest.register_craft({