diff --git a/frontend/src/core/i18n/locales/en-US.ts b/frontend/src/core/i18n/locales/en-US.ts index eea40584..a03cc86f 100644 --- a/frontend/src/core/i18n/locales/en-US.ts +++ b/frontend/src/core/i18n/locales/en-US.ts @@ -48,6 +48,10 @@ export const enUS: Translations = { save: "Save", install: "Install", create: "Create", + export: "Export", + exportAsMarkdown: "Export as Markdown", + exportAsJSON: "Export as JSON", + exportSuccess: "Conversation exported", removeAttachment: "Remove attachment", }, @@ -286,6 +290,26 @@ export const enUS: Translations = { failed: "Subtask failed", }, + // Token Usage + tokenUsage: { + title: "Token Usage", + input: "Input", + output: "Output", + total: "Total", + }, + + // Shortcuts + shortcuts: { + searchActions: "Search actions...", + noResults: "No results found.", + actions: "Actions", + keyboardShortcuts: "Keyboard Shortcuts", + keyboardShortcutsDescription: + "Navigate DeerFlow faster with keyboard shortcuts.", + openCommandPalette: "Open Command Palette", + toggleSidebar: "Toggle Sidebar", + }, + // Settings settings: { title: "Settings", diff --git a/frontend/src/core/i18n/locales/types.ts b/frontend/src/core/i18n/locales/types.ts index 45f5d820..8a2cab92 100644 --- a/frontend/src/core/i18n/locales/types.ts +++ b/frontend/src/core/i18n/locales/types.ts @@ -37,6 +37,10 @@ export interface Translations { save: string; install: string; create: string; + export: string; + exportAsMarkdown: string; + exportAsJSON: string; + exportSuccess: string; removeAttachment: string; }; @@ -216,6 +220,25 @@ export interface Translations { failed: string; }; + // Token Usage + tokenUsage: { + title: string; + input: string; + output: string; + total: string; + }; + + // Shortcuts + shortcuts: { + searchActions: string; + noResults: string; + actions: string; + keyboardShortcuts: string; + keyboardShortcutsDescription: string; + openCommandPalette: string; + toggleSidebar: string; + }; + // Settings settings: { title: string; diff --git a/frontend/src/core/i18n/locales/zh-CN.ts b/frontend/src/core/i18n/locales/zh-CN.ts index 90509445..75e50fa4 100644 --- a/frontend/src/core/i18n/locales/zh-CN.ts +++ b/frontend/src/core/i18n/locales/zh-CN.ts @@ -48,6 +48,10 @@ export const zhCN: Translations = { save: "保存", install: "安装", create: "创建", + export: "导出", + exportAsMarkdown: "导出为 Markdown", + exportAsJSON: "导出为 JSON", + exportSuccess: "对话已导出", removeAttachment: "移除附件", }, @@ -277,6 +281,25 @@ export const zhCN: Translations = { failed: "子任务失败", }, + // Token Usage + tokenUsage: { + title: "Token 用量", + input: "输入", + output: "输出", + total: "总计", + }, + + // Shortcuts + shortcuts: { + searchActions: "搜索操作...", + noResults: "未找到结果。", + actions: "操作", + keyboardShortcuts: "键盘快捷键", + keyboardShortcutsDescription: "使用键盘快捷键更快地操作 DeerFlow。", + openCommandPalette: "打开命令面板", + toggleSidebar: "切换侧边栏", + }, + // Settings settings: { title: "设置", diff --git a/frontend/src/core/messages/utils.ts b/frontend/src/core/messages/utils.ts index 92951ca6..423d3f2e 100644 --- a/frontend/src/core/messages/utils.ts +++ b/frontend/src/core/messages/utils.ts @@ -317,6 +317,14 @@ export interface UploadedFile { path: string; } +// Compatibility type for newer UI modules. +export interface FileInMessage { + filename: string; + size: string | number; + path?: string; + status?: "uploading" | "uploaded"; +} + /** * Result of parsing uploaded files from message content */ @@ -363,3 +371,9 @@ export function parseUploadedFiles(content: string): ParsedUploadedFiles { return { files, cleanContent }; } + +export function stripUploadedFilesTag(content: string): string { + return content + .replace(/[\s\S]*?<\/uploaded_files>/g, "") + .trim(); +}