import {
  CompassIcon,
  GraduationCapIcon,
  ImageIcon,
  MicroscopeIcon,
  PenLineIcon,
  ShapesIcon,
  SparklesIcon,
  VideoIcon,
} from "lucide-react";

import type { Translations } from "./types";

export const zhCN: Translations = {
  // 隐蔽版本标识：Tag：v3.2.1 feat: 宿主页复制
  // Locale meta
  locale: {
    localName: "中文",
  },

  // Common
  common: {
    home: "首页",
    settings: "设置",
    delete: "删除",
    rename: "重命名",
    share: "分享",
    openInNewWindow: "在新窗口打开",
    close: "关闭",
    fullScreen: "全屏",
    closeFullScreen: "关闭全屏",
    more: "更多",
    search: "搜索",
    download: "下载",
    downloadOriginal: "原文件",
    downloadAsDocx: "下载为 DOCX",
    downloadAsPdf: "下载为 PDF",
    thinking: "思考",
    artifacts: "查看结果",
    public: "公共",
    custom: "自定义",
    notAvailableInDemoMode: "在演示模式下不可用",
    loading: "加载中...",
    version: "版本",
    lastUpdated: "最后更新",
    code: "代码",
    preview: "预览",
    cancel: "取消",
    save: "保存",
    install: "安装",
    create: "创建",
    export: "导出",
    exportAsMarkdown: "导出为 Markdown",
    exportAsJSON: "导出为 JSON",
    exportSuccess: "对话已导出",
    removeAttachment: "移除附件",
    reference: "引用",
    resetThread: "重置会话",
  },

  // Welcome
  welcome: {
    greeting: "轻办公 · XClaw",
    description:
      "欢迎使用 🦌 XClaw，一个完全开源的超级智能体。通过内置和自定义的 Skills，\nXClaw 可以帮你搜索网络、分析数据，还能为你生成幻灯片、\n图片、视频、播客及网页等，几乎可以做任何事情。",

    createYourOwnSkill: "创建你自己的 Agent SKill",
    createYourOwnSkillDescription:
      "创建你的 Agent Skill 来释放 XClaw 的潜力。通过自定义技能，XClaw\n可以帮你搜索网络、分析数据，还能为你生成幻灯片、\n网页等作品，几乎可以做任何事情。",
  },

  // Clipboard
  clipboard: {
    copyToClipboard: "复制到剪贴板",
    copiedToClipboard: "已复制到剪贴板",
    failedToCopyToClipboard: "复制到剪贴板失败",
    linkCopied: "链接已复制到剪贴板",
  },

  // Input Box
  inputBox: {
    placeholder: "可直接对话; 或输入需求并选择skill，完成专业任务;",
    welcomePlaceholder: "可直接对话; 或输入需求并选择skill，完成专业任务。",
    chatPlaceholder: "“@”可引用文件。",
    createSkillPrompt:
      "我们一起用 skill-creator 技能来创建一个技能吧。先问问我希望这个技能能做什么。",
    sendMessagePrice:
      "请注意，此功能将消耗token，请保证账户余额大于200可学豆。",
    addAttachments: "添加附件",
    history: "历史记录",
    welcome:"欢迎页",
    selectSkill: "选择Skill",
    mode: "模式",
    flashMode: "闪速",
    flashModeDescription: "快速且高效的完成任务，但可能不够精准",
    reasoningMode: "思考",
    reasoningModeDescription: "思考后再行动，在时间与准确性之间取得平衡",
    proMode: "Pro",
    proModeDescription: "思考、计划再执行，获得更精准的结果，可能需要更多时间",
    ultraMode: "Ultra",
    ultraModeDescription:
      "继承自 Pro 模式，可调用子代理分工协作，适合复杂多步骤任务，能力最强",
    reasoningEffort: "推理深度",
    reasoningEffortMinimal: "最低",
    reasoningEffortMinimalDescription: "检索 + 直接输出",
    reasoningEffortLow: "低",
    reasoningEffortLowDescription: "简单逻辑校验 + 浅层推演",
    reasoningEffortMedium: "中",
    reasoningEffortMediumDescription: "多层逻辑分析 + 基础验证",
    reasoningEffortHigh: "高",
    reasoningEffortHighDescription: "全维度逻辑推演 + 多路径验证 + 反推校验",
    searchModels: "搜索模型...",
    surpriseMe: "小惊喜",
    surpriseMePrompt: "给我一个小惊喜吧",
    followupLoading: "正在生成可能的后续问题...",
    followupConfirmTitle: "发送建议问题？",
    followupConfirmDescription: "当前输入框已有内容，选择发送方式。",
    followupConfirmAppend: "追加并发送",
    followupConfirmReplace: "替换并发送",
    submit: "发送",
    submitting: "生成中...",
    stop: "停止",
    addReference: "添加引用",
    referenceSourceArtifact: "生成文件",
    referenceSourceUpload: "上传附件",
    maxReferencesReached: "单条消息最多引用 10 个文件",
    suggestions: [
      {
        suggestion: "八字命理",
        prompt:
          "为[主题/产品]撰写吸引人的自媒体文案，包括标题、正文和话题标签。",
        icon: PenLineIcon,
        children: [{ id: "6057", name: "生辰解语" }],
      },
      {
        suggestion: "GPT-Image-2",
        prompt: "编写[项目/功能]的需求文档，包含功能描述、用户故事和验收标准。",
        icon: CompassIcon,
        children: [{ id: "6130", name: "GPT-Image-2" }],
      },
      {
        suggestion: "音乐生成",
        prompt: "编写[产品/功能]的使用指南，包含操作步骤、注意事项和常见问题。",
        icon: GraduationCapIcon,
        children: [{ id: "6133", name: "音乐生成器" }],
      },
      {
        suggestion: "excel填表神器",
        prompt: "对[Excel文件/数据]进行分析，生成数据洞察和可视化建议。",
        icon: MicroscopeIcon,
        children: [{ id: "17", name: "Excel处理" }],
      },
      {
        suggestion: "word填表神器",
        prompt: "对[word文件/数据]进行分析",
        icon: MicroscopeIcon,
        children: [{ id: "6195", name: "docx表格填充器" }],
      },
      {
        suggestion: "微信文章撰写",
        prompt: "针对[行业/产品]进行市场调研，分析市场规模、竞品和趋势。",
        icon: ShapesIcon,
        children: [{ id: "6134", name: "微信文章撰写" }],
      },
      {
        suggestion: "精美ppt制作",
        prompt: "针对[行业/产品]进行市场调研，分析市场规模、竞品和趋势。",
        icon: ShapesIcon,
        children: [{ id: "6192", name: "精美ppt制作" }],
      },
    ],
    suggestionsCreate: [
      {
        suggestion: "网页",
        prompt: "生成一个关于[主题]的网页",
        icon: CompassIcon,
      },
      {
        suggestion: "图片",
        prompt: "生成一个关于[主题]的图片",
        icon: ImageIcon,
      },
      {
        suggestion: "视频",
        prompt: "生成一个关于[主题]的视频",
        icon: VideoIcon,
      },
      {
        type: "separator",
      },
      {
        suggestion: "技能",
        prompt:
          "我们一起用 skill-creator 技能来创建一个技能吧。先问问我希望这个技能能做什么。",
        icon: SparklesIcon,
      },
    ],
  },

  // Sidebar
  sidebar: {
    newChat: "新对话",
    chats: "对话",
    recentChats: "最近的对话",
    demoChats: "演示对话",
    agents: "智能体",
  },

  // Agents
  agents: {
    title: "智能体",
    description: "创建和管理具有专属 Prompt 与能力的自定义智能体。",
    newAgent: "新建智能体",
    emptyTitle: "还没有自定义智能体",
    emptyDescription: "创建你的第一个自定义智能体，设置专属系统提示词。",
    chat: "对话",
    delete: "删除",
    deleteConfirm: "确定要删除该智能体吗？此操作不可撤销。",
    deleteSuccess: "智能体已删除",
    newChat: "新对话",
    createPageTitle: "设计你的智能体",
    createPageSubtitle: "描述你想要的智能体，我来帮你通过对话创建。",
    nameStepTitle: "给新智能体起个名字",
    nameStepHint:
      "只允许字母、数字和连字符，存储时自动转为小写（例如 code-reviewer）",
    nameStepPlaceholder: "例如 code-reviewer",
    nameStepContinue: "继续",
    nameStepInvalidError: "名称无效，只允许字母、数字和连字符",
    nameStepAlreadyExistsError: "已存在同名智能体",
    nameStepCheckError: "无法验证名称可用性，请稍后重试",
    nameStepBootstrapMessage:
      "新智能体的名称是 {name}，现在开始为它生成 **SOUL**。",
    agentCreated: "智能体已创建！",
    startChatting: "开始对话",
    backToGallery: "返回 Gallery",
  },

  // Breadcrumb
  breadcrumb: {
    workspace: "工作区",
    chats: "对话",
  },

  // Workspace
  workspace: {
    officialWebsite: "访问 XClaw 官方网站",
    githubTooltip: "访问 XClaw 的 Github 仓库",
    settingsAndMore: "设置和更多",
    visitGithub: "在 Github 上查看 XClaw",
    reportIssue: "报告问题",
    contactUs: "联系我们",
    about: "关于 XClaw",
  },

  // Conversation
  conversation: {
    noMessages: "还没有消息",
    startConversation: "开始新的对话以查看消息",
  },

  // Chats
  chats: {
    searchChats: "搜索对话",
    scrollToBottom: "滚动到底部",
  },

  threadMemoryPanel: {
    title: "会话记忆",
    load: "查看记忆",
    loading: "加载中...",
    save: "保存记忆",
    saving: "保存中...",
    remove: "删除记忆",
    removing: "删除中...",
    threadId: "threadId",
    version: "版本",
    unavailableVersion: "-",
    summaryPlaceholder: "这里显示会话记忆总结，可编辑后保存",
    toastLoadSuccess: "已加载会话记忆",
    toastLoadFailed: "加载会话记忆失败",
    toastConflict: "记忆已更新，请先重新加载再保存",
    toastSaveSuccess: "会话记忆已保存",
    toastSaveFailed: "保存会话记忆失败",
    toastDeleteSuccess: "当前会话记忆已删除",
    toastDeleteFailed: "删除会话记忆失败",
  },

  // Workspace Chat Page
  chatPage: {
    defaultSlogan: "来，一起学习工作吧",
    missingThreadIdForCreate: "缺少 thread_id，无法创建会话",
    createSessionFailed: "会话创建失败，请稍后重试",
    conversationFinished: "对话已完成",
    missingThreadIdForSend: "缺少 thread_id，无法发送消息",
    viewArtifactsTooltip: "点击可查看生成的文件结果",
    noArtifactSelectedTitle: "未选择生成文件",
    noArtifactSelectedDescription: "请选择一个生成文件以查看详情",
    exitDialogTitle: "提示",
    exitDialogDescription:
      "每七天自动删除。现在将返回欢迎页且清空聊天消息，是否继续？",
    exitDialogConfirm: "确定",
    selectedSkillLoadFailed: "技能加载失败",
    unknownErrorRetry: "发生了未知错误，请稍后重试。",
  },

  messageListItem: {
    materializing: "解析中...",
    importAsSkillDir: "一键导入为 Skill 目录",
    materializeSuccess: (files: number, directories: number) =>
      `已创建 ${files} 个文件 / ${directories} 个目录`,
    parseFailed: "解析失败",
    materializeFailed: (message: string) => `失败: ${message}`,
  },

  artifactPreview: {
    pdfPreviewFailed: "无法预览该 PDF 文件，请下载后查看。",
    unsupportedType: "该文件类型暂不支持在自定义预览器中查看。",
    docxPreviewFailed: "无法预览该 DOCX 文件。",
    excelPreviewFailed: "无法预览该 Excel 文件。",
    switchSheetFailed: "切换工作表失败。",
    excelGridPreviewFailed: "无法渲染 Excel 网格预览。",
    pptxDownloadHint: "请下载 ppt 文件以获得最佳效果",
    openInNewTab: "在新标签页打开",
    clickToDownload: "点击下载",
    pageCountLabel: (fileName: string, pageCount: number) =>
      `${fileName} · 共 ${pageCount} 页`,
    zoomIn: "放大",
    zoomOut: "缩小",
    showArtifactsTooltip: "查看当前对话的生成文件",
  },

  workspaceHeader: {
    sidebarTitle: "XClaw侧边栏",
  },

  models: {
    updating: "系统正在更新，请稍候……",
    apiUnavailable: "模型接口不可用，请检查后端路由或服务状态。",
  },

  threads: {
    streamError: "出现了某些错误。",
    billingInsufficientBalance: "账户余额不足，无法完成本次模型调用。",
    invalidThreadId: "线程 ID 无效（new），请刷新后重试。",
    staleReferencesRemoved: "部分引用文件已失效，已自动移除并继续发送。",
    uploadFailed: "文件上传失败。",
    uploadPrepareFailed: (count: number) =>
      `准备上传附件失败（${count} 个），请重试。`,
    threadNotReadyForUpload: "当前线程尚未就绪，无法上传文件。",
  },

  skills: {
    loadFailed: "技能加载失败",
    missingThreadId: "缺少 thread_id，无法初始化技能",
    invalidSkillId: "无效的 skill_id",
    loading: (title: string) => `正在加载技能「${title}」...`,
    loadFailedWithTitle: (title: string) => `技能「${title}」加载失败`,
    loadSuccessWithTitle: (title: string) => `技能「${title}」加载成功`,
    loadErrorWithTitle: (title: string) => `技能「${title}」加载出错`,
    unknownError: "未知错误",
    networkRequestFailed: "网络请求失败",
    createdFiles: (count: number) => `已创建 ${count} 个文件`,
    invalidSkillIdArray: "非法 skill_id 数组",
  },

  // Page titles (document title)
  pages: {
    appName: "XClaw",
    chats: "对话",
    newChat: "新对话",
    untitled: "未命名",
  },

  // Tool calls
  toolCalls: {
    moreSteps: (count: number) => `查看其他 ${count} 个步骤`,
    lessSteps: "隐藏步骤",
    executeCommand: "执行命令",
    presentFiles: "展示文件",
    needYourHelp: "需要你的协助",
    useTool: (toolName: string) => `使用 “${toolName}” 工具`,
    searchFor: (query: string) => `搜索 “${query}”`,
    searchForRelatedInfo: "搜索相关信息",
    searchForRelatedImages: "搜索相关图片",
    searchForRelatedImagesFor: (query: string) => `搜索相关图片 “${query}”`,
    searchOnWebFor: (query: string) => `在网络上搜索 “${query}”`,
    viewWebPage: "查看网页",
    listFolder: "列出文件夹",
    readFile: "读取文件",
    writeFile: "写入文件",
    clickToViewContent: "点击查看文件内容",
    writeTodos: "更新 To-do 列表",
    expandContent: "展开",
    collapseContent: "收起",
    skillInstallTooltip: "安装技能并使其可在 XClaw 中使用",
  },

  uploads: {
    uploading: "上传中...",
    uploadingFiles: "文件上传中，请稍候...",
  },

  subtasks: {
    subtask: "子任务",
    executing: (count: number) =>
      `${count > 1 ? "并行" : ""}执行 ${count} 个子任务`,
    in_progress: "子任务运行中",
    completed: "子任务已完成",
    failed: "子任务失败",
  },

  // Token Usage
  tokenUsage: {
    title: "Token 用量",
    input: "输入",
    output: "输出",
    total: "总计",
  },

  // Shortcuts
  shortcuts: {
    searchActions: "搜索操作...",
    noResults: "未找到结果。",
    actions: "操作",
    keyboardShortcuts: "键盘快捷键",
    keyboardShortcutsDescription: "使用键盘快捷键更快地操作 XClaw。",
    openCommandPalette: "打开命令面板",
    toggleSidebar: "切换侧边栏",
  },

  // Settings
  settings: {
    title: "设置",
    description: "根据你的偏好调整 XClaw 的界面和行为。",
    sections: {
      appearance: "外观",
      memory: "记忆",
      tools: "工具",
      skills: "技能",
      notification: "通知",
      about: "关于",
    },
    memory: {
      title: "记忆",
      description:
        "XClaw 会在后台不断从你的对话中自动学习。这些记忆能帮助 XClaw 更好地理解你，并提供更个性化的体验。",
      empty: "暂无可展示的记忆数据。",
      rawJson: "原始 JSON",
      markdown: {
        overview: "概览",
        userContext: "用户上下文",
        work: "工作",
        personal: "个人",
        topOfMind: "近期关注（Top of mind）",
        historyBackground: "历史背景",
        recentMonths: "近几个月",
        earlierContext: "更早上下文",
        longTermBackground: "长期背景",
        updatedAt: "更新于",
        facts: "事实",
        empty: "（空）",
        table: {
          category: "类别",
          confidence: "置信度",
          confidenceLevel: {
            veryHigh: "极高",
            high: "较高",
            normal: "一般",
            unknown: "未知",
          },
          content: "内容",
          source: "来源",
          createdAt: "创建时间",
          view: "查看",
        },
      },
    },
    appearance: {
      themeTitle: "主题",
      themeDescription: "跟随系统或选择固定的界面模式。",
      system: "系统",
      light: "浅色",
      dark: "深色",
      systemDescription: "自动跟随系统主题。",
      lightDescription: "更明亮的配色，适合日间使用。",
      darkDescription: "更暗的配色，减少眩光方便专注。",
      languageTitle: "语言",
      languageDescription: "在不同语言之间切换。",
    },
    tools: {
      title: "工具",
      description: "管理 MCP 工具的配置和启用状态。",
    },
    skills: {
      title: "技能",
      description: "管理 Agent Skill 配置和启用状态。",
      createSkill: "新建技能",
      emptyTitle: "还没有技能",
      emptyDescription:
        "将你的 Agent Skill 文件夹放在 XClaw 根目录下的 `/skills/custom` 文件夹中。",
      emptyButton: "创建你的第一个技能",
    },
    notification: {
      title: "通知",
      description:
        "XClaw 只会在窗口不活跃时发送完成通知，特别适合长时间任务：你可以先去做别的事，完成后会收到提醒。",
      requestPermission: "请求通知权限",
      deniedHint:
        "通知权限已被拒绝。可在浏览器的网站设置中重新开启，以接收完成提醒。",
      testButton: "发送测试通知",
      testTitle: "XClaw",
      testBody: "这是一条测试通知。",
      notSupported: "当前浏览器不支持通知功能。",
      disableNotification: "关闭通知",
    },
    acknowledge: {
      emptyTitle: "致谢",
      emptyDescription: "相关的致谢信息会展示在这里。",
    },
  },
};
