feat(launcher): route all UI strings through t(key) indirection
strings.lua holds English defaults. ctx.t(key, ...) looks up the key, optionally string.formats with extra args, and falls back to '[key]' for missing entries. All panels and init.lua sweep clean of inline literals — verified by a grep over '"[A-Z][a-z][a-z ]+"'. This sets up v2's localization-lib-pattern (separate slice, ADR-0036 trigger) to swap STRINGS without touching the launcher code.
This commit is contained in:
@@ -142,7 +142,7 @@ function M.handle_click(ctx, mx, my)
|
||||
end
|
||||
|
||||
-- L.7: Launch button → either switch directly (clean deps) or open
|
||||
-- the conflict modal (warn/error deps). The "Launch anyway" path
|
||||
-- the conflict modal (warn/error deps). The launch-anyway path
|
||||
-- requires engine.module.switch_module_supports_fallback (separate
|
||||
-- engine slice); until that ships the button stays disabled.
|
||||
if ctx._launch_btn and engine.spatial.aabb_contains_point(ctx._launch_btn, mx, my) then
|
||||
|
||||
@@ -43,7 +43,8 @@ function M.render(ctx)
|
||||
}
|
||||
local col = (ctx.selected_entry == "news") and COLOR_ROW_ACTIVE or COLOR_ROW
|
||||
engine.render.draw_rect(rect.x, rect.y, rect.w, rect.h, col)
|
||||
engine.render.draw_text(ctx.news_entry.title or "News",
|
||||
engine.render.draw_text(
|
||||
ctx.news_entry.title or ctx.t("news_default_title"),
|
||||
rect.x + PADDING, rect.y + PADDING, FONT, COLOR_TEXT)
|
||||
ctx.news_entry.rect = rect
|
||||
end
|
||||
|
||||
@@ -10,9 +10,9 @@ local FONT_BTN = 18
|
||||
local PADDING = 18
|
||||
|
||||
-- def = {
|
||||
-- title = "Confirm",
|
||||
-- body = "text or array of lines",
|
||||
-- buttons = { { id="cancel", label="Cancel" }, { id="ok", label="Launch anyway", disabled=false } },
|
||||
-- title = <localized-title-string>,
|
||||
-- body = <line-or-array-of-localized-lines>,
|
||||
-- buttons = { { id=<key>, label=<localized-label>, disabled=<bool> }, ... },
|
||||
-- }
|
||||
function M.render(def, screen_w, screen_h)
|
||||
-- Backdrop.
|
||||
|
||||
Reference in New Issue
Block a user