From 29c6c409e07f898af358c0292b1f8b1208852c7a Mon Sep 17 00:00:00 2001 From: Calic Date: Thu, 11 Jun 2026 07:54:53 +0200 Subject: [PATCH] fix(launcher): route dep-status glyphs through t() indirection The status_glyph helper in detail.lua returned 'OK'/'WARN'/'ERR'/'?' literals - user-visible UI text that the Mid-Gate-B grep missed because the pattern required a lowercase suffix. Now lives in strings.lua alongside the other UI keys, so v2 localization-lib will pick it up without touching detail.lua. --- panels/detail.lua | 14 +++++++------- strings.lua | 5 +++++ 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/panels/detail.lua b/panels/detail.lua index b6a6501..5012ca2 100644 --- a/panels/detail.lua +++ b/panels/detail.lua @@ -18,11 +18,11 @@ local function ensure_md(launcher_dir) if not md then md = dofile(launcher_dir .. "/markdown.lua") end end -local function status_glyph(dep_status) - if dep_status == "ok" then return "OK", COLOR_OK end - if dep_status == "warn" then return "WARN", COLOR_WARN end - if dep_status == "error" then return "ERR", COLOR_ERR end - return "?", COLOR_DIM +local function status_glyph(ctx, dep_status) + if dep_status == "ok" then return ctx.t("dep_glyph_ok"), COLOR_OK end + if dep_status == "warn" then return ctx.t("dep_glyph_warn"), COLOR_WARN end + if dep_status == "error" then return ctx.t("dep_glyph_err"), COLOR_ERR end + return ctx.t("dep_glyph_unknown"), COLOR_DIM end local function find_entry(ctx, id) @@ -97,9 +97,9 @@ function M.render(ctx) cur_y = cur_y + 24 if r and r.deps then - local GUTTER_W = 48 -- room for "WARN" + breathing space + local GUTTER_W = 48 -- room for dep_glyph_warn + breathing space for _, d in ipairs(r.deps) do - local glyph, col = status_glyph(d.status) + local glyph, col = status_glyph(ctx, d.status) local gw, _ = engine.render.measure_text(glyph, FONT_DEP) engine.render.draw_text(glyph, p.x + PADDING + GUTTER_W - gw, -- right-align in gutter diff --git a/strings.lua b/strings.lua index 98c36b0..74f9e0e 100644 --- a/strings.lua +++ b/strings.lua @@ -3,6 +3,11 @@ return { empty_hint = "Select a module to see details.", -- Detail panel sections dependencies = "Dependencies", + -- Dependency status glyphs + dep_glyph_ok = "OK", + dep_glyph_warn = "WARN", + dep_glyph_err = "ERR", + dep_glyph_unknown = "?", -- Launch flow launch_module = "Launch Module", cancel = "Cancel",