export type Language = "zh" | "en";

export const LANGUAGES: Language[] = ["zh", "en"];

const zh = {
  meta: { langLabel: "中文", switchTo: "English" },
  nav: {
    home: "首页",
    features: "能力",
    studio: "Studio",
    experts: "专家库",
    sponsors: "赞助商",
    docs: "文档",
    tutorials: "教程",
    changelog: "更新日志",
    star: "Star",
    github: "GitHub",
  },
  hero: {
    badge: "开源 · 多智能体工作流编排器",
    title: "一句话，让 agency-agents 的专家",
    titleHighlight: "自动组队协作",
    subtitle:
      "描述需求 → AI 自动拆解任务 → 从 216 位专家中选角 → 按 DAG 并行执行 → 几分钟出一份完整方案。专家来自开源库 agency-agents，AO 负责把他们编排成一支团队。",
    ctaDownload: "下载客户端",
    ctaPrimary: "在 GitHub 上查看",
    ctaSecondary: "看赞助商权益",
    installHint: "一行命令开始：",
    copy: "复制",
    copied: "已复制",
    stats: [
      { value: "216", label: "agency-agents 专家" },
      { value: "10", label: "种大模型" },
      { value: "DAG", label: "自动并行编排" },
      { value: "YAML", label: "零代码定义" },
    ],
  },
  oneLiner: {
    title: "一句话出结果",
    desc: "最快的用法不是写 YAML，而是 compose——一句话，AI 帮你把整条工作流配好并直接跑。",
    prompt: "程序员想用 AI 做副业，月入 2 万，做完整规划",
    meta: "工作流: 自动编排 · 步骤数 {n} · 模型 deepseek-chat",
    done: "完成 · 产物已保存到 ao-output/",
    roles: ["🔭 趋势研究员", "📱 平台分析师", "💰 财务规划师", "✍️ 内容策略师", "📋 执行规划师"],
    steps: [
      { emoji: "🔭", name: "趋势研究员", time: "31.3s", out: "6 个赛道竞争度 / 变现天花板 / AI 提效倍数对比" },
      { emoji: "📱", name: "平台分析师", time: "32.0s", out: "6 大平台三维评分，推荐「小红书 + 公众号」组合" },
      { emoji: "💰", name: "财务规划师", time: "31.8s", out: "月入 2 万拆解：课程 + 社群 + 咨询" },
      { emoji: "✍️", name: "内容策略师", time: "30.5s", out: "30 天选题日历 + 3 条爆款脚本模板" },
      { emoji: "📋", name: "执行规划师", time: "29.7s", out: "12 周落地路线图，每周可量化目标" },
    ],
  },
  features: {
    title: "为什么是多智能体，而不是一句 prompt",
    subtitle: "我们用盲评质量评测验证过：在够强又不贵的模型档位上，多专家分工的产出明显优于单次 prompt。",
    items: [
      {
        icon: "workflow",
        title: "DAG 自动并行",
        desc: "引擎从依赖关系推导执行图，没有先后约束的步骤自动并行，不是傻瓜式串行。",
      },
      {
        icon: "users",
        title: "216 位 agency-agents 专家",
        desc: "全部来自开源专家库 agency-agents：营销 / 工程 / 设计 / 产品 / 财务 / 法律……即插即用，含中国本土平台角色（小红书 / 抖音 / 知乎 / B站 / 微信）。",
      },
      {
        icon: "file-code",
        title: "YAML 零代码",
        desc: "工作流就是一个 YAML：角色、任务、依赖、循环、条件分支，可读可改可版本管理。",
      },
      {
        icon: "repeat",
        title: "断点续跑",
        desc: "跑完后所有步骤产物落盘，可只从某一步重跑（--resume），复用上游结果，迭代不浪费 token。",
      },
      {
        icon: "boxes",
        title: "10 种大模型",
        desc: "DeepSeek / Claude / OpenAI / Gemini / Ollama……一个 provider 字段随意切换，按需求选择合适的模型。",
      },
      {
        icon: "shield-check",
        title: "确定性编排",
        desc: "DAG 调度是确定性的，谁先谁后、谁并行由依赖图决定，不靠模型即兴发挥。",
      },
    ],
  },
  evalNote: {
    title: "模型能力决定多智能体的价值（我们做了评测）",
    body: "在中等价位的有能力模型上，多智能体产出明显优于单次 prompt；但本地小模型（如 llama3 8B 级）能力不足时，多角色交接反而会放大漂移。追求质量请用有能力的模型。",
    link: "查看完整评测结论",
  },
  providers: {
    title: "支持 API Key，也有 7 种免 key 方式",
    subtitle: "充值少量就能跑很久；想零成本起步，也有 CLI / 本地模型等免 key 路径。",
    keyed: "API Key 接入",
    keyfree: "免 Key 方式",
  },
  studioDemo: {
    title: "在线演示（无需安装）",
    desc: "点一下，看 agency-agents 的专家如何按 DAG 协作。纯前端演示，不调用真实模型。",
    prompt: "程序员想用 AI 做副业，月入 2 万，做完整规划",
    play: "试跑演示",
    replay: "重新播放",
    running: "运行中",
    done: "完成 · 产物已保存到 ao-output/",
    note: "想真跑？本地安装 ao 并连上引擎，即可用真实模型执行。",
  },
  studio: {
    providers: {
      inUse: "使用中",
      setActive: "设为当前",
      testConnection: "测试连接",
      ok: "正常",
      etc: "等",
      keySet: "已设置 key",
      fromEnv: "（环境变量）",
      keyNotSet: "未设置 key",
      pasteNewKey: "粘贴新 key 替换…",
      pasteKey: "粘贴 API key…",
      save: "保存",
      baseUrlPlaceholder: "自定义 base_url（可选）",
      modelPlaceholder: "模型名（可选，留空用默认）",
      clear: "清除",
      ollamaDescBeforeServe: "本机推理,免 key。需先 ",
      ollamaDescBeforePull: " 并拉好模型（如 ",
      ollamaDescAfter: "）。建议 70B+ 模型,小模型多智能体易漂移。",
      ollamaModelPlaceholder: "模型名（必填,如 llama3）",
      privacyBeforeLocal: "🔒 key 只存",
      privacyLocal: "本机",
      privacyBeforeCode: "（",
      privacyAfter: "，已 gitignore），不上传任何服务器。选「设为当前」即切换运行方式,跑工作流就用它。",
      loadFailed: "读取配置失败，请确认本地引擎已启动。",
      loading: "加载…",
      cloudApiTitle: "云端大模型 API",
      cloudApiHint: "需 key,质量最稳",
      localModelTitle: "本地模型",
      localModelHint: "免 key,数据不出本机",
      localCliTitle: "本地 CLI",
      localCliHint: "免 key,走已登录的工具",
      cliRequirement: "需已安装并登录",
      compshareName: "优云智算 CompShare · 赞助商",
      compshareHint: "OpenAI 兼容 · 模型如 deepseek-ai/DeepSeek-R1 · key 在 console.compshare.cn",
    },
    run: {
      running: "运行中",
      done: "完成",
      error: "出错",
      terminalOutput: "终端输出",
      background: "后台",
      backgroundTitle: "后台运行（继续在后台跑）",
      stop: "停止",
      noTerminalOutput: "（暂无终端输出）",
      summoningTeam: "正在唤起团队、规划步骤…",
      backgroundHint: "可点「后台」离开，任务继续跑",
      savedToHistory: "✓ 已存入运行历史",
      copy: "复制",
      copied: "已复制",
      downloadMd: "下载 .md",
      viewHistory: "查看历史",
      close: "关闭",
      needApproval: "需要你确认才能继续",
      needInput: "需要你的输入才能继续",
      approveContinue: "通过，继续",
      reject: "驳回",
      inputPlaceholder: "输入后提交，工作流带着它继续往下跑…（⌘/Ctrl+Enter 提交）",
      submitContinue: "提交并继续",
      stepsUnit: "步",
      runningEllipsis: "运行中…",
      doneClickToView: "已完成 · 点击查看",
      remove: "移除",
      runFailedExitCodePrefix: "运行失败（退出码 ",
      runFailedExitCodeSuffix: "）",
      runError: "运行出错",
      reworkTitlePrefix: "（返工·",
      reworkTitleSuffix: "）",
    },
    runs: {
      loadingDetail: "加载详情…",
      stepsUnit: "步",
      copyResult: "复制成品",
      copied: "已复制",
      downloadResult: "下载成品",
      downloadAllTitle: "含全部步骤过程",
      downloadAll: "下载全部",
      fullProcessSuffix: "-全过程",
      cannotResume: "该记录缺少源文件路径，无法重跑。",
      finalResult: "最终成品",
      downloadStep: "下载本步 .md",
      resumeFromPrefix: "从「",
      resumeFromSuffix: "」重跑",
      resume: "重跑",
      loadingHistory: "加载历史…",
      loadFailed: "加载失败：",
      empty: "还没有运行记录。去「角色组队」或「工作流」跑一个吧。",
      searchPlaceholder: "搜索历史…",
      backToList: "返回列表",
      selectHint: "← 选择左侧一条记录查看结果",
    },
    roles: {
      loading: "加载角色…",
      loadFailed: "加载角色失败：",
      hintLabel: "用法:",
      hintPickOneBold: "勾 1 个",
      hintPickOneRest: "→ 单独对话",
      hintPickManyBold: "勾 2 个以上",
      hintPickManyRest: "→ AI 合成团队并运行",
      hintAvatarPre: "点",
      hintAvatarBold: "头像",
      hintAvatarPost: "看角色详情",
      searchPlaceholder: "搜索角色…",
      rolesCountSuffix: "个角色",
      categoryAll: "全部",
      viewDetail: "查看角色详情",
      selectedPrefix: "已选",
      clear: "清空",
      teamNamePlaceholder: "团队名称（可留空自动命名）",
      teamTaskPlaceholder: "这个团队要完成什么？（AI 据此设计步骤）",
      roleTaskPlaceholder: "想问这个角色什么？",
      composeAndRun: "合成团队并运行",
      composeFailed: "合成失败",
      singleChat: "单独对话",
      loadingAbilities: "加载角色能力…",
      noMoreInfo: "（无更多说明）",
      askPrefix: "想问 ",
      askSuffix: " 什么？",
      chat: "对话",
      copyPrompt: "复制提示词",
      copied: "已复制",
      copyFailed: "复制失败",
    },
    usage: {
      loadFailed: "加载失败：",
      loading: "统计中…",
      empty: "还没有运行记录,跑几个工作流后这里会有用量统计。",
      totalTokens: "累计 Tokens",
      inputTokens: "输入 Tokens",
      outputTokens: "输出 Tokens",
      estimatedCost: "估算成本",
      estimatedByPrefix: "按 ",
      estimatedBySuffix: " 估算",
      runs: "次运行",
      allRuns: "全部运行",
      costByModel: "成本按模型估算",
      dailyUsage: "每日 Token 用量",
      input: "输入",
      output: "输出",
      topRolesPrefix: "用量最高的角色 Top ",
      runsSuffix: "次",
    },
    workflows: {
      cancel: "取消",
      run: "运行",
      noInputsNeeded: "该工作流无需输入，可直接运行。",
      loading: "加载工作流…",
      loadFailed: "加载失败：",
      searchPlaceholder: "搜索工作流模板…",
      checkToCompare: "勾选以对比运行",
      steps: "步",
      mine: "我的",
      checkedPrefix: "已勾选 ",
      checkedSuffix: " 个模板",
      clear: "清空",
      compareRun: "对比运行",
      newTeam: "新团队",
      composedTeam: "AI 合成了一支团队",
      warningSeparator: "；",
      parsingPlan: "解析编排…",
      generatedExpandYaml: "已生成工作流，展开下方 YAML 查看详情。",
      viewYaml: "查看工作流 YAML",
      savedToWorkflows: "已存入「工作流」,下次可直接用",
      goToWorkflows: "去工作流",
      runThisTeam: "运行这支团队",
      runFailed: "运行失败",
      templatesSequential: "个模板（顺序执行）",
      waiting: "等待",
      errored: "出错",
      generating: "生成中…",
      waitingToRun: "等待执行",
    },
    shell: {
      tabs: {
        roles: { label: "角色组队", hint: "勾 1 个对话 · 勾多个合成团队" },
        workflows: { label: "工作流", hint: "运行模板 · 勾多个对比" },
        runs: { label: "运行历史", hint: "查看产物 · 从某步重跑" },
        usage: { label: "用量统计", hint: "token / 成本 / 趋势" },
        providers: { label: "供应商", hint: "密钥 · 测试连接" },
      },
      engineOnline: "引擎在线",
      engineOffline: "引擎离线",
      engineChecking: "检测中",
      statusOnline: "在线",
      statusOffline: "演示模式",
      statusChecking: "检测",
      providerSelectTitle: "运行用的模型 provider",
      providerDefault: "默认 (DeepSeek)",
      keys: "密钥",
      noKeyWarningPrefix: "当前 provider",
      noKeyWarningSuffix: "还没配置 API key，运行会失败。",
      setUpNow: "立即设置",
      gateTitle: "想真跑工作流？启动本地引擎",
      gateExplainBefore: "真实运行工作流要调用本地",
      gateExplainMiddle: "CLI 和你的模型 API key，所以 Studio 必须连本地后端。在项目根目录跑下面这条命令启动引擎（默认",
      gateExplainAfter: "）：",
      gateChecking: "检测中…",
      gateRecheck: "重新检测",
      gateHint: "这是公开演示站：没有后端、不能真跑，请勿在此填写 API key。要真用请本地安装运行（key 只存你自己机器、绝不上传）。",
      copy: "复制",
      copied: "已复制",
      downloadStep: "下载本步 .md",
      thinking: "思考中…",
      feedbackOpen: "提意见重做",
      feedbackPlaceholderPrefix: "想让",
      feedbackPlaceholderSuffix: "怎么改？例如：结尾加个反转 / 预算压到 5000 以内…",
      feedbackHint: "带着这步上一版产出 + 你的意见，让 Ta 在原稿上改",
      cancel: "取消",
      feedbackSubmit: "交给 Ta 重做",
    },
    demo: {
      bannerTitle: "演示模式",
      bannerDesc: "可浏览全部专家、查看并复制完整提示词。真正运行工作流需要本地引擎——请安装客户端或本地运行。",
      bannerInstall: "安装 / 下载客户端",
      installTitle: "运行需要本地引擎",
      installDesc: "公开站只用于演示,不调用真实模型、也不要在此填写 API key。想真正运行,二选一即可（你的 key 只存在自己机器上）：",
      optDesktopTitle: "下载桌面客户端",
      optDesktopDesc: "原生 App,免装 Node,双击即用。",
      optDesktopCta: "前往下载",
      optCliTitle: "命令行 / 本地 Studio",
      optCliDesc: "已装 Node 的话最快:",
      optCliCta: "查看文档",
      close: "关闭",
    },
  },
  sponsors: {
    nav: "赞助商",
    heroBadge: "开源 · 社区驱动",
    heroTitle: "感谢每一位支持者",
    heroSubtitle:
      "本站为支持 agency-agents 开源项目而建——这是一个面向开发者的开源项目，由社区与赞助商共同支撑。我们把每一份支持，都视作让项目走得更远的力量。",
    becomeCta: "成为赞助商",
    becomeNote: "想赞助 agency-agents 开源项目？欢迎邮件联系：",
    reserved: "虚位以待",
    reservedDesc: "期待与你合作 —— 成为下一位赞助商",
    flagshipLabel: "旗舰赞助商",
    flagshipDesc: "深度合作伙伴，长期为项目提供关键支持。旗舰位虚位以待，欢迎申请。",
    standardLabel: "更多赞助商",
    standardDesc: "感谢这些持续支持项目、并为用户提供专属优惠的赞助商",
    visit: "访问网站",
    couponLabel: "优惠码",
    copyCoupon: "复制优惠码",
    copied: "已复制到剪贴板",
    since: "赞助自",
    emptyStandard: "更多赞助商招募中 —— 成为第一批。",
    stripTitle: "感谢赞助商的支持",
    stripSubtitle: "如果你需要稳定、高性价比的 API 中转 / 模型服务，欢迎了解一下 AO 的赞助商。",
    viewAll: "查看全部赞助商",
    perksBadge: "一目了然",
    perksTitle: "专属福利汇总",
    perksSubtitle: "使用 AO 专属链接 / 优惠码即可享受下列福利。点击优惠码可一键复制。",
    perksTable: {
      sponsor: "赞助商",
      perk: "专属福利",
      coupon: "优惠码",
      link: "前往",
    },
    benefitsBadge: "与 AO 一起成长",
    benefitsTitle: "成为赞助商可以获得什么？",
    benefitsSubtitle: "深度合作展示位 + Studio 内预设接入 + 优先技术支持，让你的服务高效触达全球开发者。",
    benefits: [
      { title: "GitHub README 广告位", desc: "在 AO 主仓库 README 中、英双语展示，覆盖 GitHub 上的中外开发者流量。" },
      { title: "Studio 内预设接入", desc: "在 AO Studio 的密钥面板里预设你的 API，用户从你站点复制 key 一键导入即用，显著降低接入门槛。" },
      { title: "官网赞助商页展示", desc: "在官网赞助商页获得长期独立展示位（旗舰档带大横幅 + 首页露出），带去精准开发者流量。" },
      { title: "优先技术支持", desc: "专属对接通道，第一时间协助接入适配、优惠码 / 返佣结算等需求。" },
    ],
    faqTitle: "常见问题",
    faq: [
      { q: "如何成为 AO 的赞助商？", a: "通过 jnMetaCode@qq.com 邮件联系我们，说明你的服务、希望的合作档位与能提供的用户权益（折扣 / 优惠码 / 返佣）。确认细节后即可安排展示位置与上线时间。" },
      { q: "有哪些合作方案？", a: "目前提供旗舰与合作两档。两档都包含官网赞助商页展示、Studio 内预设接入与高亮推荐、以及 Release Notes 致谢；旗舰档在此基础上额外提供 GitHub README 广告位与首页露出，并支持中英双语展示。具体以邮件沟通为准。" },
      { q: "完成洽谈后多久可以上线？", a: "确认合作细节并收到素材（Logo / 简介 / 专属链接）后，通常 1–3 个工作日内即可上线。具体时间随展示位置与素材准备情况略有不同。" },
      { q: "需要准备哪些素材？", a: "通常包括 Logo、一段产品简介（中 / 英可选）、专属优惠链接，以及可选的 GitHub README 横幅图。合作确认后我们会同步详细的尺寸与格式要求，并协助审核素材。" },
    ],
  },
  docs: {
    title: "文档",
    subtitle: "从安装到写出第一个工作流。",
    searchPlaceholder: "搜索文档...",
    onThisPage: "本页内容",
    sections: [
      {
        heading: "安装",
        body: "需要 Node.js 18+。全局安装后即可使用 `ao` 命令。",
        code: "npm i -g agency-orchestrator\nao --version",
      },
      {
        heading: "一句话编排（推荐）",
        body: "最快上手方式：一句话描述需求，AI 自动选角、设计 DAG、生成并运行工作流。",
        code: 'ao compose "我是程序员，想用 AI 做自媒体副业，目标月入 2 万，帮我做完整规划" --run',
      },
      {
        heading: "运行已有工作流",
        body: "把工作流写成 YAML，或用内置模板直接跑。",
        code: "ao run workflows/story-creation.yaml\nao validate workflow.yaml   # 只校验不运行\nao plan workflow.yaml        # 看 DAG 执行计划",
      },
      {
        heading: "迭代优化（断点续跑）",
        body: "跑完后产物会落盘到 ao-output/。觉得某一步不满意，只重跑那一步及其下游，复用上游结果。",
        code: "ao run workflow.yaml --resume last --from character_design",
      },
      {
        heading: "工作流 YAML 结构",
        body: "一个工作流就是角色 + 任务 + 依赖。下面是最小骨架：",
        code:
          'name: "我的工作流"\nllm:\n  provider: "deepseek"\n  model: "deepseek-chat"\nsteps:\n  - id: research\n    role: "product/product-trend-researcher"\n    task: "调研 {{topic}} 的市场"\n    output: research\n  - id: write\n    role: "marketing/marketing-content-creator"\n    task: "基于 {{research}} 写方案"\n    depends_on: [research]',
      },
    ],
    moreInRepo: "完整文档与 216 个角色清单见 GitHub 仓库。",
  },
  tutorials: {
    badge: "官方 + 社区",
    title: "玩转 Agency Orchestrator",
    subtitle: "一句话生成工作流之后还能怎么玩？这里收集了官方与社区的攻略，从 5 分钟入门到进阶实战一网打尽。",
    submit: "投稿你的攻略",
    filterCategory: "分类",
    filterSource: "来源",
    all: "全部",
    minRead: "分钟阅读",
    empty: "这个分类下还没有攻略。",
    back: "返回攻略",
    categories: { start: "入门", practice: "实战", integration: "集成", troubleshoot: "排错", video: "视频" },
    sources: { official: "官方", community: "社区" },
  },
  changelog: {
    title: "更新日志",
    subtitle: "Agency Orchestrator 每个版本的变更记录，与仓库 CHANGELOG.md 同步。",
    latest: "最新",
    repoLink: "在 GitHub 查看完整 CHANGELOG",
  },
  experts: {
    title: "agency-agents 专家库",
    subtitle: "200+ 位打磨好的 AI 专家——每一位都是一段精调过的系统提示词。AO 一句话就能把他们组队协作。在这里直接浏览全部专家,无需安装。",
    searchPlaceholder: "搜索专家(名称 / 描述 / 分类)…",
    all: "全部",
    countSuffix: "位专家",
    empty: "没有匹配的专家,换个关键词试试。",
    repoCta: "在 GitHub 查看 agency-agents",
    copyPrompt: "复制提示词",
    viewPrompt: "查看提示词",
    copied: "已复制",
    copyFailed: "复制失败",
    loading: "加载中…",
    close: "关闭",
    promptHint: "这是该专家的完整系统提示词,可直接复制到任意 AI 工具中使用。",
  },
  footer: {
    tagline: "一句话，让多个 AI 角色自动协作。",
    supportLine: "本站为支持 agency-agents 开源项目而建。",
    product: "产品",
    resources: "资源",
    community: "社区",
    links: {
      features: "能力",
      sponsors: "赞助商",
      docs: "文档",
      tutorials: "教程",
      github: "GitHub 仓库",
      roles: "角色库",
      issues: "提 Issue",
      changelog: "更新日志",
      license: "License",
    },
    copyright: "Apache-2.0 License · 开源项目",
  },
  notFound: { title: "页面走丢了", desc: "这里什么都没有。", back: "回首页" },
  common: { loading: "加载中…" },
};

const en: typeof zh = {
  meta: { langLabel: "English", switchTo: "中文" },
  nav: {
    home: "Home",
    features: "Features",
    studio: "Studio",
    experts: "Experts",
    sponsors: "Sponsors",
    docs: "Docs",
    tutorials: "Tutorials",
    changelog: "Changelog",
    star: "Star",
    github: "GitHub",
  },
  hero: {
    badge: "Open source · Multi-agent workflow orchestrator",
    title: "One sentence in, agency-agents' experts",
    titleHighlight: "team up automatically",
    subtitle:
      "Describe what you need → AI decomposes the task → picks from 184 experts → runs them in parallel as a DAG → a full plan in minutes. The experts come from the open-source agency-agents library; AO orchestrates them into a team.",
    ctaDownload: "Download app",
    ctaPrimary: "View on GitHub",
    ctaSecondary: "Sponsor perks",
    installHint: "Start with one command:",
    copy: "Copy",
    copied: "Copied",
    stats: [
      { value: "184", label: "agency-agents experts" },
      { value: "10", label: "LLM providers" },
      { value: "DAG", label: "auto parallelism" },
      { value: "YAML", label: "zero-code" },
    ],
  },
  oneLiner: {
    title: "One sentence → full plan",
    desc: "The fastest way isn't writing YAML — it's compose: one sentence and AO wires up the whole workflow and runs it.",
    prompt: "A developer wants an AI side business at $3k/mo — plan it end to end",
    meta: "Workflow: auto-orchestrated · {n} steps · deepseek-chat",
    done: "Done · outputs saved to ao-output/",
    roles: ["🔭 Trend Researcher", "📱 Platform Analyst", "💰 Finance Planner", "✍️ Content Strategist", "📋 Exec Planner"],
    steps: [
      { emoji: "🔭", name: "Trend Researcher", time: "31.3s", out: "6 niches compared on competition / ceiling / AI leverage" },
      { emoji: "📱", name: "Platform Analyst", time: "32.0s", out: "6 platforms scored, recommends a 2-channel combo" },
      { emoji: "💰", name: "Finance Planner", time: "31.8s", out: "Revenue broken down: courses + community + consulting" },
      { emoji: "✍️", name: "Content Strategist", time: "30.5s", out: "30-day topic calendar + 3 viral script templates" },
      { emoji: "📋", name: "Exec Planner", time: "29.7s", out: "12-week roadmap with weekly measurable goals" },
    ],
  },
  features: {
    title: "Why multi-agent, not a single prompt",
    subtitle: "Blind-eval tested: on a capable-but-cheap model tier, expert-divided output clearly beats a one-shot prompt.",
    items: [
      { icon: "workflow", title: "Automatic DAG parallelism", desc: "The engine derives the execution graph from dependencies; independent steps run in parallel — not naive serial." },
      { icon: "users", title: "184 agency-agents experts", desc: "All from the open-source agency-agents library: marketing / engineering / design / product / finance / legal / game-dev and more — each a finely-tuned system prompt." },
      { icon: "file-code", title: "Zero-code YAML", desc: "A workflow is one YAML: roles, tasks, dependencies, loops, conditions — readable, editable, versionable." },
      { icon: "repeat", title: "Resume from any step", desc: "All step outputs are saved. Re-run from a single step (--resume), reuse upstream — iterate without wasting tokens." },
      { icon: "boxes", title: "10 LLM providers", desc: "DeepSeek / Claude / OpenAI / Gemini / Ollama… switch with one field. Pick whatever model fits your needs." },
      { icon: "shield-check", title: "Deterministic orchestration", desc: "The DAG schedule is deterministic — order and parallelism come from the dependency graph, not model improvisation." },
    ],
  },
  evalNote: {
    title: "Model capability decides multi-agent value (we measured it)",
    body: "On a capable mid-tier model, multi-agent output clearly beats a one-shot prompt; but with weak local models (llama3 8B class), hand-offs amplify drift. For quality, use a capable model.",
    link: "Read the full eval findings",
  },
  providers: {
    title: "Bring an API key, or go key-free (7 ways)",
    subtitle: "A small top-up runs a long way; or start at zero cost via CLI / local models.",
    keyed: "API key providers",
    keyfree: "Key-free options",
  },
  studioDemo: {
    title: "Live demo (no install)",
    desc: "Click to watch agency-agents' experts collaborate along the DAG. Front-end only — no real model calls.",
    prompt: "A developer wants an AI side business at $3k/mo — plan it end to end",
    play: "Run the demo",
    replay: "Replay",
    running: "running",
    done: "Done · outputs saved to ao-output/",
    note: "Want a real run? Install ao locally and connect the engine to use real models.",
  },
  studio: {
    providers: {
      inUse: "In use",
      setActive: "Set as current",
      testConnection: "Test connection",
      ok: "OK",
      etc: "etc.",
      keySet: "Key set",
      fromEnv: " (from env)",
      keyNotSet: "No key set",
      pasteNewKey: "Paste a new key to replace…",
      pasteKey: "Paste API key…",
      save: "Save",
      baseUrlPlaceholder: "Custom base_url (optional)",
      modelPlaceholder: "Model name (optional, blank for default)",
      clear: "Clear",
      ollamaDescBeforeServe: "Local inference, no key needed. First run ",
      ollamaDescBeforePull: " and pull a model (e.g. ",
      ollamaDescAfter: "). A 70B+ model is recommended; small models drift in multi-agent runs.",
      ollamaModelPlaceholder: "Model name (required, e.g. llama3)",
      privacyBeforeLocal: "🔒 Keys are stored only on ",
      privacyLocal: "this machine",
      privacyBeforeCode: " (",
      privacyAfter: ", already gitignored) and never uploaded to any server. Choose “Set as current” to switch the runtime — workflows will use it.",
      loadFailed: "Failed to read config. Make sure the local engine is running.",
      loading: "Loading…",
      cloudApiTitle: "Cloud LLM API",
      cloudApiHint: "Key required, most stable quality",
      localModelTitle: "Local model",
      localModelHint: "No key, data stays on this machine",
      localCliTitle: "Local CLI",
      localCliHint: "No key, uses your logged-in tools",
      cliRequirement: "Must be installed and logged in",
      compshareName: "CompShare · Sponsor",
      compshareHint: "OpenAI-compatible · model e.g. deepseek-ai/DeepSeek-R1 · get key at console.compshare.cn",
    },
    run: {
      running: "Running",
      done: "Done",
      error: "Error",
      terminalOutput: "Terminal output",
      background: "Background",
      backgroundTitle: "Run in background (keeps running)",
      stop: "Stop",
      noTerminalOutput: "(no terminal output yet)",
      summoningTeam: "Summoning the team, planning steps…",
      backgroundHint: "Click “Background” to leave; the run continues",
      savedToHistory: "✓ Saved to run history",
      copy: "Copy",
      copied: "Copied",
      downloadMd: "Download .md",
      viewHistory: "View history",
      close: "Close",
      needApproval: "Needs your approval to continue",
      needInput: "Needs your input to continue",
      approveContinue: "Approve, continue",
      reject: "Reject",
      inputPlaceholder: "Submit your input and the workflow keeps going… (⌘/Ctrl+Enter to submit)",
      submitContinue: "Submit and continue",
      stepsUnit: "steps",
      runningEllipsis: "Running…",
      doneClickToView: "Done · click to view",
      remove: "Remove",
      runFailedExitCodePrefix: "Run failed (exit code ",
      runFailedExitCodeSuffix: ")",
      runError: "Run error",
      reworkTitlePrefix: " (rework · ",
      reworkTitleSuffix: ")",
    },
    runs: {
      loadingDetail: "Loading details…",
      stepsUnit: "steps",
      copyResult: "Copy result",
      copied: "Copied",
      downloadResult: "Download result",
      downloadAllTitle: "Includes all step output",
      downloadAll: "Download all",
      fullProcessSuffix: "-full-process",
      cannotResume: "This record has no source file path and cannot be re-run.",
      finalResult: "Final result",
      downloadStep: "Download this step (.md)",
      resumeFromPrefix: "Re-run from “",
      resumeFromSuffix: "”",
      resume: "Re-run",
      loadingHistory: "Loading history…",
      loadFailed: "Load failed: ",
      empty: "No runs yet. Try one in “Team up roles” or “Workflows”.",
      searchPlaceholder: "Search history…",
      backToList: "Back to list",
      selectHint: "← Select a record on the left to view results",
    },
    roles: {
      loading: "Loading roles…",
      loadFailed: "Failed to load roles: ",
      hintLabel: "How to use:",
      hintPickOneBold: "Pick 1",
      hintPickOneRest: "→ one-on-one chat",
      hintPickManyBold: "Pick 2 or more",
      hintPickManyRest: "→ AI builds a team and runs it",
      hintAvatarPre: "Tap an ",
      hintAvatarBold: "avatar",
      hintAvatarPost: " for role details",
      searchPlaceholder: "Search roles…",
      rolesCountSuffix: "roles",
      categoryAll: "All",
      viewDetail: "View role details",
      selectedPrefix: "Selected",
      clear: "Clear",
      teamNamePlaceholder: "Team name (leave blank to auto-name)",
      teamTaskPlaceholder: "What should this team accomplish? (AI designs the steps)",
      roleTaskPlaceholder: "What do you want to ask this role?",
      composeAndRun: "Build team & run",
      composeFailed: "Compose failed",
      singleChat: "One-on-one chat",
      loadingAbilities: "Loading role abilities…",
      noMoreInfo: "(No further details)",
      askPrefix: "Ask ",
      askSuffix: " anything…",
      chat: "Chat",
      copyPrompt: "Copy prompt",
      copied: "Copied",
      copyFailed: "Copy failed",
    },
    usage: {
      loadFailed: "Failed to load: ",
      loading: "Loading…",
      empty: "No runs yet. Usage stats will appear here after you run a few workflows.",
      totalTokens: "Total Tokens",
      inputTokens: "Input Tokens",
      outputTokens: "Output Tokens",
      estimatedCost: "Estimated Cost",
      estimatedByPrefix: "Based on ",
      estimatedBySuffix: "",
      runs: "runs",
      allRuns: "All runs",
      costByModel: "Estimate cost by model",
      dailyUsage: "Daily Token Usage",
      input: "Input",
      output: "Output",
      topRolesPrefix: "Top Roles by Usage — Top ",
      runsSuffix: " runs",
    },
    workflows: {
      cancel: "Cancel",
      run: "Run",
      noInputsNeeded: "This workflow needs no input and can run directly.",
      loading: "Loading workflows…",
      loadFailed: "Failed to load: ",
      searchPlaceholder: "Search workflow templates…",
      checkToCompare: "Check to compare",
      steps: "steps",
      mine: "Mine",
      checkedPrefix: "Selected ",
      checkedSuffix: " templates",
      clear: "Clear",
      compareRun: "Compare run",
      newTeam: "New team",
      composedTeam: "AI composed a team",
      warningSeparator: "; ",
      parsingPlan: "Parsing plan…",
      generatedExpandYaml: "Workflow generated. Expand the YAML below for details.",
      viewYaml: "View workflow YAML",
      savedToWorkflows: "Saved to Workflows, ready to reuse",
      goToWorkflows: "Go to Workflows",
      runThisTeam: "Run this team",
      runFailed: "Run failed",
      templatesSequential: "templates (run sequentially)",
      waiting: "Waiting",
      errored: "Error",
      generating: "Generating…",
      waitingToRun: "Waiting to run",
    },
    shell: {
      tabs: {
        roles: { label: "Build a Team", hint: "1 to chat · several to compose a team" },
        workflows: { label: "Workflows", hint: "Run templates · pick several to compare" },
        runs: { label: "Run History", hint: "View outputs · rerun from a step" },
        usage: { label: "Usage", hint: "tokens / cost / trends" },
        providers: { label: "Providers", hint: "API keys · test connection" },
      },
      engineOnline: "Engine online",
      engineOffline: "Engine offline",
      engineChecking: "Checking",
      statusOnline: "Online",
      statusOffline: "Demo mode",
      statusChecking: "Checking",
      providerSelectTitle: "Model provider used for runs",
      providerDefault: "Default (DeepSeek)",
      keys: "Keys",
      noKeyWarningPrefix: "Provider",
      noKeyWarningSuffix: "has no API key configured — runs will fail.",
      setUpNow: "Set up now",
      gateTitle: "Want to run for real? Start the local engine",
      gateExplainBefore: "Running workflows for real calls the local",
      gateExplainMiddle: "CLI and your model API key, so Studio must connect to a local backend. Run this command in the project root to start the engine (default",
      gateExplainAfter: "):",
      gateChecking: "Checking…",
      gateRecheck: "Check again",
      gateHint: "This is a public demo: no backend, can't run for real — never enter an API key here. Install and run locally to actually use AO (your key stays on your machine and is never uploaded).",
      copy: "Copy",
      copied: "Copied",
      downloadStep: "Download this step as .md",
      thinking: "Thinking…",
      feedbackOpen: "Request a revision",
      feedbackPlaceholderPrefix: "How should",
      feedbackPlaceholderSuffix: "be changed? e.g. add a twist at the end / cut the budget under 5000…",
      feedbackHint: "Sends this step's previous output + your notes so they revise the draft in place",
      cancel: "Cancel",
      feedbackSubmit: "Send back for revision",
    },
    demo: {
      bannerTitle: "Demo mode",
      bannerDesc: "Browse every expert, view and copy full prompts. Running workflows for real needs a local engine — install the app or run it locally.",
      bannerInstall: "Install / download the app",
      installTitle: "Running needs a local engine",
      installDesc: "The public site is for demo only — it calls no real models, so don't enter an API key here. To actually run, pick either option (your key stays on your machine):",
      optDesktopTitle: "Download the desktop app",
      optDesktopDesc: "Native app, no Node needed, just double-click.",
      optDesktopCta: "Download",
      optCliTitle: "CLI / local Studio",
      optCliDesc: "Fastest if you already have Node:",
      optCliCta: "Read the docs",
      close: "Close",
    },
  },
  sponsors: {
    nav: "Sponsors",
    heroBadge: "Open source · Community-driven",
    heroTitle: "Thank you to every supporter",
    heroSubtitle:
      "This site is built to support the agency-agents open-source project — an open project for developers, sustained by its community and sponsors. We treat every bit of support as fuel that takes the project further.",
    becomeCta: "Become a sponsor",
    becomeNote: "Want to sponsor the agency-agents open-source project? Email us:",
    reserved: "Reserved",
    reservedDesc: "Your spot could be here — become the next sponsor",
    flagshipLabel: "Flagship sponsors",
    flagshipDesc: "Deep partners providing key, long-term support. This flagship slot is open — apply to claim it.",
    standardLabel: "More sponsors",
    standardDesc: "Thanks to these sponsors for their ongoing support and exclusive user perks",
    visit: "Visit site",
    couponLabel: "Coupon",
    copyCoupon: "Copy coupon",
    copied: "Copied to clipboard",
    since: "Sponsor since",
    emptyStandard: "More sponsors wanted — be among the first.",
    stripTitle: "Thanks to our sponsors",
    stripSubtitle: "If you need a stable, cost-effective API relay / model service, take a look at AO's sponsors.",
    viewAll: "View all sponsors",
    perksBadge: "At a glance",
    perksTitle: "Exclusive perks summary",
    perksSubtitle: "Use AO's exclusive links / coupons to enjoy the perks below. Click a coupon to copy.",
    perksTable: {
      sponsor: "Sponsor",
      perk: "Exclusive perk",
      coupon: "Coupon",
      link: "Go",
    },
    benefitsBadge: "Grow with AO",
    benefitsTitle: "What you get by sponsoring AO",
    benefitsSubtitle: "A deep-partnership placement + in-Studio preset access + priority support — reaching developers worldwide.",
    benefits: [
      { title: "GitHub README ad slot", desc: "Bilingual (EN/CN) placement in the main AO repo README, reaching developers worldwide on GitHub." },
      { title: "In-Studio preset access", desc: "Your API preset in AO Studio's key panel — users copy a key from your site and one-click import it, slashing setup friction." },
      { title: "Sponsors-page placement", desc: "A long-term dedicated slot on the official sponsors page (flagship gets a banner + home exposure), driving precise developer traffic." },
      { title: "Priority support", desc: "A dedicated channel for fast help with integration, coupon / rev-share settlement, and more." },
    ],
    faqTitle: "FAQ",
    faq: [
      { q: "How do I become an AO sponsor?", a: "Reach us at jnMetaCode@qq.com with your service, desired tier, and the user perk you offer (discount / coupon / rev-share). Once details are confirmed we'll arrange placement and go-live." },
      { q: "What partnership tiers are there?", a: "Two tiers: Flagship and Partner. Both include sponsors-page placement, in-Studio preset access with a highlighted recommendation, and release-notes acknowledgement. Flagship additionally gets a GitHub README ad slot and home-page exposure, with bilingual display. Details by email." },
      { q: "How soon can it go live?", a: "After confirming details and receiving assets (logo / blurb / link), typically within 1–3 business days, varying by placement and asset readiness." },
      { q: "What materials do I need to prepare?", a: "Typically a logo, a short product blurb (CN / EN), an exclusive offer link, and optionally a GitHub README banner image. After we confirm the partnership, we'll share exact size / format requirements and help review the assets." },
    ],
  },
  docs: {
    title: "Docs",
    subtitle: "From install to your first workflow.",
    searchPlaceholder: "Search docs...",
    onThisPage: "On this page",
    sections: [
      { heading: "Install", body: "Requires Node.js 18+. After a global install the `ao` command is available.", code: "npm i -g agency-orchestrator\nao --version" },
      { heading: "Compose in one sentence (recommended)", body: "The fastest start: describe your need, AO picks roles, designs the DAG, generates and runs the workflow.", code: 'ao compose "I am a developer, help me plan an AI side business targeting $3k/mo" --run' },
      { heading: "Run an existing workflow", body: "Write a YAML workflow, or run a built-in template directly.", code: "ao run workflows/story-creation.yaml\nao validate workflow.yaml   # validate only\nao plan workflow.yaml        # show the DAG plan" },
      { heading: "Iterate (resume)", body: "Outputs are saved to ao-output/. Unhappy with one step? Re-run just that step and downstream, reusing upstream.", code: "ao run workflow.yaml --resume last --from character_design" },
      { heading: "Workflow YAML shape", body: "A workflow is roles + tasks + dependencies. Minimal skeleton:", code: 'name: "My workflow"\nllm:\n  provider: "deepseek"\n  model: "deepseek-chat"\nsteps:\n  - id: research\n    role: "product/product-trend-researcher"\n    task: "Research the market for {{topic}}"\n    output: research\n  - id: write\n    role: "marketing/marketing-content-creator"\n    task: "Write a plan from {{research}}"\n    depends_on: [research]' },
    ],
    moreInRepo: "Full docs and the list of 184 roles live in the GitHub repo.",
  },
  tutorials: {
    badge: "Official + Community",
    title: "Master Agency Orchestrator",
    subtitle: "What can you do after generating a workflow in one sentence? Official and community tutorials, from a 5-minute start to advanced practice.",
    submit: "Submit your tutorial",
    filterCategory: "Category",
    filterSource: "Source",
    all: "All",
    minRead: "min read",
    empty: "No tutorials in this category yet.",
    back: "Back to tutorials",
    categories: { start: "Start", practice: "Practice", integration: "Integration", troubleshoot: "Troubleshoot", video: "Video" },
    sources: { official: "Official", community: "Community" },
  },
  changelog: {
    title: "Changelog",
    subtitle: "Release notes for every Agency Orchestrator version, synced with the repo's CHANGELOG.md.",
    latest: "Latest",
    repoLink: "View the full CHANGELOG on GitHub",
  },
  experts: {
    title: "The agency-agents library",
    subtitle: "200+ finely-tuned AI experts — each a carefully crafted system prompt. AO teams them up from a single sentence. Browse them all here, no install needed.",
    searchPlaceholder: "Search experts (name / description / category)…",
    all: "All",
    countSuffix: "experts",
    empty: "No matching experts — try another keyword.",
    repoCta: "View agency-agents on GitHub",
    copyPrompt: "Copy prompt",
    viewPrompt: "View prompt",
    copied: "Copied",
    copyFailed: "Copy failed",
    loading: "Loading…",
    close: "Close",
    promptHint: "This is the expert's full system prompt — copy it into any AI tool.",
  },
  footer: {
    tagline: "One sentence in, a team of AI agents out.",
    supportLine: "Built to support the agency-agents open-source project.",
    product: "Product",
    resources: "Resources",
    community: "Community",
    links: {
      features: "Features",
      sponsors: "Sponsors",
      docs: "Docs",
      tutorials: "Tutorials",
      github: "GitHub repo",
      roles: "Role library",
      issues: "Open an issue",
      changelog: "Changelog",
      license: "License",
    },
    copyright: "Apache-2.0 License · Open source",
  },
  notFound: { title: "Page not found", desc: "Nothing here.", back: "Back home" },
  common: { loading: "Loading…" },
};

export const translations: Record<Language, typeof zh> = { zh, en };
export type Translation = typeof zh;
