Localize additional Host Manager components and authentication settings
- Added translations for all authentication options (Password, Key, SSH Private Key) - Localized form labels in HostManagerHostEditor (Pin Connection, Enable Terminal/Tunnel/FileManager) - Translated Upload/Update Key button states - Localized Host Viewer and Add/Edit Host tab labels - Added Chinese translations for all host management settings - Fixed duplicate translation keys in JSON files Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -620,6 +620,26 @@
|
||||
"updateHost": "Update Host",
|
||||
"addHost": "Add Host",
|
||||
"editHost": "Edit Host",
|
||||
"pinConnection": "Pin Connection",
|
||||
"authentication": "Authentication",
|
||||
"password": "Password",
|
||||
"key": "Key",
|
||||
"sshPrivateKey": "SSH Private Key",
|
||||
"keyPassword": "Key Password",
|
||||
"keyType": "Key Type",
|
||||
"enableTerminal": "Enable Terminal",
|
||||
"enableTunnel": "Enable Tunnel",
|
||||
"enableFileManager": "Enable File Manager",
|
||||
"defaultPath": "Default Path",
|
||||
"tunnelConnections": "Tunnel Connections",
|
||||
"maxRetries": "Max Retries",
|
||||
"upload": "Upload",
|
||||
"updateKey": "Update Key",
|
||||
"hostViewer": "Host Viewer",
|
||||
"sshpassRequired": "Sshpass Required For Password Authentication",
|
||||
"sshServerConfigRequired": "SSH Server Configuration Required",
|
||||
"sshManagerAlreadyOpen": "SSH Manager already open",
|
||||
"disabledDuringSplitScreen": "Disabled during split screen",
|
||||
"productionFolder": "Production",
|
||||
"databaseServer": "Database Server",
|
||||
"unknownError": "Unknown error",
|
||||
|
||||
@@ -620,6 +620,26 @@
|
||||
"updateHost": "更新主机",
|
||||
"addHost": "添加主机",
|
||||
"editHost": "编辑主机",
|
||||
"pinConnection": "固定连接",
|
||||
"authentication": "认证",
|
||||
"password": "密码",
|
||||
"key": "密钥",
|
||||
"sshPrivateKey": "SSH 私钥",
|
||||
"keyPassword": "密钥密码",
|
||||
"keyType": "密钥类型",
|
||||
"enableTerminal": "启用终端",
|
||||
"enableTunnel": "启用隧道",
|
||||
"enableFileManager": "启用文件管理器",
|
||||
"defaultPath": "默认路径",
|
||||
"tunnelConnections": "隧道连接",
|
||||
"maxRetries": "最大重试次数",
|
||||
"upload": "上传",
|
||||
"updateKey": "更新密钥",
|
||||
"hostViewer": "主机查看器",
|
||||
"sshpassRequired": "密码认证需要 Sshpass",
|
||||
"sshServerConfigRequired": "需要 SSH 服务器配置",
|
||||
"sshManagerAlreadyOpen": "SSH 管理器已打开",
|
||||
"disabledDuringSplitScreen": "分屏期间禁用",
|
||||
"productionFolder": "生产环境",
|
||||
"databaseServer": "数据库服务器",
|
||||
"unknownError": "未知错误",
|
||||
|
||||
@@ -4,6 +4,7 @@ import {Tabs, TabsContent, TabsList, TabsTrigger} from "@/components/ui/tabs.tsx
|
||||
import {Separator} from "@/components/ui/separator.tsx";
|
||||
import {HostManagerHostEditor} from "@/ui/Apps/Host Manager/HostManagerHostEditor.tsx";
|
||||
import {useSidebar} from "@/components/ui/sidebar.tsx";
|
||||
import {useTranslation} from "react-i18next";
|
||||
|
||||
interface HostManagerProps {
|
||||
onSelectView: (view: string) => void;
|
||||
@@ -34,6 +35,7 @@ interface SSHHost {
|
||||
}
|
||||
|
||||
export function HostManager({onSelectView, isTopbarOpen}: HostManagerProps): React.ReactElement {
|
||||
const {t} = useTranslation();
|
||||
const [activeTab, setActiveTab] = useState("host_viewer");
|
||||
const [editingHost, setEditingHost] = useState<SSHHost | null>(null);
|
||||
const {state: sidebarState} = useSidebar();
|
||||
@@ -75,9 +77,9 @@ export function HostManager({onSelectView, isTopbarOpen}: HostManagerProps): Rea
|
||||
<Tabs value={activeTab} onValueChange={handleTabChange}
|
||||
className="flex-1 flex flex-col h-full min-h-0">
|
||||
<TabsList className="bg-[#18181b] border-2 border-[#303032] mt-1.5">
|
||||
<TabsTrigger value="host_viewer">Host Viewer</TabsTrigger>
|
||||
<TabsTrigger value="host_viewer">{t('hosts.hostViewer')}</TabsTrigger>
|
||||
<TabsTrigger value="add_host">
|
||||
{editingHost ? "Edit Host" : "Add Host"}
|
||||
{editingHost ? t('hosts.editHost') : t('hosts.addHost')}
|
||||
</TabsTrigger>
|
||||
</TabsList>
|
||||
<TabsContent value="host_viewer" className="flex-1 flex flex-col h-full min-h-0">
|
||||
|
||||
@@ -621,7 +621,7 @@ export function HostManagerHostEditor({editingHost, onFormSubmit}: SSHManagerHos
|
||||
>
|
||||
<span className="block w-full truncate"
|
||||
title={field.value?.name || 'Upload'}>
|
||||
{field.value ? (editingHost ? 'Update Key' : field.value.name) : 'Upload'}
|
||||
{field.value ? (editingHost ? t('hosts.updateKey') : field.value.name) : t('hosts.upload')}
|
||||
</span>
|
||||
</Button>
|
||||
</div>
|
||||
@@ -785,7 +785,7 @@ export function HostManagerHostEditor({editingHost, onFormSubmit}: SSHManagerHos
|
||||
name="tunnelConnections"
|
||||
render={({field}) => (
|
||||
<FormItem className="mt-4">
|
||||
<FormLabel>Tunnel Connections</FormLabel>
|
||||
<FormLabel>{t('hosts.tunnelConnections')}</FormLabel>
|
||||
<FormControl>
|
||||
<div className="space-y-4">
|
||||
{field.value.map((connection, index) => (
|
||||
@@ -1041,7 +1041,7 @@ export function HostManagerHostEditor({editingHost, onFormSubmit}: SSHManagerHos
|
||||
transform: 'translateY(8px)'
|
||||
}}
|
||||
>
|
||||
{editingHost ? "Update Host" : "Add Host"}
|
||||
{editingHost ? t('hosts.updateHost') : t('hosts.addHost')}
|
||||
</Button>
|
||||
</footer>
|
||||
</form>
|
||||
|
||||
Reference in New Issue
Block a user