import i18n from "i18next"; import { initReactI18next } from "react-i18next"; const resources = { en: { translation: { conversationView: "Conversation view", chatView: "Chat", trajectory: "Trajectory", trajectoryScope: "Recorded Session messages in order, not execution durations or the complete model request.", trajectoryRunning: "Work is active. This view updates as saved records arrive; in-flight text is available in Chat.", trajectoryTruncated: "Loaded history is partial: {{entries}} entries omitted, {{parts}} parts omitted, {{messages}} messages truncated.", trajectoryEmpty: "No saved records yet.", trajectoryOverview: "Record sequence overview", trajectoryEarlier: "Show earlier records ({{count}} remaining in loaded history)", trajectoryDetails: "Record details", trajectoryRecordedAt: "Record timestamp", trajectoryEvidenceTruncated: "This evidence was truncated in the Session projection.", trajectoryArguments: "Tool arguments", trajectoryRecordedContent: "Recorded content", trajectoryThinking: "Recorded model reasoning", trajectoryOutput: "Tool result", trajectoryMissingResult: "No unambiguous result is included in the loaded records. This does not imply the tool is still running.", trajectoryStructured: "Structured result", trajectoryEventOnly: "Only this event’s type and timestamp are available.", trajectory_user: "User prompt", trajectory_assistant: "Assistant", trajectory_call: "Tool call", trajectory_result: "Unpaired result", trajectory_event: "Session event", trajectory_returned: "Tool returned successfully; background work may still be active.", trajectory_error: "Tool returned an error", trajectory_unknown: "Outcome not established", runtimeStatus: "Runtime status", refreshStatus: "Refresh status", terminalDetails: "Terminal details", inspectionChanged: "The active session changed. Reopen this panel.", inspectionUnavailable: "Details are unavailable.", inspectionLoading: "Loading status…", thinkingUnavailable: "Thinking state is unavailable.", trustUnavailable: "Project trust status is unavailable.", authUnavailable: "Provider status is unavailable.", executionState: "State", terminalCommand: "Command", terminalDirectory: "Directory", startedAt: "Started", exitCode: "Exit code", detailTruncated: "Some details are shortened to keep this view bounded.", standardOutput: "Standard output", standardError: "Standard error", outputTruncated: "{{count}} bytes omitted from this output view.", outputRecovery: "The runtime reports a retained log. This view shows only a bounded excerpt.", modelAndThinking: "Model and reasoning", selectedModel: "Current model", thinkingLevel: "Thinking level", availableThinking: "Available levels", unknownState: "Unknown", projectTrust: "Project trust", trust_trusted: "This session trusts the workspace.", trust_untrusted: "Trust for this workspace has been denied.", trust_restricted: "Project resources are restricted pending a trust decision.", trust_unknown: "Trust state is not available.", trustRefreshNeeded: "The saved decision and active session differ. Refresh the session through Pi to apply it.", providerAvailability: "Provider credentials", credentialConfigured: "Configured", credentialMissing: "Not configured", noProviders: "No providers reported.", providersBounded: "This provider list is truncated.", authNotVerified: "Configured credentials do not guarantee a successful model request.", configurationViaPi: "Read-only status. Manage model credentials and trust through Pi; manage OpenPI options with /openpi-setup.", statusCaptured: "Snapshot at {{time}} · refresh for the latest state", conversationViews: "Conversation views", currentConversations: "Current", archivedConversations: "Archived", restoreConversation: "Restore conversation", restoringConversation: "Restoring…", loadedArchives: "Archived conversations in the loaded history", loadedHistoryBounded: "{{sessions}} more sessions and {{workspaces}} workspace summaries are not loaded. Search covers the loaded list only.", noLoadedArchives: "No archived conversations in this loaded list.", restoreFailed: "Could not confirm restoration. Refresh and try again.", execution_running: "Running", execution_done: "Completed", execution_killed: "Stopped", execution_timed_out: "Timed out", execution_failed: "Failed", execution_uncertain: "Uncertain", activeOnlyHint: "Only the active Web session accepts messages.", acceptedHint: "Message accepted by OpenPI Web.", stopTurn: "Stop current turn", stoppingTurn: "Stopping current turn…", stoppedTurn: "Current turn stopped.", pendingFollowUpsHint: "{{count}} messages queued", addWorkspace: "Add workspace", addWorkspaceMenu: "Add workspace...", archiveConversation: "Archive conversation", cancel: "Cancel", chooseWorkspaceHint: "Choose a workspace and describe the work", close: "Close", closeSearch: "Close search", collapseSidebar: "Collapse sidebar", confirmEdit: "OK", connected: "Connected", connecting: "Connecting", conversationName: "Conversation name", conversationOptions: "Conversation options", conversationTurns: "Conversation turns", copiedMessage: "Copied", copyMessage: "Copy message", copyFailed: "Copy failed. Please select and copy the message manually.", deleteWorkspace: "Delete workspace", describeTask: "Describe a task", editMessage: "Edit message", enterHint: "Enter to send, Shift+Enter for a new line.", expandSidebar: "Expand sidebar", importWorkspace: "Import workspace", loadingModels: "Loading models...", modelPreparing: "Preparing task...", modelRetrying: "Retrying model request...", modelRunning: "Working...", newSession: "New session", noConversations: "No conversations yet", noMatching: "No matching conversations", noModels: "No models available", noOutput: "no output", noSessions: "No sessions", openSidebar: "Open sidebar", promptMessage: "Send a message to the active Web session", promptReadonly: "A non-active session cannot receive prompts", promptStart: "Choose a workspace to begin.", promptTask: "Describe what you want to build.", queuedHint: "The message will be queued after the current turn.", reconnecting: "Reconnecting", removeWorkspace: "Remove from sidebar", renameConversation: "Rename conversation", renameWorkspace: "Rename workspace", save: "Save", searchConversations: "Search conversations", searchPlaceholder: "Search conversations...", selectModel: "Select model", selectWorkspace: "Select workspace", send: "Send", stepsLabel: "steps", switchingSession: "Switching session...", thinkingActive: "Thinking...", thinkingDone: "Thinking", unavailable: "Unavailable", ungrouped: "Ungrouped", untitledSession: "New session", workspaceDeleteConfirm: "The folder and conversation records will be kept. Its conversations will move to Ungrouped.", workspaceName: "Workspace name", workspaces: "Workspaces", }, }, zh: { translation: { conversationView: "会话视图", chatView: "对话", trajectory: "执行轨迹", trajectoryScope: "按记录顺序展示会话消息,不表示执行耗时,也不是完整模型请求。", trajectoryRunning: "任务仍在进行。已保存记录到达后自动更新;实时生成内容可在“对话”中查看。", trajectoryTruncated: "当前历史不完整:省略 {{entries}} 条记录、{{parts}} 个内容片段,{{messages}} 条消息被截断。", trajectoryEmpty: "尚无已保存记录。", trajectoryOverview: "记录顺序总览", trajectoryEarlier: "显示更早记录(已加载历史中还有 {{count}} 条)", trajectoryDetails: "记录详情", trajectoryRecordedAt: "记录时间", trajectoryEvidenceTruncated: "此证据在会话投影中已被截断。", trajectoryArguments: "工具参数", trajectoryRecordedContent: "已记录内容", trajectoryThinking: "模型返回的推理内容", trajectoryOutput: "工具结果", trajectoryMissingResult: "当前记录中没有可明确配对的结果。这不表示工具仍在运行。", trajectoryStructured: "结构化结果", trajectoryEventOnly: "当前仅提供此事件的类型和记录时间。", trajectory_user: "用户 Prompt", trajectory_assistant: "模型消息", trajectory_call: "工具调用", trajectory_result: "未配对结果", trajectory_event: "会话事件", trajectory_returned: "工具已成功返回;其启动的后台任务可能仍在进行。", trajectory_error: "工具返回错误", trajectory_unknown: "尚无法确定结果", runtimeStatus: "运行状态", refreshStatus: "刷新状态", terminalDetails: "终端详情", inspectionChanged: "当前会话已切换,请重新打开详情。", inspectionUnavailable: "暂时无法读取详情。", inspectionLoading: "正在读取状态…", thinkingUnavailable: "暂时无法读取思考等级。", trustUnavailable: "暂时无法读取项目信任状态。", authUnavailable: "暂时无法读取服务商状态。", executionState: "状态", terminalCommand: "命令", terminalDirectory: "目录", startedAt: "启动时间", exitCode: "退出码", detailTruncated: "部分详情已截断,以限制页面加载量。", standardOutput: "标准输出", standardError: "错误输出", outputTruncated: "此输出视图省略了 {{count}} 字节。", outputRecovery: "运行时报告已保留日志;此处仅显示有大小限制的片段。", modelAndThinking: "模型与思考", selectedModel: "当前模型", thinkingLevel: "思考等级", availableThinking: "支持的等级", unknownState: "未知", projectTrust: "项目信任", trust_trusted: "当前会话信任此工作区。", trust_untrusted: "此工作区的信任已被拒绝。", trust_restricted: "项目资源受到限制,等待信任决定。", trust_unknown: "尚无法确定信任状态。", trustRefreshNeeded: "保存的信任决定与当前会话不同,请通过 Pi 刷新会话后生效。", providerAvailability: "服务商凭据", credentialConfigured: "已配置", credentialMissing: "未配置", noProviders: "未发现服务商。", providersBounded: "服务商列表已截断。", authNotVerified: "凭据已配置不代表模型请求一定成功。", configurationViaPi: "此处为只读状态。模型凭据与信任由 Pi 管理,OpenPI 选项通过 /openpi-setup 配置。", statusCaptured: "采集于 {{time}} · 刷新查看最新状态", conversationViews: "会话视图", currentConversations: "当前", archivedConversations: "已归档", restoreConversation: "恢复会话", restoringConversation: "正在恢复…", loadedArchives: "已加载历史中的归档会话", loadedHistoryBounded: "另有 {{sessions}} 个会话和 {{workspaces}} 个工作区摘要未加载。搜索仅覆盖已加载列表。", noLoadedArchives: "已加载列表中没有归档会话。", restoreFailed: "暂时无法确认恢复结果,请刷新后重试。", execution_running: "运行中", execution_done: "已完成", execution_killed: "已停止", execution_timed_out: "已超时", execution_failed: "失败", execution_uncertain: "状态不确定", activeOnlyHint: "只有当前 Web 会话可以接收消息。", stopTurn: "停止当前轮次", stoppingTurn: "正在停止当前轮次…", stoppedTurn: "当前轮次已停止。", pendingFollowUpsHint: "{{count}} 条消息正在排队", acceptedHint: "OpenPI Web 已接收消息。", addWorkspace: "添加工作区", addWorkspaceMenu: "添加工作区...", archiveConversation: "归档会话", cancel: "取消", chooseWorkspaceHint: "选择工作区并描述任务", close: "关闭", closeSearch: "关闭搜索", collapseSidebar: "收起侧边栏", confirmEdit: "确定", connected: "已连接", connecting: "正在连接", conversationName: "会话名称", conversationOptions: "会话选项", conversationTurns: "会话轮次", copiedMessage: "已复制", copyMessage: "复制消息", copyFailed: "复制失败,请选中消息后手动复制。", deleteWorkspace: "删除工作区", describeTask: "描述任务", editMessage: "编辑消息", enterHint: "按 Enter 发送,Shift+Enter 换行。", expandSidebar: "展开侧边栏", importWorkspace: "导入工作区", loadingModels: "正在加载模型...", modelPreparing: "正在准备任务...", modelRetrying: "模型请求重试中...", modelRunning: "正在运行...", newSession: "新建会话", noConversations: "暂无对话", noMatching: "没有匹配的会话", noModels: "没有可用模型", noOutput: "无输出", noSessions: "暂无会话", openSidebar: "打开侧边栏", promptMessage: "向当前 Web 会话发送消息", promptReadonly: "非当前会话不能接收消息", promptStart: "选择一个工作区开始", promptTask: "描述你想要构建的任务", queuedHint: "当前回合结束后将发送消息。", reconnecting: "正在重连", removeWorkspace: "从侧边栏移除", renameConversation: "重命名会话", renameWorkspace: "重命名工作区", save: "保存", searchConversations: "搜索会话", searchPlaceholder: "搜索会话...", selectModel: "选择模型", selectWorkspace: "选择工作区", send: "发送", stepsLabel: "个步骤", switchingSession: "正在切换会话...", thinkingActive: "思考中...", thinkingDone: "思考过程", unavailable: "不可用", ungrouped: "未分组", untitledSession: "新会话", workspaceDeleteConfirm: "文件夹与会话记录会保留,其中的会话会被放到“未分组”;再次打开此目录时将是一个干净的工作区。", workspaceName: "工作区名称", workspaces: "工作区", }, }, } as const; const language = navigator.language?.toLowerCase().startsWith("zh") ? "zh" : "en"; void i18n.use(initReactI18next).init({ fallbackLng: "en", initAsync: false, interpolation: { escapeValue: false }, lng: language, resources, }); document.documentElement.lang = language === "zh" ? "zh-CN" : "en"; export { i18n };