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
|
if not md then md = dofile(launcher_dir .. "/markdown.lua") end
|
||||||
end
|
end
|
||||||
|
|
||||||
local function status_glyph(dep_status)
|
local function status_glyph(ctx, dep_status)
|
||||||
if dep_status == "ok" then return "OK", COLOR_OK end
|
if dep_status == "ok" then return ctx.t("dep_glyph_ok"), COLOR_OK end
|
||||||
if dep_status == "warn" then return "WARN", COLOR_WARN end
|
if dep_status == "warn" then return ctx.t("dep_glyph_warn"), COLOR_WARN end
|
||||||
if dep_status == "error" then return "ERR", COLOR_ERR end
|
if dep_status == "error" then return ctx.t("dep_glyph_err"), COLOR_ERR end
|
||||||
return "?", COLOR_DIM
|
return ctx.t("dep_glyph_unknown"), COLOR_DIM
|
||||||
end
|
end
|
||||||
|
|
||||||
local function find_entry(ctx, id)
|
local function find_entry(ctx, id)
|
||||||
@@ -97,9 +97,9 @@ function M.render(ctx)
|
|||||||
cur_y = cur_y + 24
|
cur_y = cur_y + 24
|
||||||
|
|
||||||
if r and r.deps then
|
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
|
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)
|
local gw, _ = engine.render.measure_text(glyph, FONT_DEP)
|
||||||
engine.render.draw_text(glyph,
|
engine.render.draw_text(glyph,
|
||||||
p.x + PADDING + GUTTER_W - gw, -- right-align in gutter
|
p.x + PADDING + GUTTER_W - gw, -- right-align in gutter
|
||||||
|
|||||||
@@ -3,6 +3,11 @@ return {
|
|||||||
empty_hint = "Select a module to see details.",
|
empty_hint = "Select a module to see details.",
|
||||||
-- Detail panel sections
|
-- Detail panel sections
|
||||||
dependencies = "Dependencies",
|
dependencies = "Dependencies",
|
||||||
|
-- Dependency status glyphs
|
||||||
|
dep_glyph_ok = "OK",
|
||||||
|
dep_glyph_warn = "WARN",
|
||||||
|
dep_glyph_err = "ERR",
|
||||||
|
dep_glyph_unknown = "?",
|
||||||
-- Launch flow
|
-- Launch flow
|
||||||
launch_module = "Launch Module",
|
launch_module = "Launch Module",
|
||||||
cancel = "Cancel",
|
cancel = "Cancel",
|
||||||
|
|||||||
Reference in New Issue
Block a user