feat(frontend): 合并 i18n 模式与消息工具兼容
This commit is contained in:
parent
c67dad6db5
commit
e6e23925c2
|
|
@ -48,6 +48,10 @@ export const enUS: Translations = {
|
||||||
save: "Save",
|
save: "Save",
|
||||||
install: "Install",
|
install: "Install",
|
||||||
create: "Create",
|
create: "Create",
|
||||||
|
export: "Export",
|
||||||
|
exportAsMarkdown: "Export as Markdown",
|
||||||
|
exportAsJSON: "Export as JSON",
|
||||||
|
exportSuccess: "Conversation exported",
|
||||||
removeAttachment: "Remove attachment",
|
removeAttachment: "Remove attachment",
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
@ -286,6 +290,26 @@ export const enUS: Translations = {
|
||||||
failed: "Subtask failed",
|
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
|
||||||
settings: {
|
settings: {
|
||||||
title: "Settings",
|
title: "Settings",
|
||||||
|
|
|
||||||
|
|
@ -37,6 +37,10 @@ export interface Translations {
|
||||||
save: string;
|
save: string;
|
||||||
install: string;
|
install: string;
|
||||||
create: string;
|
create: string;
|
||||||
|
export: string;
|
||||||
|
exportAsMarkdown: string;
|
||||||
|
exportAsJSON: string;
|
||||||
|
exportSuccess: string;
|
||||||
removeAttachment: string;
|
removeAttachment: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -216,6 +220,25 @@ export interface Translations {
|
||||||
failed: string;
|
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
|
||||||
settings: {
|
settings: {
|
||||||
title: string;
|
title: string;
|
||||||
|
|
|
||||||
|
|
@ -48,6 +48,10 @@ export const zhCN: Translations = {
|
||||||
save: "保存",
|
save: "保存",
|
||||||
install: "安装",
|
install: "安装",
|
||||||
create: "创建",
|
create: "创建",
|
||||||
|
export: "导出",
|
||||||
|
exportAsMarkdown: "导出为 Markdown",
|
||||||
|
exportAsJSON: "导出为 JSON",
|
||||||
|
exportSuccess: "对话已导出",
|
||||||
removeAttachment: "移除附件",
|
removeAttachment: "移除附件",
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
@ -277,6 +281,25 @@ export const zhCN: Translations = {
|
||||||
failed: "子任务失败",
|
failed: "子任务失败",
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// Token Usage
|
||||||
|
tokenUsage: {
|
||||||
|
title: "Token 用量",
|
||||||
|
input: "输入",
|
||||||
|
output: "输出",
|
||||||
|
total: "总计",
|
||||||
|
},
|
||||||
|
|
||||||
|
// Shortcuts
|
||||||
|
shortcuts: {
|
||||||
|
searchActions: "搜索操作...",
|
||||||
|
noResults: "未找到结果。",
|
||||||
|
actions: "操作",
|
||||||
|
keyboardShortcuts: "键盘快捷键",
|
||||||
|
keyboardShortcutsDescription: "使用键盘快捷键更快地操作 DeerFlow。",
|
||||||
|
openCommandPalette: "打开命令面板",
|
||||||
|
toggleSidebar: "切换侧边栏",
|
||||||
|
},
|
||||||
|
|
||||||
// Settings
|
// Settings
|
||||||
settings: {
|
settings: {
|
||||||
title: "设置",
|
title: "设置",
|
||||||
|
|
|
||||||
|
|
@ -317,6 +317,14 @@ export interface UploadedFile {
|
||||||
path: string;
|
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
|
* Result of parsing uploaded files from message content
|
||||||
*/
|
*/
|
||||||
|
|
@ -363,3 +371,9 @@ export function parseUploadedFiles(content: string): ParsedUploadedFiles {
|
||||||
|
|
||||||
return { files, cleanContent };
|
return { files, cleanContent };
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function stripUploadedFilesTag(content: string): string {
|
||||||
|
return content
|
||||||
|
.replace(/<uploaded_files>[\s\S]*?<\/uploaded_files>/g, "")
|
||||||
|
.trim();
|
||||||
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue