From 9231cfa4fbc9c5d897cac34568a202632c59cc93 Mon Sep 17 00:00:00 2001 From: Jaidyn Ann <10477760+JadedCtrl@users.noreply.github.com> Date: Thu, 1 Aug 2024 14:56:00 -0500 Subject: [PATCH] Make tab-buttons translatable MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit That is, "Crafting”, “Armor”, etc. --- i4/init.lua | 3 +++ i4/locale/template.txt | 5 +++++ i4/src/gui.lua | 3 ++- 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/i4/init.lua b/i4/init.lua index d7378bc..741b54e 100644 --- a/i4/init.lua +++ b/i4/init.lua @@ -30,6 +30,9 @@ i4 = { inventory_size = tonumber(core.settings:get"i4_inventory_size") or (storage:get_int"imported_from_i3" and 36), }, + -- S("Crafting"); S("Armor") + -- S("Waypoints"); S("Skins") + -- S("Bag") categories = { "crafting", "armor", diff --git a/i4/locale/template.txt b/i4/locale/template.txt index a6ba599..5124bfe 100644 --- a/i4/locale/template.txt +++ b/i4/locale/template.txt @@ -1,4 +1,9 @@ # textdomain: i4 +Crafting= +Armor= +Waypoints= +Skins= +Bag= Inventory= Clear inventory= Sort inventory= diff --git a/i4/src/gui.lua b/i4/src/gui.lua index 33c3558..6fa9764 100644 --- a/i4/src/gui.lua +++ b/i4/src/gui.lua @@ -528,11 +528,12 @@ local function get_container(fs, data, player, yoffset, ctn_len, award_list, awa for i, title in ipairs(i4.categories) do local btn_name = fmt("btn_%s", title) + local caps_title = title:gsub("^%l", upper) fs("style[btn_%s;fgimg=%s;fgimg_hovered=%s;content_offset=0]", title, data.subcat == i and PNG[fmt("%s_hover", title)] or PNG[title], PNG[fmt("%s_hover", title)]) image_button(0.25 + ((i - 1) * 1.18), yextra - 0.2, 0.5, 0.5, "", btn_name, "") - fs("tooltip[%s;%s;#32333899;#fff]", btn_name, title:gsub("^%l", upper)) + fs("tooltip[%s;%s;#32333899;#fff]", btn_name, S(caps_title)) end box(0, yextra + 0.45, ctn_len, 0.045, "#bababa50")