diff --git a/gui_plain.lua b/gui_plain.lua index 5ba905e..835beac 100644 --- a/gui_plain.lua +++ b/gui_plain.lua @@ -1,12 +1,15 @@ +local S = upgrade_packs.translator + minetest.register_chatcommand("upgrade_packs", { - description = "Allows inserting upgrade packs without CSM", + description = S("Allows using upgrade packs without CSM"), func = function(name, param) - minetest.show_formspec(name, "upgrade_packs:gui_plain", - "size[8,7]" .. - "label[3,0;Upgrade Packs]" .. - "list[current_player;ugpacks;2,1;4,1;]" .. - "list[current_player;main;0,3;8,4;]" .. - "listring[]" + minetest.show_formspec(name, "upgrade_packs:gui_plain", ([[ + size[8,7] + label[3,0;%s] + list[current_player;ugpacks;2,1;4,1;] + list[current_player;main;0,3;8,4;] + listring[] + ]]):format(S("Upgrade Packs")) ) end }) \ No newline at end of file diff --git a/gui_sfinv.lua b/gui_sfinv.lua index 2d560d3..970e73d 100644 --- a/gui_sfinv.lua +++ b/gui_sfinv.lua @@ -1,12 +1,14 @@ +local S = upgrade_packs.translator + sfinv.register_page("upgrade_packs:ugpacks", { - title = "Upgrade Packs", + title = S("Upgrade Packs"), get = function(self, player, context) local name = player:get_player_name() - return sfinv.make_formspec(player, context, - "label[3,0.7;Upgrade Packs]" .. - "list[current_player;ugpacks;3,1.5;2,2;]" .. - "listring[current_player;main]" .. - "listring[current_player;ugpacks]" - , true) + return sfinv.make_formspec(player, context, ([[ + label[3,0.7;%s] + list[current_player;ugpacks;3,1.5;2,2;] + listring[current_player;main]" + listring[current_player;ugpacks] + ]]):format(S("Upgrade Packs")), true) end }) \ No newline at end of file diff --git a/gui_unified_inventory.lua b/gui_unified_inventory.lua index 8afcd50..945bc91 100644 --- a/gui_unified_inventory.lua +++ b/gui_unified_inventory.lua @@ -1,7 +1,9 @@ +local S = upgrade_packs.translator + unified_inventory.register_button("ugpacks", { type = "image", image = "heart.png", - tooltip = "Upgrade Packs" + tooltip = S("Upgrade Packs") }) unified_inventory.register_page("ugpacks", { @@ -11,7 +13,7 @@ unified_inventory.register_page("ugpacks", { return { formspec = ( "no_prepend[]" .. "listcolors[#888;#AAA;#111]" .. - "label[3," .. (y - 0.1) .. ";Upgrade Packs]" .. + "label[3," .. (y - 0.1) .. ";" .. S("Upgrade Packs") .. "]" .. "list[current_player;ugpacks;3," .. (y + 0.7) .. ";2,2;]" .. "list[current_player;main;0," .. (y + 3.5) .. ";8,4;]" .. "listring[]" diff --git a/init.lua b/init.lua index 45f2811..920494b 100644 --- a/init.lua +++ b/init.lua @@ -5,6 +5,7 @@ end upgrade_packs = {} upgrade_packs.health_items = {} upgrade_packs.breath_items = {} +upgrade_packs.translator = minetest.get_translator("upgrade_packs") local modpath = minetest.get_modpath("upgrade_packs") diff --git a/locale/template.txt b/locale/template.txt new file mode 100644 index 0000000..5b25d9c --- /dev/null +++ b/locale/template.txt @@ -0,0 +1,6 @@ +# textdomain: upgrade_packs + ++10 HP = ++5 Breath = +Allows inserting upgrade packs without CSM = +Upgrade Packs = diff --git a/locale/upgrade_packs.de.tr b/locale/upgrade_packs.de.tr new file mode 100644 index 0000000..01bc385 --- /dev/null +++ b/locale/upgrade_packs.de.tr @@ -0,0 +1,6 @@ +# textdomain: upgrade_packs + ++10 HP=+10 Lebenspunkte ++5 Breath=+5 Atem +Allows using upgrade packs without CSM=Ermöglicht die Nutzung von Upgrade-Paketen ohne CSM +Upgrade Packs=Upgrade-Pakete diff --git a/packs.lua b/packs.lua index 1543b71..a2f2704 100644 --- a/packs.lua +++ b/packs.lua @@ -1,22 +1,25 @@ +local S = upgrade_packs.translator + upgrade_packs.register_pack("upgrade_packs:hp_10", "health", { - description = "+10 HP", + description = S("+10 HP"), strength = 10, image = "heart.png" }) +local mc = "default:mese_crystal" local gb = "vessels:glass_bottle" local ci = "default:copper_ingot" minetest.register_craft({ output = "upgrade_packs:hp_10", recipe = { - {ci, gb, ci}, - {gb, "", gb}, - {ci, gb, ci} + {ci, mc, ci}, + {mc, gb, mc}, + {ci, mc, ci} } }) upgrade_packs.register_pack("upgrade_packs:breath_5", "breath", { - description = "+5 Breath", + description = S("+5 Breath"), strength = 5, image = "bubble.png" }) @@ -26,9 +29,9 @@ local ti = "default:tin_ingot" minetest.register_craft({ output = "upgrade_packs:breath_5", recipe = { - {ti, sb, ti}, - {sb, "", sb}, - {ti, sb, ti} + {ti, mc, ti}, + {mc, sb, mc}, + {ti, mc, ti} } })