/* ============================================================
   Lineage UI kit — locale packs (chrome only)
   Adding a language = adding one of these. The corpus
   (system prompts, tool names/descriptions, schemas) is NEVER
   here — it renders verbatim in every locale.
   ============================================================ */

const LOCALES = {
  en: {
    tagline: "How the Claude Code request evolved",
    intro: "A read-only archive of the exact request the Claude Code CLI sends to the Messages API — version by version. Read the system prompt, expand every tool, and diff any two releases.",
    timeline: "Timeline",
    overview: "Overview",
    versionsCaptured: (ok, total) => `${ok} of ${total} versions captured`,
    footerTagline: (n) => `Static teaching archive · ${n} versions · served from CDN`,
    footerTaglineOffline: (n, built) => `Offline archive · built ${built} · ${n} versions`,
    whatChanged: "What changed",
    gapNote: (n, from, to) => `${n} auxiliary version${n===1?"":"s"} hidden (${from}–${to})`,
    jumpToDiff: "See diff",
    compare: "Compare",
    compareVersions: "Compare versions",
    search: "Search",
    searchPlaceholder: "Search system prompts and tools…",
    captureBanner: "Every request here is captured via `claude -p` — non-interactive print mode. An interactive session can send a different request.",
    systemPrompt: "System prompt",
    tools: "Tools",
    metadata: "Metadata",
    request: "Request",
    params: "Params",
    requestGroup: "Request",
    responseGroup: "Response",
    dlRequest: "Request JSON",
    dlResponse: "Response JSON",
    metadataLabel: "metadata.user_id",
    masked: "masked",
    response: "Response",
    changelog: "Changelog",
    changelogLabels: {
      added: "added", fixed: "fixed", improved: "improved", changed: "changed", other: "notes",
      missing: "No changelog entry for this version",
      missingBody: "The official changelog has no entry for this release number. The capture is unaffected.",
      source: "Quoted verbatim from",
      verbatimNote: null,
      wordFirst: false,
      mtTab: "Translated", mtOriginal: "Original",
      mtNote: null, mtPartial: null,
    },
    clShowAll: (n) => `Show all ${n} versions`,
    noUsage: "No usage captured",
    reply: "Reply",
    noReply: "No reply captured",
    model: "Model",
    httpStatus: "HTTP status",
    regime: "Regime",
    headers: "Request headers",
    block: "block",
    noCapture: "No capture for this version",
    noCaptureBody: "This release timed out before sending a request. It stays on the timeline for completeness.",
    backToTimeline: "Back to timeline",
    backToCompare: "Back to compare",
    nextVersion: "Next version",
    prevVersion: "Previous version",
    systemChars: "system chars",
    toolsCount: "tools",
    mainInference: "main inference",
    auxiliary: "auxiliary",
    mcpNotConnected: { label: "MCP not connected", tip: "MCP hadn't finished connecting when this version was captured, so mcp__example__echo isn't in the request — a capture-time state, not a removal in this version." },
    captureGap: "Captured {n} day(s) apart ({from} → {to}) — some differences may be server-side, not version changes",
    from: "From",
    to: "To",
    systemDiff: "System prompt diff",
    bySection: "By section",
    unified: "Unified",
    sections: "sections",
    unchangedLabel: "unchanged",
    preamble: "(preamble)",
    toolChanges: "Tool changes",
    added: "added",
    removed: "removed",
    modifiedLabel: "modified",
    changed: "changed",
    betaChanges: "Beta & param changes",
    absent: "absent",
    betaFeatures: "Beta features",
    messages: "Messages",
    maxTokens: "Max tokens",
    requestBody: "Request body",
    temperature: "Temperature",
    stream: "Stream",
    contextManagement: "Context management",
    responseUsage: "Response usage",
    noBetas: "No beta features declared",
    noDiffChange: "No payload changes between these versions.",
    unchanged: (n) => `${n} unchanged ${n === 1 ? "line" : "lines"}`,
    cantCompare: "One of these versions has no capture.",
    copy: "Copy",
    results: (n) => `${n} ${n === 1 ? "result" : "results"}`,
    inSystem: "in system prompt",
    inTools: "in tools",
    noResults: "No matches in the corpus.",
    searchHint: "Searches the verbatim corpus — system prompts and tool names/descriptions across all captured versions.",
    themeLight: "Light",
    themeDark: "Dark",
    code: { copy: "copy", copied: "copied", collapse: "Collapse", expand: "Show full block" },
    anatomy: {
      nav: "Anatomy",
      title: "Anatomy of the request",
      lead: "Every version sends a single POST to the Messages API. Here is how that request body is assembled — and where each part surfaces in Lineage.",
      skeletonNote: "The shape of the JSON body (illustrative):",
      parts: [
        { name:"system[]", what:"The system prompt — top-level instructions that define the agent: role, tone, tool policy, safety rules. An array of independently cacheable text blocks, sent separately from the conversation.", where:"System prompt tab" },
        { name:"messages[]", what:"The conversation turns: the test probe (“Reply with the single word: ping”) plus the harness-injected context — CLAUDE.md, memory, available skills, deferred tools, and session hooks. In this demo corpus they render verbatim.", where:"Messages tab" },
        { name:"tools[]", what:"The tool definitions the model may call — each a name, a description, and a JSON-Schema input_schema. This is where Skill, MCP, Workflow, ToolSearch, and the rest live.", where:"Tools tab" },
        { name:"parameters", what:"Scalars and configs: model, max_tokens, temperature, stream, output_config.effort, diagnostics, metadata.user_id (shown masked), the Anthropic-Beta feature set, and structured context_management.", where:"Params tab" },
        { name:"response", what:"The model’s streamed reply (here, “ping”) with its stop_reason, plus usage — cache-read / creation tokens, service tier, inference geo.", where:"Response tab" },
      ],
      captureNote: "Capture method: every request here comes from `claude -p` — the non-interactive print mode — so it shows what `-p` sends, not what an interactive `claude` session sends. The two can differ: from 2.1.187 the `-p` request drops the interactive tools `AskUserQuestion`, `EnterPlanMode`, and `ExitPlanMode`, which still appear in an interactive session.",
    },
    delta: { tool:"tool", tools:"tools", modified:"modified", chars:"chars", beta:"beta", betas:"betas", maxTokens:"max_tokens", modelChanged:"model changed", noChange:"No payload change", first:"First captured version", context:"context", systemBlocks:"system blocks",
      reminderNames:{ "claude-md":"CLAUDE.md", "auto-memory":"memory", "user-email":"user email", "current-date":"date", "git-status":"git status", "directory-structure":"dir tree", "session-start-hook":"session hook", "available-skills":"skills", "deferred-tools":"deferred tools", "instruction-reminders":"instruction reminder", "ultracode-status":"ultracode", "other":"reminder" } },
    msgStructure: "Message structure",
    captures: "Captures",
    downloadCapture: "Download capture (JSON)",
    captureNoise: "Capture note",
    defaultCapture: "default",
    pinnedCapture: "pinned model",
    modelAxis: "Model-axis differences",
    seeFullDiff: "Full diff",
    modelAxisVs: "vs",
    modelAxisIdentical: "Identical",
    injectedContext: "Injected context",
    injectedChanges: "Injected-context changes",
    changeIndex: "Changes",
    collapse: "Collapse",
    injectedBody: "Injected body diff",
    injectedBodyNote: "environment capture · demo project",
    reminderKinds: "Reminder kinds",
    blocks: "blocks",
    cacheBreaks: "cache breaks",
    probe: "probe",
    noInjected: "No injected context — bare prompt",
    reminderEntered: "first appears in",
  },
  zh: {
    tagline: "Claude Code 请求的演变",
    intro: "一个只读存档，记录 Claude Code CLI 向 Messages API 发送的确切请求 —— 逐版本呈现。阅读系统提示、展开每个工具，并对比任意两个版本。",
    timeline: "时间线",
    overview: "概览",
    versionsCaptured: (ok, total) => `已捕获 ${total} 个版本中的 ${ok} 个`,
    footerTagline: (n) => `静态教学存档 · ${n} 个版本 · CDN 直出`,
    footerTaglineOffline: (n, built) => `离线存档 · 构建于 ${built} · ${n} 个版本`,
    whatChanged: "变更内容",
    gapNote: (n, from, to) => `隐藏 ${n} 个辅助版本 (${from}–${to})`,
    jumpToDiff: "查看差异",
    compare: "对比",
    compareVersions: "对比版本",
    search: "搜索",
    searchPlaceholder: "搜索系统提示与工具…",
    captureBanner: "本站每条请求均经 `claude -p` 采集 —— 非交互打印模式。交互式会话发出的请求可能不同。",
    systemPrompt: "系统提示",
    tools: "工具",
    metadata: "元数据",
    request: "请求",
    params: "参数",
    requestGroup: "请求",
    responseGroup: "响应",
    dlRequest: "请求 JSON",
    dlResponse: "响应 JSON",
    metadataLabel: "metadata.user_id",
    masked: "已脱敏",
    response: "响应",
    changelog: "更新日志",
    changelogLabels: {
      added: "新增", fixed: "修复", improved: "改进", changed: "变更", other: "其他",
      missing: "官方日志暂无此版本条目",
      missingBody: "官方 changelog 没有该版本号的条目。捕获数据不受影响。",
      source: "逐字引自",
      verbatimNote: "英文原文，逐字呈现；分类摘要由构建生成。",
      wordFirst: true,
      mtTab: "译文", mtOriginal: "原文",
      mtNote: "译文在构建期生成并经校对；以英文原文为准。",
      mtPartial: "部分条目暂无译文，已显示英文原文。",
    },
    clShowAll: (n) => `展开全部 ${n} 个版本`,
    noUsage: "未捕获用量",
    reply: "回复",
    noReply: "未捕获回复",
    model: "模型",
    httpStatus: "HTTP 状态",
    regime: "运行机制",
    headers: "请求头",
    block: "块",
    noCapture: "此版本无捕获",
    noCaptureBody: "该版本在发送请求前超时。为完整起见，它仍保留在时间线上。",
    backToTimeline: "返回时间线",
    backToCompare: "返回对比",
    nextVersion: "下一个版本",
    prevVersion: "上一个版本",
    systemChars: "系统字符",
    toolsCount: "工具",
    mainInference: "主推理",
    auxiliary: "辅助",
    mcpNotConnected: { label: "MCP 未连接", tip: "抓取这一版时 MCP 还没连上，mcp__example__echo 因此没出现在请求里——是采集当时的状态，不是该版本移除了 MCP。" },
    captureGap: "两侧采集相隔 {n} 天（{from} → {to}），部分差异可能来自服务端改动、非版本变更",
    from: "起始",
    to: "目标",
    systemDiff: "系统提示差异",
    bySection: "按区块",
    unified: "统一",
    sections: "个区块",
    unchangedLabel: "未变",
    preamble: "（前言）",
    toolChanges: "工具变更",
    added: "新增",
    removed: "移除",
    modifiedLabel: "修改",
    changed: "变更字段",
    betaChanges: "Beta 与参数变更",
    absent: "无",
    betaFeatures: "Beta 特性",
    messages: "消息",
    maxTokens: "最大 token 数",
    requestBody: "请求体",
    temperature: "温度 (temperature)",
    stream: "流式 (stream)",
    contextManagement: "上下文管理",
    responseUsage: "响应用量 (usage)",
    noBetas: "未声明 Beta 特性",
    noDiffChange: "这两个版本之间载荷无变化。",
    unchanged: (n) => `${n} 行未变更`,
    cantCompare: "其中一个版本无捕获。",
    copy: "复制",
    results: (n) => `${n} 条结果`,
    inSystem: "系统提示中",
    inTools: "工具中",
    noResults: "语料中无匹配项。",
    searchHint: "搜索逐字语料 —— 覆盖所有已捕获版本的系统提示与工具名称/描述。",
    themeLight: "浅色",
    themeDark: "深色",
    code: { copy: "复制", copied: "已复制", collapse: "收起", expand: "展开全文" },
    anatomy: {
      nav: "结构",
      title: "请求结构解析",
      lead: "每个版本都向 Messages API 发送一个 POST 请求。这里拆解请求体是怎么拼起来的 —— 以及每一部分在 Lineage 的哪里展示。",
      skeletonNote: "JSON 请求体的形状（示意）：",
      parts: [
        { name:"system[]", what:"系统提示 —— 定义 agent 的顶层指令：角色、语气、工具策略、安全规则。是一个可独立缓存的文本块数组，与对话分开发送。", where:"System prompt 标签" },
        { name:"messages[]", what:"对话轮次：测试探针（“Reply with the single word: ping”）加上 harness 注入的上下文 —— CLAUDE.md、记忆、可用技能、延迟工具、会话钩子。在本 demo 语料中逐字呈现。", where:"Messages 标签" },
        { name:"tools[]", what:"模型可调用的工具定义 —— 每个包含 name、description 和 JSON-Schema input_schema。Skill、MCP、Workflow、ToolSearch 等都在这里。", where:"Tools 标签" },
        { name:"parameters", what:"标量与配置：model、max_tokens、temperature、stream、output_config.effort、diagnostics、metadata.user_id（脱敏展示）、Anthropic-Beta 特性集，以及结构化的 context_management。", where:"Params 标签" },
        { name:"response", what:"模型的流式回复（这里是 “ping”）及其 stop_reason，加上 usage —— 缓存读取 / 创建 token、service tier、推理区域。", where:"Response 标签" },
      ],
      captureNote: "采集方式：本站每条请求都来自 `claude -p` —— 非交互打印模式 —— 所以呈现的是 `-p` 发出的请求，而非交互式 `claude` 会话发出的。两者可能不同：从 2.1.187 起，`-p` 请求去掉了交互工具 `AskUserQuestion`、`EnterPlanMode`、`ExitPlanMode`，它们在交互式会话里仍然存在。",
    },
    delta: { tool:"个工具", tools:"个工具", modified:"个修改", chars:"字符", beta:"个 beta", betas:"个 beta", maxTokens:"最大 token", modelChanged:"模型已更改", noChange:"载荷无变化", first:"首个捕获版本", context:"上下文", systemBlocks:"system 块",
      reminderNames:{ "claude-md":"CLAUDE.md", "auto-memory":"记忆", "user-email":"用户邮箱", "current-date":"日期", "git-status":"git 状态", "directory-structure":"目录树", "session-start-hook":"会话钩子", "available-skills":"技能", "deferred-tools":"延迟工具", "instruction-reminders":"指令提醒", "ultracode-status":"ultracode", "other":"提醒" } },
    msgStructure: "消息结构",
    captures: "捕获",
    downloadCapture: "下载捕获 (JSON)",
    captureNoise: "捕获说明",
    defaultCapture: "默认",
    pinnedCapture: "钉定模型",
    modelAxis: "模型轴差异",
    seeFullDiff: "完整 diff",
    modelAxisVs: "对比",
    modelAxisIdentical: "完全一致",
    injectedContext: "注入上下文",
    injectedChanges: "注入上下文变更",
    changeIndex: "变更索引",
    collapse: "收起",
    injectedBody: "注入正文差异",
    injectedBodyNote: "采集环境 · 示例项目",
    reminderKinds: "提醒类型",
    blocks: "块",
    cacheBreaks: "缓存断点",
    probe: "探针",
    noInjected: "无注入上下文 —— 裸提示",
    reminderEntered: "首次出现于",
  },
};

window.LINEAGE_LOCALES = LOCALES;
