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.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user