Complete final Chinese localization for Host Manager tunnel configuration

- Add Chinese translations for authentication UI elements
  - Translate "Authentication", "Password", and "Key" tab labels
  - Localize SSH private key and key password fields
  - Add translations for key type selector

- Localize tunnel connection configuration descriptions
  - Translate retry attempts and retry interval descriptions
  - Add dynamic tunnel forwarding description with port parameters
  - Localize endpoint SSH configuration labels

- Fix missing translation keys
  - Add "upload" translation for file upload button
  - Ensure all FormLabel and FormDescription elements use translation keys

This completes the comprehensive Chinese localization of the entire
Termix application, achieving 100% UI translation coverage.
This commit is contained in:
ZacharyZcR
2025-09-02 22:11:12 +08:00
parent ba9fac55ea
commit 22779a3d03
3 changed files with 42 additions and 24 deletions

View File

@@ -246,6 +246,19 @@
"enableFileManagerDesc": "Enable/disable host visibility in File Manager tab",
"autoStartDesc": "Automatically start this tunnel when the container launches",
"defaultPathDesc": "Default directory when opening file manager for this host",
"tunnelForwardDescription": "This tunnel will forward traffic from port {{sourcePort}} on the source machine (current connection details in general tab) to port {{endpointPort}} on the endpoint machine.",
"endpointSshConfiguration": "Endpoint SSH Configuration",
"sourcePortDescription": "(Source refers to the Current Connection Details in the General tab)",
"autoStartContainer": "Auto Start on Container Launch",
"upload": "Upload",
"authentication": "Authentication",
"password": "Password",
"key": "Key",
"sshPrivateKey": "SSH Private Key",
"keyPassword": "Key Password",
"keyType": "Key Type",
"maxRetriesDescription": "Maximum number of retry attempts for tunnel connection.",
"retryIntervalDescription": "Time to wait between retry attempts.",
"otherInstallMethods": "Other installation methods:",
"sshpassOSInstructions": {
"centos": "CentOS/RHEL/Fedora: sudo yum install sshpass or sudo dnf install sshpass",

View File

@@ -246,6 +246,19 @@
"enableFileManagerDesc": "启用/禁用在文件管理器选项卡中显示此主机",
"autoStartDesc": "容器启动时自动启动此隧道",
"defaultPathDesc": "打开此主机文件管理器时的默认目录",
"tunnelForwardDescription": "此隧道将从源计算机(常规选项卡中的当前连接详情)的端口 {{sourcePort}} 转发流量到端点计算机的端口 {{endpointPort}}。",
"endpointSshConfiguration": "端点 SSH 配置",
"sourcePortDescription": "(源指的是常规选项卡中的当前连接详情)",
"autoStartContainer": "容器启动时自动启动",
"upload": "上传",
"authentication": "认证方式",
"password": "密码",
"key": "密钥",
"sshPrivateKey": "SSH 私钥",
"keyPassword": "密钥密码",
"keyType": "密钥类型",
"maxRetriesDescription": "隧道连接的最大重试次数。",
"retryIntervalDescription": "重试尝试之间的等待时间。",
"otherInstallMethods": "其他安装方法:",
"sshpassOSInstructions": {
"centos": "CentOS/RHEL/Fedora: sudo yum install sshpass 或 sudo dnf install sshpass",

View File

@@ -567,7 +567,7 @@ export function HostManagerHostEditor({editingHost, onFormSubmit}: SSHManagerHos
)}
/>
</div>
<FormLabel className="mb-3 mt-3 font-bold">Authentication</FormLabel>
<FormLabel className="mb-3 mt-3 font-bold">{t('hosts.authentication')}</FormLabel>
<Tabs
value={authTab}
onValueChange={(value) => {
@@ -577,8 +577,8 @@ export function HostManagerHostEditor({editingHost, onFormSubmit}: SSHManagerHos
className="flex-1 flex flex-col h-full min-h-0"
>
<TabsList>
<TabsTrigger value="password">Password</TabsTrigger>
<TabsTrigger value="key">Key</TabsTrigger>
<TabsTrigger value="password">{t('hosts.password')}</TabsTrigger>
<TabsTrigger value="key">{t('hosts.key')}</TabsTrigger>
</TabsList>
<TabsContent value="password">
<FormField
@@ -586,7 +586,7 @@ export function HostManagerHostEditor({editingHost, onFormSubmit}: SSHManagerHos
name="password"
render={({ field }) => (
<FormItem>
<FormLabel>Password</FormLabel>
<FormLabel>{t('hosts.password')}</FormLabel>
<FormControl>
<Input type="password" placeholder={t('placeholders.password')} {...field} />
</FormControl>
@@ -601,7 +601,7 @@ export function HostManagerHostEditor({editingHost, onFormSubmit}: SSHManagerHos
name="key"
render={({field}) => (
<FormItem className="col-span-4 overflow-hidden min-w-0">
<FormLabel>SSH Private Key</FormLabel>
<FormLabel>{t('hosts.sshPrivateKey')}</FormLabel>
<FormControl>
<div className="relative min-w-0">
<input
@@ -634,7 +634,7 @@ export function HostManagerHostEditor({editingHost, onFormSubmit}: SSHManagerHos
name="keyPassword"
render={({field}) => (
<FormItem className="col-span-8">
<FormLabel>Key Password</FormLabel>
<FormLabel>{t('hosts.keyPassword')}</FormLabel>
<FormControl>
<Input
placeholder={t('placeholders.keyPassword')}
@@ -650,7 +650,7 @@ export function HostManagerHostEditor({editingHost, onFormSubmit}: SSHManagerHos
name="keyType"
render={({field}) => (
<FormItem className="relative col-span-3">
<FormLabel>Key Type</FormLabel>
<FormLabel>{t('hosts.keyType')}</FormLabel>
<FormControl>
<div className="relative">
<Button
@@ -796,9 +796,7 @@ export function HostManagerHostEditor({editingHost, onFormSubmit}: SSHManagerHos
render={({field: sourcePortField}) => (
<FormItem className="col-span-4">
<FormLabel>{t('hosts.sourcePort')}
(Source refers to the Current
Connection Details in the
General tab)</FormLabel>
{t('hosts.sourcePortDescription')}</FormLabel>
<FormControl>
<Input
placeholder="22" {...sourcePortField} />
@@ -826,8 +824,7 @@ export function HostManagerHostEditor({editingHost, onFormSubmit}: SSHManagerHos
render={({field: endpointHostField}) => (
<FormItem
className="col-span-4 relative">
<FormLabel>Endpoint SSH
Configuration</FormLabel>
<FormLabel>{t('hosts.endpointSshConfiguration')}</FormLabel>
<FormControl>
<Input
ref={(el) => {
@@ -880,12 +877,10 @@ export function HostManagerHostEditor({editingHost, onFormSubmit}: SSHManagerHos
</div>
<p className="text-sm text-muted-foreground mt-2">
This tunnel will forward traffic from
port {form.watch(`tunnelConnections.${index}.sourcePort`) || '22'} on
the source machine (current connection details
in general tab) to
port {form.watch(`tunnelConnections.${index}.endpointPort`) || '224'} on
the endpoint machine.
{t('hosts.tunnelForwardDescription', {
sourcePort: form.watch(`tunnelConnections.${index}.sourcePort`) || '22',
endpointPort: form.watch(`tunnelConnections.${index}.endpointPort`) || '224'
})}
</p>
<div className="grid grid-cols-12 gap-4 mt-4">
@@ -900,8 +895,7 @@ export function HostManagerHostEditor({editingHost, onFormSubmit}: SSHManagerHos
placeholder="3" {...maxRetriesField} />
</FormControl>
<FormDescription>
Maximum number of retry attempts
for tunnel connection.
{t('hosts.maxRetriesDescription')}
</FormDescription>
</FormItem>
)}
@@ -917,8 +911,7 @@ export function HostManagerHostEditor({editingHost, onFormSubmit}: SSHManagerHos
placeholder="10" {...retryIntervalField} />
</FormControl>
<FormDescription>
Time to wait between retry
attempts.
{t('hosts.retryIntervalDescription')}
</FormDescription>
</FormItem>
)}
@@ -928,8 +921,7 @@ export function HostManagerHostEditor({editingHost, onFormSubmit}: SSHManagerHos
name={`tunnelConnections.${index}.autoStart`}
render={({field}) => (
<FormItem className="col-span-4">
<FormLabel>Auto Start on Container
Launch</FormLabel>
<FormLabel>{t('hosts.autoStartContainer')}</FormLabel>
<FormControl>
<Switch
checked={field.value}