From 341eead963c03bdb33a2429e31638f868be0e2c8 Mon Sep 17 00:00:00 2001 From: Jaidyn Ann <10477760+JadedCtrl@users.noreply.github.com> Date: Thu, 1 Aug 2024 10:19:22 -0500 Subject: [PATCH] Make sorting-method names translatable --- i4/locale/template.txt | 2 ++ i4/src/api.lua | 2 ++ i4/src/gui.lua | 2 +- 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/i4/locale/template.txt b/i4/locale/template.txt index a6ba599..77a2469 100644 --- a/i4/locale/template.txt +++ b/i4/locale/template.txt @@ -6,7 +6,9 @@ Settings= Go home= Digging= Digging (by chance)= +Alphabetical= Sort items by name (A-Z)= +Numerical= Sort items by number of items per stack= All= Nodes= diff --git a/i4/src/api.lua b/i4/src/api.lua index 281e609..b7f313c 100644 --- a/i4/src/api.lua +++ b/i4/src/api.lua @@ -446,6 +446,7 @@ function i4.add_sorting_method(name, def) insert(i4.sorting_methods, def) end +-- S("Alphabetical") i4.add_sorting_method("alphabetical", { description = S("Sort items by name (A-Z)"), func = function(list, data) @@ -454,6 +455,7 @@ i4.add_sorting_method("alphabetical", { end }) +-- S("Numerical") i4.add_sorting_method("numerical", { description = S("Sort items by number of items per stack"), func = function(list, data) diff --git a/i4/src/gui.lua b/i4/src/gui.lua index 33c3558..8cab1bd 100644 --- a/i4/src/gui.lua +++ b/i4/src/gui.lua @@ -674,7 +674,7 @@ local function settings_footer_fs(player, data, fs) local desc = i4.sorting_methods[data.sort].description if desc then - tooltip(5.3, 10.6, 2.4, 0.5, ESC(desc)) + tooltip(5.3, 10.6, 2.4, 0.5, S(desc)) end fs("tooltip[cb_inv_compress;%s;#32333899;#fff]",