diff --git a/src/web/client.ts b/src/web/client.ts index 2ad50f2c2f..14bdfcc081 100644 --- a/src/web/client.ts +++ b/src/web/client.ts @@ -4126,10 +4126,13 @@ if (d.keepalive) kv(parts, t("det.keepalive"), d.keepalive.tierLabel + " · " + const baseSel = document.createElement("select"); baseSel.id = "pack-base-sel"; baseSel.className = "field-input"; - [["", "cfg.q_pack_base_blank"], ["default", "cfg.q_pack_base_default"], ["chat", "cfg.q_pack_base_chat"], ["lean", "cfg.q_pack_base_lean"]].forEach((pair) => { + // #5345 follow-up: keep labels as literal t("…") calls — the #1024 + // dead-key guard only counts string-literal arguments, so the old + // array + variable-lookup shape hid all four keys (CI red on master). + [["", t("cfg.q_pack_base_blank")], ["default", t("cfg.q_pack_base_default")], ["chat", t("cfg.q_pack_base_chat")], ["lean", t("cfg.q_pack_base_lean")]].forEach(([value, label]) => { const opt = document.createElement("option"); - opt.value = pair[0]; - opt.textContent = t(pair[1]); + opt.value = value; + opt.textContent = label; baseSel.appendChild(opt); }); const btnBaseLoad = document.createElement("button"); @@ -4148,14 +4151,14 @@ if (d.keepalive) kv(parts, t("det.keepalive"), d.keepalive.tierLabel + " · " + descIn.placeholder = t("cfg.q_pack_desc_ph"); descIn.style.cssText = "width:100%;box-sizing:border-box"; descWrap.append(descLab, descIn); - function packSectionField(labelKey, helpKey, rows) { + function packSectionField(label, helpText, rows) { const wrap = document.createElement("div"); wrap.style.cssText = "margin:8px 0"; const lab = document.createElement("div"); - lab.textContent = t(labelKey); + lab.textContent = label; lab.style.cssText = "font-size:13px;font-weight:600;margin-bottom:2px"; const help = document.createElement("div"); - help.textContent = t(helpKey); + help.textContent = helpText; help.style.cssText = "font-size:12px;color:#57606a;margin-bottom:4px"; const ta = document.createElement("textarea"); ta.className = "field-input mono"; @@ -4165,8 +4168,8 @@ if (d.keepalive) kv(parts, t("det.keepalive"), d.keepalive.tierLabel + " · " + wrap.append(lab, help, ta); return { wrap, ta }; } - const phF = packSectionField("cfg.q_pack_phil", "cfg.q_pack_phil_help", 5); - const hcF = packSectionField("cfg.q_pack_hc", "cfg.q_pack_hc_help", 8); + const phF = packSectionField(t("cfg.q_pack_phil"), t("cfg.q_pack_phil_help"), 5); + const hcF = packSectionField(t("cfg.q_pack_hc"), t("cfg.q_pack_hc_help"), 8); const taPh = phF.ta; const taHc = hcF.ta; const formHint = document.createElement("div"); diff --git a/src/web/i18n.ts b/src/web/i18n.ts index 8024e28b5a..078ff64c90 100644 --- a/src/web/i18n.ts +++ b/src/web/i18n.ts @@ -1353,7 +1353,7 @@ export const MESSAGES: Record> = { "cfg.q_pack_ai_apply_ok": "Parsed and filled into the form; the full JSON is synced to the Advanced (JSON) tab", "cfg.q_pack_ai_extra": "The model also returned advanced fields: {names} — kept in the Advanced (JSON) tab and saved with the pack", "cfg.q_pack_json_obj": "the pasted content must be a single JSON object", - "cfg.q_pack_ai_p1": "You are helping me customize a compression prompt pack for billion-context. My scenario and requirements:", + "cfg.q_pack_ai_p1": "You are helping me customize a compression prompt pack for billion-context. My scenario and requirements are as follows: {need}", "cfg.q_pack_ai_p2": "Write the JSON in bili-pack.json shape. Top-level object may contain: name (optional; lowercase letters/digits and ._- ; omit if unwanted), description (optional; one plain-sentence purpose), promptSections (object; at least one of): philosophy — the stance summaries take, what to keep first, what must never be lost; howToCompress — concrete summary-writing rules: structure, granularity, timeline requirements.", "cfg.q_pack_ai_p3": "Rules: 1. Content must fit my concrete scenario — no generic filler; 2. The readers of both sections are the AI model itself — clear imperative bullet-style sentences; 3. If a section adds no value for my scenario, OMIT that key entirely (omitted = system defaults stay) instead of writing an empty string; 4. Output ONLY one JSON object — no markdown fences, no comments, no prose.", "cfg.q_pck": "prompt_cache_key self-stamping (promptCache.routing)",