From a9809998bf83439b8bce47668acbdac74881a74c Mon Sep 17 00:00:00 2001 From: Louis Royer <4259825-lroyer@users.noreply.gitlab.com> Date: Wed, 5 Aug 2020 00:35:08 +0200 Subject: [PATCH] MT5 translation for homedecor_seating - Add screwdriver to optional_depends - Fix luacheck warnings --- homedecor_seating/armchairs.lua | 5 ++-- homedecor_seating/depends.txt | 5 ---- homedecor_seating/init.lua | 18 +++++++++----- .../locale/homedecor_seating.de.tr | 24 +++++++++++++++++++ .../locale/homedecor_seating.es.tr | 24 +++++++++++++++++++ .../locale/homedecor_seating.fr.tr | 24 +++++++++++++++++++ .../locale/homedecor_seating.it.tr | 24 +++++++++++++++++++ .../locale/homedecor_seating.ms.tr | 24 +++++++++++++++++++ .../locale/homedecor_seating.pt.tr | 24 +++++++++++++++++++ .../locale/homedecor_seating.pt_BR.tr | 24 +++++++++++++++++++ .../locale/homedecor_seating.ru.tr | 24 +++++++++++++++++++ .../locale/homedecor_seating.zh_CN.tr | 24 +++++++++++++++++++ homedecor_seating/locale/template.txt | 24 +++++++++++++++++++ homedecor_seating/longsofas.lua | 7 +++--- homedecor_seating/misc.lua | 18 ++++---------- homedecor_seating/mod.conf | 4 ++++ homedecor_seating/sofas.lua | 7 +++--- 17 files changed, 269 insertions(+), 35 deletions(-) delete mode 100644 homedecor_seating/depends.txt create mode 100644 homedecor_seating/locale/homedecor_seating.de.tr create mode 100644 homedecor_seating/locale/homedecor_seating.es.tr create mode 100644 homedecor_seating/locale/homedecor_seating.fr.tr create mode 100644 homedecor_seating/locale/homedecor_seating.it.tr create mode 100644 homedecor_seating/locale/homedecor_seating.ms.tr create mode 100644 homedecor_seating/locale/homedecor_seating.pt.tr create mode 100644 homedecor_seating/locale/homedecor_seating.pt_BR.tr create mode 100644 homedecor_seating/locale/homedecor_seating.ru.tr create mode 100644 homedecor_seating/locale/homedecor_seating.zh_CN.tr create mode 100644 homedecor_seating/locale/template.txt create mode 100644 homedecor_seating/mod.conf diff --git a/homedecor_seating/armchairs.lua b/homedecor_seating/armchairs.lua index 36f47cb2..609ce827 100644 --- a/homedecor_seating/armchairs.lua +++ b/homedecor_seating/armchairs.lua @@ -1,5 +1,4 @@ - -local S = homedecor.gettext +local S = minetest.get_translator("homedecor_seating") local armchair_cbox = { type = "fixed", fixed = { @@ -169,5 +168,5 @@ minetest.register_lbm({ }) if minetest.settings:get("log_mods") then - minetest.log("action", "[lrfurn/armchairs] "..S("Loaded!")) + minetest.log("action", "[lrfurn/armchairs] Loaded!") end diff --git a/homedecor_seating/depends.txt b/homedecor_seating/depends.txt deleted file mode 100644 index c238ee6b..00000000 --- a/homedecor_seating/depends.txt +++ /dev/null @@ -1,5 +0,0 @@ -default -wool -homedecor_common -unifieddyes -basic_materials diff --git a/homedecor_seating/init.lua b/homedecor_seating/init.lua index fe10327f..3587e090 100644 --- a/homedecor_seating/init.lua +++ b/homedecor_seating/init.lua @@ -1,11 +1,10 @@ -- Home decor seating -- forked from the previous lrfurn mod -local S = homedecor.gettext +local S = minetest.get_translator("homedecor_seating") local modpath = minetest.get_modpath("homedecor_seating") lrfurn = {} -screwdriver = screwdriver or {} lrfurn.fdir_to_right = { { 1, 0 }, @@ -35,17 +34,24 @@ lrfurn.colors = { function lrfurn.check_right(pos, fdir, long, placer) if not fdir or fdir > 3 then fdir = 0 end - local pos2 = { x = pos.x + lrfurn.fdir_to_right[fdir+1][1], y=pos.y, z = pos.z + lrfurn.fdir_to_right[fdir+1][2] } - local pos3 = { x = pos.x + lrfurn.fdir_to_right[fdir+1][1] * 2, y=pos.y, z = pos.z + lrfurn.fdir_to_right[fdir+1][2] * 2 } + local pos2 = { + x = pos.x + lrfurn.fdir_to_right[fdir+1][1], + y = pos.y, z = pos.z + lrfurn.fdir_to_right[fdir+1][2] + } + local pos3 = { + x = pos.x + lrfurn.fdir_to_right[fdir+1][1] * 2, + y = pos.y, z = pos.z + lrfurn.fdir_to_right[fdir+1][2] * 2 + } local node2 = minetest.get_node(pos2) if node2 and node2.name ~= "air" then return false elseif minetest.is_protected(pos2, placer:get_player_name()) then if not long then - minetest.chat_send_player(placer:get_player_name(), S("Someone else owns the spot where other end goes!")) + minetest.chat_send_player(placer:get_player_name(), S("Someone else owns the spot where the other end goes!")) else - minetest.chat_send_player(placer:get_player_name(), S("Someone else owns the spot where the middle or far end goes!")) + minetest.chat_send_player(placer:get_player_name(), + S("Someone else owns the spot where the middle or far end goes!")) end return false end diff --git a/homedecor_seating/locale/homedecor_seating.de.tr b/homedecor_seating/locale/homedecor_seating.de.tr new file mode 100644 index 00000000..8939d515 --- /dev/null +++ b/homedecor_seating/locale/homedecor_seating.de.tr @@ -0,0 +1,24 @@ +# textdomain: homedecor_seating + + +### armchairs.lua ### + +Armchair=Sessel + +### init.lua ### + +Someone else owns the spot where the middle or far end goes!=Jemanden gehört schon die Stelle, wo das mittlere oder ferne Stück hingehen würde. +Someone else owns the spot where the other end goes!=Jemanden gehört schon die Stelle, wo das andere Ende hingehen würde. + +### longsofas.lua ### + +Long Sofa=Langes Sofa + +### longsofas.lua ### +### sofas.lua ### + +No room to place the sofa!=Kein Platz, um das Sofa zu platzieren! + +### sofas.lua ### + +Sofa=Sofa diff --git a/homedecor_seating/locale/homedecor_seating.es.tr b/homedecor_seating/locale/homedecor_seating.es.tr new file mode 100644 index 00000000..54483ade --- /dev/null +++ b/homedecor_seating/locale/homedecor_seating.es.tr @@ -0,0 +1,24 @@ +# textdomain: homedecor_seating + + +### armchairs.lua ### + +Armchair=Sillón + +### init.lua ### + +Someone else owns the spot where the middle or far end goes!=Alguien ya es dueño del lugar donde va la cabecera. +Someone else owns the spot where the other end goes!=Alguien ya es dueño del lugar donde va la cabecera. + +### longsofas.lua ### + +Long Sofa=Sofá largo + +### longsofas.lua ### +### sofas.lua ### + +No room to place the sofa!=¡No hay lugar para colocar el sofá! + +### sofas.lua ### + +Sofa=Sofá diff --git a/homedecor_seating/locale/homedecor_seating.fr.tr b/homedecor_seating/locale/homedecor_seating.fr.tr new file mode 100644 index 00000000..5ba01a47 --- /dev/null +++ b/homedecor_seating/locale/homedecor_seating.fr.tr @@ -0,0 +1,24 @@ +# textdomain: homedecor_seating + + +### armchairs.lua ### + +Armchair=Fauteuil + +### init.lua ### + +Someone else owns the spot where the middle or far end goes!=Quelqu'un d'autre est propriétaire de l'endroit où va le milieu ou l'autre bout ! +Someone else owns the spot where the other end goes!=Quelqu'un d'autre est propriétaire de l'endroit où va l'autre bout ! + +### longsofas.lua ### + +Long Sofa=Canapé long + +### longsofas.lua ### +### sofas.lua ### + +No room to place the sofa!=Pas assez de place pour poser le canapé ! + +### sofas.lua ### + +Sofa=Canapé diff --git a/homedecor_seating/locale/homedecor_seating.it.tr b/homedecor_seating/locale/homedecor_seating.it.tr new file mode 100644 index 00000000..66a37614 --- /dev/null +++ b/homedecor_seating/locale/homedecor_seating.it.tr @@ -0,0 +1,24 @@ +# textdomain: homedecor_seating + + +### armchairs.lua ### + +Armchair=Poltrona + +### init.lua ### + +Someone else owns the spot where the middle or far end goes!= +Someone else owns the spot where the other end goes!= + +### longsofas.lua ### + +Long Sofa= + +### longsofas.lua ### +### sofas.lua ### + +No room to place the sofa!= + +### sofas.lua ### + +Sofa= diff --git a/homedecor_seating/locale/homedecor_seating.ms.tr b/homedecor_seating/locale/homedecor_seating.ms.tr new file mode 100644 index 00000000..71a16813 --- /dev/null +++ b/homedecor_seating/locale/homedecor_seating.ms.tr @@ -0,0 +1,24 @@ +# textdomain: homedecor_seating + + +### armchairs.lua ### + +Armchair=Kerusi Berlengan + +### init.lua ### + +Someone else owns the spot where the middle or far end goes!=Tempat untuk letak pertengahan atau hujung objek itu kawasan kepunyaan orang lain! +Someone else owns the spot where the other end goes!=Tempat untuk letak hujung objek itu kawasan kepunyaan orang lain! + +### longsofas.lua ### + +Long Sofa=Sofa Panjang + +### longsofas.lua ### +### sofas.lua ### + +No room to place the sofa!=Tiada ruang untuk letak sofa! + +### sofas.lua ### + +Sofa=Sofa diff --git a/homedecor_seating/locale/homedecor_seating.pt.tr b/homedecor_seating/locale/homedecor_seating.pt.tr new file mode 100644 index 00000000..bfd9a3c7 --- /dev/null +++ b/homedecor_seating/locale/homedecor_seating.pt.tr @@ -0,0 +1,24 @@ +# textdomain: homedecor_seating + + +### armchairs.lua ### + +Armchair=Poltrona + +### init.lua ### + +Someone else owns the spot where the middle or far end goes!=Alguém já é proprietário do local onde a cabeceira vai. +Someone else owns the spot where the other end goes!=Alguém já é proprietário do local onde a cabeceira vai. + +### longsofas.lua ### + +Long Sofa=Sofá Grande + +### longsofas.lua ### +### sofas.lua ### + +No room to place the sofa!=Sem espaço para colocar o sofá! + +### sofas.lua ### + +Sofa=Sofá diff --git a/homedecor_seating/locale/homedecor_seating.pt_BR.tr b/homedecor_seating/locale/homedecor_seating.pt_BR.tr new file mode 100644 index 00000000..bfd9a3c7 --- /dev/null +++ b/homedecor_seating/locale/homedecor_seating.pt_BR.tr @@ -0,0 +1,24 @@ +# textdomain: homedecor_seating + + +### armchairs.lua ### + +Armchair=Poltrona + +### init.lua ### + +Someone else owns the spot where the middle or far end goes!=Alguém já é proprietário do local onde a cabeceira vai. +Someone else owns the spot where the other end goes!=Alguém já é proprietário do local onde a cabeceira vai. + +### longsofas.lua ### + +Long Sofa=Sofá Grande + +### longsofas.lua ### +### sofas.lua ### + +No room to place the sofa!=Sem espaço para colocar o sofá! + +### sofas.lua ### + +Sofa=Sofá diff --git a/homedecor_seating/locale/homedecor_seating.ru.tr b/homedecor_seating/locale/homedecor_seating.ru.tr new file mode 100644 index 00000000..37ed4222 --- /dev/null +++ b/homedecor_seating/locale/homedecor_seating.ru.tr @@ -0,0 +1,24 @@ +# textdomain: homedecor_seating + + +### armchairs.lua ### + +Armchair=Кресло + +### init.lua ### + +Someone else owns the spot where the middle or far end goes!=Кому-то другому принадлежит точка, куда выходит средний или дальний конец! +Someone else owns the spot where the other end goes!=Кому-то другому принадлежит точка, где выходит другой конец! + +### longsofas.lua ### + +Long Sofa=Длинный диван + +### longsofas.lua ### +### sofas.lua ### + +No room to place the sofa!=Нет места для дивана! + +### sofas.lua ### + +Sofa=Диван diff --git a/homedecor_seating/locale/homedecor_seating.zh_CN.tr b/homedecor_seating/locale/homedecor_seating.zh_CN.tr new file mode 100644 index 00000000..7420e1ed --- /dev/null +++ b/homedecor_seating/locale/homedecor_seating.zh_CN.tr @@ -0,0 +1,24 @@ +# textdomain: homedecor_seating + + +### armchairs.lua ### + +Armchair=扶手椅 + +### init.lua ### + +Someone else owns the spot where the middle or far end goes!=中间或远端去的地方是别人的! +Someone else owns the spot where the other end goes!=另一端去的地方是别人的! + +### longsofas.lua ### + +Long Sofa=长沙发 + +### longsofas.lua ### +### sofas.lua ### + +No room to place the sofa!=没有地方放沙发! + +### sofas.lua ### + +Sofa=沙发 diff --git a/homedecor_seating/locale/template.txt b/homedecor_seating/locale/template.txt new file mode 100644 index 00000000..07705d29 --- /dev/null +++ b/homedecor_seating/locale/template.txt @@ -0,0 +1,24 @@ +# textdomain: homedecor_seating + + +### armchairs.lua ### + +Armchair= + +### init.lua ### + +Someone else owns the spot where the middle or far end goes!= +Someone else owns the spot where the other end goes!= + +### longsofas.lua ### + +Long Sofa= + +### longsofas.lua ### +### sofas.lua ### + +No room to place the sofa!= + +### sofas.lua ### + +Sofa= diff --git a/homedecor_seating/longsofas.lua b/homedecor_seating/longsofas.lua index b9ed4e96..d696b26a 100644 --- a/homedecor_seating/longsofas.lua +++ b/homedecor_seating/longsofas.lua @@ -1,5 +1,4 @@ - -local S = homedecor.gettext +local S = minetest.get_translator("homedecor_seating") local longsofa_cbox = { type = "wallmounted", @@ -23,7 +22,7 @@ minetest.register_node(":lrfurn:longsofa", { sounds = default.node_sound_wood_defaults(), selection_box = longsofa_cbox, node_box = longsofa_cbox, - on_rotate = screwdriver.disallow, + on_rotate = minetest.get_modpath("screwdriver") and screwdriver.disallow or nil, after_place_node = function(pos, placer, itemstack, pointed_thing) lrfurn.fix_sofa_rotation_nsew(pos, placer, itemstack, pointed_thing) local playername = placer:get_player_name() @@ -133,5 +132,5 @@ minetest.register_lbm({ }) if minetest.settings:get("log_mods") then - minetest.log("action", "[lrfurn/longsofas] "..S("Loaded!")) + minetest.log("action", "[lrfurn/longsofas] Loaded!") end diff --git a/homedecor_seating/misc.lua b/homedecor_seating/misc.lua index e34a6fac..57ddfc5b 100644 --- a/homedecor_seating/misc.lua +++ b/homedecor_seating/misc.lua @@ -15,7 +15,7 @@ homedecor.register("deckchair", { sounds = default.node_sound_wood_defaults(), selection_box = dc_cbox, collision_box = dc_cbox, - on_rotate = screwdriver.disallow + on_rotate = minetest.get_modpath("screwdriver") and screwdriver.disallow or nil, }) minetest.register_alias("homedecor:deckchair_foot", "homedecor:deckchair") @@ -30,7 +30,7 @@ homedecor.register("deckchair_striped_blue", { sounds = default.node_sound_wood_defaults(), selection_box = dc_cbox, collision_box = dc_cbox, - on_rotate = screwdriver.disallow + on_rotate = minetest.get_modpath("screwdriver") and screwdriver.disallow or nil, }) homedecor.register("simple_bench", { @@ -74,7 +74,7 @@ homedecor.register("bench_large_1", { sounds = default.node_sound_wood_defaults(), selection_box = bl1_sbox, node_box = bl1_cbox, - on_rotate = screwdriver.disallow + on_rotate = minetest.get_modpath("screwdriver") and screwdriver.disallow or nil, }) minetest.register_alias("homedecor:bench_large_1_left", "homedecor:bench_large_1") @@ -103,7 +103,7 @@ homedecor.register("bench_large_2", { node_box = bl2_cbox, expand = { right="placeholder" }, sounds = default.node_sound_wood_defaults(), - on_rotate = screwdriver.disallow + on_rotate = minetest.get_modpath("screwdriver") and screwdriver.disallow or nil, }) minetest.register_alias("homedecor:bench_large_2_left", "homedecor:bench_large_2") @@ -162,14 +162,6 @@ homedecor.register("kitchen_chair_padded", { end }) -local ac_cbox = { - type = "fixed", - fixed = { - {-0.5, -0.5, -0.5, 0.5, 0, 0.5 }, - {-0.5, -0.5, 0.4, 0.5, 0.5, 0.5 } - } -} - local ofchairs_sbox = { type = "fixed", fixed = { -8/16, -8/16, -8/16, 8/16, 29/32, 8/16 } @@ -201,7 +193,7 @@ for _, c in pairs(chairs) do selection_box = ofchairs_sbox, collision_box = ofchairs_cbox, expand = { top = "placeholder" }, - on_rotate = screwdriver.rotate_simple + on_rotate = minetest.get_modpath("screwdriver") and screwdriver.rotate_simple or nil, }) end diff --git a/homedecor_seating/mod.conf b/homedecor_seating/mod.conf new file mode 100644 index 00000000..8bf5957e --- /dev/null +++ b/homedecor_seating/mod.conf @@ -0,0 +1,4 @@ +name = homedecor_seating +description = Homedecor mod: seating +depends = default, wool, homedecor_common, unifieddyes, basic_materials +optional_depends = screwdriver diff --git a/homedecor_seating/sofas.lua b/homedecor_seating/sofas.lua index 94febb19..43b26cfd 100644 --- a/homedecor_seating/sofas.lua +++ b/homedecor_seating/sofas.lua @@ -1,5 +1,4 @@ - -local S = homedecor.gettext +local S = minetest.get_translator("homedecor_seating") local sofa_cbox = { type = "wallmounted", @@ -23,7 +22,7 @@ minetest.register_node(":lrfurn:sofa", { sounds = default.node_sound_wood_defaults(), selection_box = sofa_cbox, node_box = sofa_cbox, - on_rotate = screwdriver.disallow, + on_rotate = minetest.get_modpath("screwdriver") and screwdriver.disallow or nil, after_place_node = function(pos, placer, itemstack, pointed_thing) lrfurn.fix_sofa_rotation_nsew(pos, placer, itemstack, pointed_thing) local playername = placer:get_player_name() @@ -133,5 +132,5 @@ minetest.register_lbm({ }) if minetest.settings:get("log_mods") then - minetest.log("action", "[lrfurn/sofas] "..S("Loaded!")) + minetest.log("action", "[lrfurn/sofas] Loaded!") end