Make tab-buttons translatable

That is, "Crafting”, “Armor”, etc.
This commit is contained in:
Jaidyn Ann 2024-08-01 14:56:00 -05:00
parent 1a2e15fa75
commit 9231cfa4fb
3 changed files with 10 additions and 1 deletions

View File

@ -30,6 +30,9 @@ i4 = {
inventory_size = tonumber(core.settings:get"i4_inventory_size") or (storage:get_int"imported_from_i3" and 36), 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 = { categories = {
"crafting", "crafting",
"armor", "armor",

View File

@ -1,4 +1,9 @@
# textdomain: i4 # textdomain: i4
Crafting=
Armor=
Waypoints=
Skins=
Bag=
Inventory= Inventory=
Clear inventory= Clear inventory=
Sort inventory= Sort inventory=

View File

@ -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 for i, title in ipairs(i4.categories) do
local btn_name = fmt("btn_%s", title) 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, 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], data.subcat == i and PNG[fmt("%s_hover", title)] or PNG[title],
PNG[fmt("%s_hover", title)]) PNG[fmt("%s_hover", title)])
image_button(0.25 + ((i - 1) * 1.18), yextra - 0.2, 0.5, 0.5, "", btn_name, "") 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 end
box(0, yextra + 0.45, ctn_len, 0.045, "#bababa50") box(0, yextra + 0.45, ctn_len, 0.045, "#bababa50")