修复核心UI文本的i18n问题:支持多语言切换
主要修复: - 右键菜单:在此处打开终端、运行、保存到系统 - 拖拽提示:拖拽系统文件到此处上传、拖拽文件到窗口外下载 - 终端窗口标题和状态提示 - 错误消息:没有选择主机、只能运行可执行文件 - 添加完整的中英文翻译条目 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -714,7 +714,19 @@
|
||||
"sshStatusCheckTimeout": "SSH status check timed out",
|
||||
"sshReconnectionTimeout": "SSH reconnection timed out",
|
||||
"saveOperationTimeout": "Save operation timed out",
|
||||
"cannotSaveFile": "Cannot save file"
|
||||
"cannotSaveFile": "Cannot save file",
|
||||
"dragSystemFilesToUpload": "Drag system files here to upload",
|
||||
"dragFilesToWindowToDownload": "Drag files outside window to download",
|
||||
"openTerminalHere": "Open Terminal Here",
|
||||
"run": "Run",
|
||||
"saveToSystem": "Save to System",
|
||||
"selectLocationToSave": "Select Location to Save",
|
||||
"openTerminalInFolder": "Open Terminal in This Folder",
|
||||
"openTerminalInFileLocation": "Open Terminal at File Location",
|
||||
"terminalWithPath": "Terminal - {{host}}:{{path}}",
|
||||
"runningFile": "Running - {{file}}",
|
||||
"onlyRunExecutableFiles": "Can only run executable files",
|
||||
"noHostSelected": "No host selected"
|
||||
},
|
||||
"tunnels": {
|
||||
"title": "SSH Tunnels",
|
||||
|
||||
@@ -705,6 +705,18 @@
|
||||
"confirmDeleteMessage": "确定要删除 <strong>{{name}}</strong> 吗?",
|
||||
"deleteDirectoryWarning": "这将删除文件夹及其所有内容。",
|
||||
"actionCannotBeUndone": "此操作无法撤销。",
|
||||
"dragSystemFilesToUpload": "拖拽系统文件到此处上传",
|
||||
"dragFilesToWindowToDownload": "拖拽文件到窗口外下载",
|
||||
"openTerminalHere": "在此处打开终端",
|
||||
"run": "运行",
|
||||
"saveToSystem": "保存到系统",
|
||||
"selectLocationToSave": "选择位置保存",
|
||||
"openTerminalInFolder": "在此文件夹打开终端",
|
||||
"openTerminalInFileLocation": "在文件位置打开终端",
|
||||
"terminalWithPath": "终端 - {{host}}:{{path}}",
|
||||
"runningFile": "运行 - {{file}}",
|
||||
"onlyRunExecutableFiles": "只能运行可执行文件",
|
||||
"noHostSelected": "没有选择主机",
|
||||
"recent": "最近的",
|
||||
"pinned": "固定的",
|
||||
"folderShortcuts": "文件夹快捷方式",
|
||||
|
||||
@@ -206,7 +206,7 @@ export function FileManagerContextMenu({
|
||||
|
||||
menuItems.push({
|
||||
icon: <Terminal className="w-4 h-4" />,
|
||||
label: files[0].type === 'directory' ? "在此文件夹打开终端" : "在文件位置打开终端",
|
||||
label: files[0].type === 'directory' ? t("fileManager.openTerminalInFolder") : t("fileManager.openTerminalInFileLocation"),
|
||||
action: () => onOpenTerminal(targetPath),
|
||||
shortcut: "Ctrl+T"
|
||||
});
|
||||
@@ -216,7 +216,7 @@ export function FileManagerContextMenu({
|
||||
if (isSingleFile && hasExecutableFiles && onRunExecutable) {
|
||||
menuItems.push({
|
||||
icon: <Play className="w-4 h-4" />,
|
||||
label: "运行",
|
||||
label: t("fileManager.run"),
|
||||
action: () => onRunExecutable(files[0]),
|
||||
shortcut: "Enter"
|
||||
});
|
||||
@@ -322,7 +322,7 @@ export function FileManagerContextMenu({
|
||||
if (onOpenTerminal && currentPath) {
|
||||
menuItems.push({
|
||||
icon: <Terminal className="w-4 h-4" />,
|
||||
label: "在此处打开终端",
|
||||
label: t("fileManager.openTerminalHere"),
|
||||
action: () => onOpenTerminal(currentPath),
|
||||
shortcut: "Ctrl+T"
|
||||
});
|
||||
|
||||
@@ -894,10 +894,10 @@ export function FileManagerGrid({
|
||||
<div className="text-center p-8 bg-background/95 border-2 border-dashed border-primary rounded-lg shadow-lg">
|
||||
<Upload className="w-16 h-16 mx-auto mb-4 text-primary" />
|
||||
<p className="text-xl font-semibold text-foreground mb-2">
|
||||
拖拽文件到此处上传
|
||||
{t("fileManager.dragFilesToUpload")}
|
||||
</p>
|
||||
<p className="text-sm text-muted-foreground">
|
||||
从系统文件管理器拖拽文件到这里进行上传
|
||||
{t("fileManager.dragSystemFilesToUpload")}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
@@ -912,11 +912,11 @@ export function FileManagerGrid({
|
||||
<div className="space-y-3">
|
||||
<div className="flex items-center justify-center gap-2 text-sm text-muted-foreground bg-muted/50 rounded-md px-3 py-2">
|
||||
<Upload className="w-4 h-4" />
|
||||
拖拽系统文件到此处上传
|
||||
{t("fileManager.dragSystemFilesToUpload")}
|
||||
</div>
|
||||
<div className="flex items-center justify-center gap-2 text-sm text-muted-foreground bg-muted/50 rounded-md px-3 py-2">
|
||||
<Download className="w-4 h-4" />
|
||||
拖拽文件到窗口外下载
|
||||
{t("fileManager.dragFilesToWindowToDownload")}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1141,7 +1141,7 @@ function FileManagerContent({ initialHost, onClose }: FileManagerModernProps) {
|
||||
// 打开终端处理函数
|
||||
function handleOpenTerminal(path: string) {
|
||||
if (!currentHost) {
|
||||
toast.error("没有选择主机");
|
||||
toast.error(t("fileManager.noHostSelected"));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1172,18 +1172,18 @@ function FileManagerContent({ initialHost, onClose }: FileManagerModernProps) {
|
||||
component: createTerminalComponent
|
||||
});
|
||||
|
||||
toast.success(`在 ${path} 打开终端`);
|
||||
toast.success(t("fileManager.terminalWithPath", { host: currentHost.name, path }));
|
||||
}
|
||||
|
||||
// 运行可执行文件处理函数
|
||||
function handleRunExecutable(file: FileItem) {
|
||||
if (!currentHost) {
|
||||
toast.error("没有选择主机");
|
||||
toast.error(t("fileManager.noHostSelected"));
|
||||
return;
|
||||
}
|
||||
|
||||
if (file.type !== 'file' || !file.executable) {
|
||||
toast.error("只能运行可执行文件");
|
||||
toast.error(t("fileManager.onlyRunExecutableFiles"));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1209,7 +1209,7 @@ function FileManagerContent({ initialHost, onClose }: FileManagerModernProps) {
|
||||
);
|
||||
|
||||
openWindow({
|
||||
title: `运行 - ${file.name}`,
|
||||
title: t("fileManager.runningFile", { file: file.name }),
|
||||
x: offsetX,
|
||||
y: offsetY,
|
||||
width: 800,
|
||||
@@ -1219,7 +1219,7 @@ function FileManagerContent({ initialHost, onClose }: FileManagerModernProps) {
|
||||
component: createExecutionTerminal
|
||||
});
|
||||
|
||||
toast.success(`正在运行: ${file.name}`);
|
||||
toast.success(t("fileManager.runningFile", { file: file.name }));
|
||||
}
|
||||
|
||||
// 过滤文件并添加新建的临时项目
|
||||
|
||||
Reference in New Issue
Block a user