diff --git a/public/locales/en/translation.json b/public/locales/en/translation.json index ded2cf0a..6d01f9bd 100644 --- a/public/locales/en/translation.json +++ b/public/locales/en/translation.json @@ -1,4 +1,21 @@ { + "sshTools": { + "title": "SSH Tools", + "closeTools": "Close SSH Tools", + "keyRecording": "Key Recording", + "startKeyRecording": "Start Key Recording", + "stopKeyRecording": "Stop Key Recording", + "selectTerminals": "Select terminals:", + "typeCommands": "Type commands (all keys supported):", + "commandsWillBeSent": "Commands will be sent to {{count}} selected terminal(s).", + "settings": "Settings", + "enableRightClickCopyPaste": "Enable right‑click copy/paste", + "shareIdeas": "Have ideas for what should come next for ssh tools? Share them on" + }, + "homepage": { + "loggedInTitle": "Logged in!", + "loggedInMessage": "You are logged in! Use the sidebar to access all available tools. To get started, create an SSH Host in the SSH Manager tab. Once created, you can connect to that host using the other apps in the sidebar." + }, "common": { "close": "Close", "online": "Online", @@ -91,6 +108,7 @@ "splitScreen": "Split Screen", "closeTab": "Close Tab", "sshManager": "SSH Manager", + "hostManager": "Host Manager", "cannotSplitTab": "Cannot split this tab" }, "admin": { @@ -199,7 +217,46 @@ "connectionSuccess": "Connection Successful", "connectionDetails": "Connection Details", "organization": "Organization", - "addTags": "Add tags (space to add)" + "addTags": "Add tags (space to add)", + "sourcePort": "Source Port", + "endpointPort": "Endpoint Port", + "retryInterval": "Retry Interval (seconds)", + "connection": "Connection", + "remove": "Remove", + "addConnection": "Add Connection", + "sshpassRequired": "Sshpass Required For Password Authentication", + "sshpassInstallCommand": "Install Command: sudo apt install sshpass", + "sshServerConfig": "SSH Server Configuration Required", + "sshServerConfigInstructions": "Run the following commands to allow password authentication:", + "sshConfigCommand1": "sudo sed -i 's/#PasswordAuthentication yes/PasswordAuthentication yes/' /etc/ssh/sshd_config", + "sshConfigCommand2": "sudo systemctl restart sshd", + "localPortForwarding": "Local Port Forwarding", + "localPortForwardingDesc": "Forward a local port to a remote server through the SSH connection", + "remotePortForwarding": "Remote Port Forwarding", + "remotePortForwardingDesc": "Forward a remote port to a local server through the SSH connection", + "dynamicPortForwarding": "Dynamic Port Forwarding (SOCKS Proxy)", + "dynamicPortForwardingDesc": "Create a SOCKS proxy on the local machine to route traffic through the SSH connection", + "bindAddress": "Bind Address", + "hostViewer": "Host Viewer", + "configuration": "Configuration", + "maxRetries": "Max Retries", + "tunnelConnections": "Tunnel Connections", + "enableTerminalDesc": "Enable/disable host visibility in Terminal tab", + "enableTunnelDesc": "Enable/disable host visibility in Tunnel tab", + "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", + "otherInstallMethods": "Other installation methods:", + "sshpassOSInstructions": { + "centos": "CentOS/RHEL/Fedora: sudo yum install sshpass or sudo dnf install sshpass", + "macos": "macOS: brew install hudochenkov/sshpass/sshpass", + "windows": "Windows: Use WSL or consider SSH key authentication" + }, + "sshServerConfigReverse": "For reverse SSH tunnels, the endpoint SSH server must allow:", + "gatewayPorts": "GatewayPorts yes (bind remote ports)", + "allowTcpForwarding": "AllowTcpForwarding yes (port forwarding)", + "permitRootLogin": "PermitRootLogin yes (if using root)", + "editSshConfig": "Edit /etc/ssh/sshd_config and restart SSH: sudo systemctl restart sshd" }, "terminal": { "title": "Terminal", @@ -619,7 +676,6 @@ "noSshHosts": "No SSH Hosts", "sshHosts": "SSH Hosts", "importSshHosts": "Import SSH Hosts from JSON", - "hostViewer": "Host Viewer", "clientId": "Client ID", "clientSecret": "Client Secret", "error": "Error", @@ -677,11 +733,6 @@ "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", diff --git a/public/locales/zh/translation.json b/public/locales/zh/translation.json index 1e15805d..d3291d74 100644 --- a/public/locales/zh/translation.json +++ b/public/locales/zh/translation.json @@ -1,4 +1,21 @@ { + "sshTools": { + "title": "SSH 工具", + "closeTools": "关闭 SSH 工具", + "keyRecording": "按键录制", + "startKeyRecording": "开始按键录制", + "stopKeyRecording": "停止按键录制", + "selectTerminals": "选择终端:", + "typeCommands": "输入命令(支持所有按键):", + "commandsWillBeSent": "命令将发送到 {{count}} 个选中的终端。", + "settings": "设置", + "enableRightClickCopyPaste": "启用右键复制/粘贴", + "shareIdeas": "对 SSH 工具有什么想法?在此分享" + }, + "homepage": { + "loggedInTitle": "登录成功!", + "loggedInMessage": "您已登录!使用侧边栏访问所有可用工具。要开始使用,请在 SSH 管理器选项卡中创建 SSH 主机。创建后,您可以使用侧边栏中的其他应用程序连接到该主机。" + }, "common": { "close": "关闭", "online": "在线", @@ -91,6 +108,7 @@ "splitScreen": "分屏", "closeTab": "关闭标签页", "sshManager": "SSH 管理器", + "hostManager": "主机管理器", "cannotSplitTab": "无法分割此标签页" }, "admin": { @@ -199,7 +217,46 @@ "connectionSuccess": "连接成功", "connectionDetails": "连接详情", "organization": "组织管理", - "addTags": "添加标签(空格添加)" + "addTags": "添加标签(空格添加)", + "sourcePort": "源端口", + "endpointPort": "目标端口", + "retryInterval": "重试间隔(秒)", + "connection": "连接", + "remove": "移除", + "addConnection": "添加连接", + "sshpassRequired": "密码认证需要安装 Sshpass", + "sshpassInstallCommand": "安装命令:sudo apt install sshpass", + "sshServerConfig": "需要配置 SSH 服务器", + "sshServerConfigInstructions": "运行以下命令以允许密码认证:", + "sshConfigCommand1": "sudo sed -i 's/#PasswordAuthentication yes/PasswordAuthentication yes/' /etc/ssh/sshd_config", + "sshConfigCommand2": "sudo systemctl restart sshd", + "localPortForwarding": "本地端口转发", + "localPortForwardingDesc": "通过 SSH 连接将本地端口转发到远程服务器", + "remotePortForwarding": "远程端口转发", + "remotePortForwardingDesc": "通过 SSH 连接将远程端口转发到本地服务器", + "dynamicPortForwarding": "动态端口转发(SOCKS 代理)", + "dynamicPortForwardingDesc": "在本地计算机上创建 SOCKS 代理,通过 SSH 连接路由流量", + "bindAddress": "绑定地址", + "hostViewer": "主机查看器", + "configuration": "配置", + "maxRetries": "最大重试次数", + "tunnelConnections": "隧道连接", + "enableTerminalDesc": "启用/禁用在终端选项卡中显示此主机", + "enableTunnelDesc": "启用/禁用在隧道选项卡中显示此主机", + "enableFileManagerDesc": "启用/禁用在文件管理器选项卡中显示此主机", + "autoStartDesc": "容器启动时自动启动此隧道", + "defaultPathDesc": "打开此主机文件管理器时的默认目录", + "otherInstallMethods": "其他安装方法:", + "sshpassOSInstructions": { + "centos": "CentOS/RHEL/Fedora: sudo yum install sshpass 或 sudo dnf install sshpass", + "macos": "macOS: brew install hudochenkov/sshpass/sshpass", + "windows": "Windows: 使用 WSL 或考虑使用 SSH 密钥认证" + }, + "sshServerConfigReverse": "对于反向 SSH 隧道,端点 SSH 服务器必须允许:", + "gatewayPorts": "GatewayPorts yes(绑定远程端口)", + "allowTcpForwarding": "AllowTcpForwarding yes(端口转发)", + "permitRootLogin": "PermitRootLogin yes(如果使用 root)", + "editSshConfig": "编辑 /etc/ssh/sshd_config 并重启 SSH: sudo systemctl restart sshd" }, "terminal": { "title": "终端", @@ -619,7 +676,6 @@ "noSshHosts": "没有 SSH 主机", "sshHosts": "SSH 主机", "importSshHosts": "从 JSON 导入 SSH 主机", - "hostViewer": "主机查看器", "clientId": "客户端 ID", "clientSecret": "客户端密钥", "error": "错误", @@ -677,7 +733,6 @@ "maxRetries": "最大重试次数", "upload": "上传", "updateKey": "更新密钥", - "hostViewer": "主机查看器", "sshpassRequired": "密码认证需要 Sshpass", "sshServerConfigRequired": "需要 SSH 服务器配置", "sshManagerAlreadyOpen": "SSH 管理器已打开", diff --git a/src/ui/Apps/Host Manager/HostManagerHostEditor.tsx b/src/ui/Apps/Host Manager/HostManagerHostEditor.tsx index 506baedc..40764152 100644 --- a/src/ui/Apps/Host Manager/HostManagerHostEditor.tsx +++ b/src/ui/Apps/Host Manager/HostManagerHostEditor.tsx @@ -701,7 +701,7 @@ export function HostManagerHostEditor({editingHost, onFormSubmit}: SSHManagerHos name="enableTerminal" render={({field}) => ( - Enable Terminal + {t('hosts.enableTerminal')} - Enable/disable host visibility in Terminal tab. + {t('hosts.enableTerminalDesc')} )} @@ -721,7 +721,7 @@ export function HostManagerHostEditor({editingHost, onFormSubmit}: SSHManagerHos name="enableTunnel" render={({field}) => ( - Enable Tunnel + {t('hosts.enableTunnel')} - Enable/disable host visibility in Tunnel tab. + {t('hosts.enableTunnelDesc')} )} @@ -739,44 +739,27 @@ export function HostManagerHostEditor({editingHost, onFormSubmit}: SSHManagerHos <> - Sshpass Required For Password Authentication + {t('hosts.sshpassRequired')}
- For password-based SSH authentication, sshpass must be installed on - both the local and remote servers. Install with: sudo apt install - sshpass (Debian/Ubuntu) or the equivalent for your OS. + {t('hosts.sshpassInstallCommand')}
- Other installation methods: -
• CentOS/RHEL/Fedora: sudo yum install - sshpass or sudo dnf install - sshpass
-
• macOS: brew - install hudochenkov/sshpass/sshpass
-
• Windows: Use WSL or consider SSH key authentication
+ {t('hosts.otherInstallMethods')} +
• {t('hosts.sshpassOSInstructions.centos')}
+
• {t('hosts.sshpassOSInstructions.macos')}
+
• {t('hosts.sshpassOSInstructions.windows')}
- SSH Server Configuration Required -
For reverse SSH tunnels, the endpoint SSH server must allow:
-
GatewayPorts - yes (bind remote ports) -
-
AllowTcpForwarding - yes (port forwarding) -
-
PermitRootLogin - yes (if using root) -
-
Edit /etc/ssh/sshd_config and - restart SSH: sudo - systemctl restart sshd
+ {t('hosts.sshServerConfig')} +
{t('hosts.sshServerConfigReverse')}
+
{t('hosts.gatewayPorts')}
+
{t('hosts.allowTcpForwarding')}
+
{t('hosts.permitRootLogin')}
+
{t('hosts.editSshConfig')}
@@ -793,7 +776,7 @@ export function HostManagerHostEditor({editingHost, onFormSubmit}: SSHManagerHos className="p-4 border rounded-lg bg-muted/50">
-

Connection {index + 1}

+

{t('hosts.connection')} {index + 1}

@@ -812,7 +795,7 @@ export function HostManagerHostEditor({editingHost, onFormSubmit}: SSHManagerHos name={`tunnelConnections.${index}.sourcePort`} render={({field: sourcePortField}) => ( - Source Port + {t('hosts.sourcePort')} (Source refers to the Current Connection Details in the General tab) @@ -828,7 +811,7 @@ export function HostManagerHostEditor({editingHost, onFormSubmit}: SSHManagerHos name={`tunnelConnections.${index}.endpointPort`} render={({field: endpointPortField}) => ( - Endpoint Port + {t('hosts.endpointPort')} (Remote) ( - Max Retries + {t('hosts.maxRetries', 'Max Retries')} @@ -928,8 +911,7 @@ export function HostManagerHostEditor({editingHost, onFormSubmit}: SSHManagerHos name={`tunnelConnections.${index}.retryInterval`} render={({field: retryIntervalField}) => ( - Retry Interval - (seconds) + {t('hosts.retryInterval')} @@ -955,8 +937,7 @@ export function HostManagerHostEditor({editingHost, onFormSubmit}: SSHManagerHos /> - Automatically start this tunnel - when the container launches. + {t('hosts.autoStartDesc')} )} @@ -978,7 +959,7 @@ export function HostManagerHostEditor({editingHost, onFormSubmit}: SSHManagerHos }]); }} > - Add Tunnel Connection + {t('hosts.addConnection')}
@@ -996,7 +977,7 @@ export function HostManagerHostEditor({editingHost, onFormSubmit}: SSHManagerHos name="enableFileManager" render={({field}) => ( - Enable File Manager + {t('hosts.enableFileManager')} - Enable/disable host visibility in File Manager tab. + {t('hosts.enableFileManagerDesc')} )} @@ -1017,12 +998,11 @@ export function HostManagerHostEditor({editingHost, onFormSubmit}: SSHManagerHos name="defaultPath" render={({field}) => ( - Default Path + {t('hosts.defaultPath')} - Set default directory shown when connected via - File Manager + {t('hosts.defaultPathDesc')} )} /> diff --git a/src/ui/Homepage/Homepage.tsx b/src/ui/Homepage/Homepage.tsx index b6fbe9ae..d96d86e5 100644 --- a/src/ui/Homepage/Homepage.tsx +++ b/src/ui/Homepage/Homepage.tsx @@ -4,6 +4,7 @@ import {HomepageUpdateLog} from "@/ui/Homepage/HompageUpdateLog.tsx"; import {HomepageAlertManager} from "@/ui/Homepage/HomepageAlertManager.tsx"; import {Button} from "@/components/ui/button.tsx"; import { getUserInfo, getDatabaseHealth } from "@/ui/main-axios.ts"; +import {useTranslation} from "react-i18next"; interface HomepageProps { onSelectView: (view: string) => void; @@ -32,6 +33,7 @@ export function Homepage({ onAuthSuccess, isTopbarOpen = true }: HomepageProps): React.ReactElement { + const {t} = useTranslation(); const [loggedIn, setLoggedIn] = useState(isAuthenticated); const [isAdmin, setIsAdmin] = useState(false); const [username, setUsername] = useState(null); @@ -95,11 +97,9 @@ export function Homepage({
-

Logged in!

+

{t('homepage.loggedInTitle')}

- You are logged in! Use the sidebar to access all available tools. To get started, - create an SSH Host in the SSH Manager tab. Once created, you can connect to that - host using the other apps in the sidebar. + {t('homepage.loggedInMessage')}

diff --git a/src/ui/Homepage/HompageUpdateLog.tsx b/src/ui/Homepage/HompageUpdateLog.tsx index c95f5bb0..28c1fa99 100644 --- a/src/ui/Homepage/HompageUpdateLog.tsx +++ b/src/ui/Homepage/HompageUpdateLog.tsx @@ -3,6 +3,7 @@ import {Alert, AlertDescription, AlertTitle} from "@/components/ui/alert.tsx"; import {Button} from "@/components/ui/button.tsx"; import {Separator} from "@/components/ui/separator.tsx"; import { getReleasesRSS, getVersionInfo } from "@/ui/main-axios.ts"; +import {useTranslation} from "react-i18next"; interface HomepageUpdateLogProps extends React.ComponentProps<"div"> { loggedIn: boolean; @@ -51,6 +52,7 @@ interface VersionResponse { } export function HomepageUpdateLog({loggedIn}: HomepageUpdateLogProps) { + const {t} = useTranslation(); const [releases, setReleases] = useState(null); const [versionInfo, setVersionInfo] = useState(null); const [loading, setLoading] = useState(false); @@ -90,7 +92,7 @@ export function HomepageUpdateLog({loggedIn}: HomepageUpdateLogProps) { return (
-

Updates & Releases

+

{t('common.updatesAndReleases')}

diff --git a/src/ui/Navigation/LeftSidebar.tsx b/src/ui/Navigation/LeftSidebar.tsx index 193451a8..06491099 100644 --- a/src/ui/Navigation/LeftSidebar.tsx +++ b/src/ui/Navigation/LeftSidebar.tsx @@ -433,9 +433,9 @@ export function LeftSidebar({ diff --git a/src/ui/Navigation/TopNavbar.tsx b/src/ui/Navigation/TopNavbar.tsx index aba75ebc..e96604cb 100644 --- a/src/ui/Navigation/TopNavbar.tsx +++ b/src/ui/Navigation/TopNavbar.tsx @@ -330,13 +330,13 @@ export function TopNavbar({isTopbarOpen, setIsTopbarOpen}: TopNavbarProps): Reac onClick={(e) => e.stopPropagation()} >
-

SSH Tools

+

{t('sshTools.title')}

@@ -345,7 +345,7 @@ export function TopNavbar({isTopbarOpen, setIsTopbarOpen}: TopNavbarProps): Reac

- Key Recording + {t('sshTools.keyRecording')}

@@ -357,7 +357,7 @@ export function TopNavbar({isTopbarOpen, setIsTopbarOpen}: TopNavbarProps): Reac className="flex-1" variant="outline" > - Start Key Recording + {t('sshTools.startKeyRecording')} ) : ( )}
@@ -373,8 +373,7 @@ export function TopNavbar({isTopbarOpen, setIsTopbarOpen}: TopNavbarProps): Reac {isRecording && ( <>
- +
{terminalTabs.map(tab => (