Add comprehensive Chinese internationalization support

- Implemented i18n framework with react-i18next for multi-language support
- Added Chinese (zh) and English (en) translation files with comprehensive coverage
- Localized Admin interface, authentication flows, and error messages
- Translated FileManager operations and UI elements
- Updated HomepageAuth component with localized authentication messages
- Localized LeftSidebar navigation and host management
- Added language switcher component (shown after login only)
- Configured default language as English with Chinese as secondary option
- Localized TOTPSetup two-factor authentication interface
- Updated Docker build to include translation files
- Achieved 95%+ UI localization coverage across core components

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
ZacharyZcR
2025-09-02 20:36:48 +08:00
parent 26c1cacc9d
commit 70a26359b6
24 changed files with 1805 additions and 362 deletions

View File

@@ -0,0 +1,593 @@
{
"common": {
"login": "Login",
"logout": "Logout",
"register": "Register",
"username": "Username",
"password": "Password",
"confirmPassword": "Confirm Password",
"back": "Back",
"email": "Email",
"submit": "Submit",
"cancel": "Cancel",
"save": "Save",
"delete": "Delete",
"edit": "Edit",
"add": "Add",
"search": "Search",
"loading": "Loading...",
"error": "Error",
"success": "Success",
"warning": "Warning",
"info": "Info",
"confirm": "Confirm",
"yes": "Yes",
"no": "No",
"ok": "OK",
"close": "Close",
"enabled": "Enabled",
"disabled": "Disabled",
"important": "Important",
"notEnabled": "Not Enabled",
"settingUp": "Setting up...",
"back": "Back",
"next": "Next",
"previous": "Previous",
"refresh": "Refresh",
"settings": "Settings",
"profile": "Profile",
"help": "Help",
"about": "About",
"language": "Language",
"autoDetect": "Auto-detect"
},
"nav": {
"home": "Home",
"hosts": "Hosts",
"terminal": "Terminal",
"tunnels": "Tunnels",
"fileManager": "File Manager",
"serverStats": "Server Stats",
"admin": "Admin",
"tools": "Tools",
"newTab": "New Tab",
"splitScreen": "Split Screen",
"closeTab": "Close Tab",
"sshManager": "SSH Manager",
"cannotSplitTab": "Cannot split this tab"
},
"admin": {
"title": "Admin Settings",
"users": "Users",
"userManagement": "User Management",
"makeAdmin": "Make Admin",
"removeAdmin": "Remove Admin",
"deleteUser": "Delete User",
"allowRegistration": "Allow Registration",
"oidcSettings": "OIDC Settings",
"clientId": "Client ID",
"clientSecret": "Client Secret",
"issuerUrl": "Issuer URL",
"authorizationUrl": "Authorization URL",
"tokenUrl": "Token URL",
"updateSettings": "Update Settings",
"confirmDelete": "Are you sure you want to delete this user?",
"confirmMakeAdmin": "Are you sure you want to make this user an admin?",
"confirmRemoveAdmin": "Are you sure you want to remove admin privileges from this user?",
"externalAuthentication": "External Authentication (OIDC)",
"configureExternalProvider": "Configure external identity provider for OIDC/OAuth2 authentication.",
"userIdentifierPath": "User Identifier Path",
"displayNamePath": "Display Name Path",
"scopes": "Scopes",
"saving": "Saving...",
"saveConfiguration": "Save Configuration",
"reset": "Reset",
"success": "Success",
"loading": "Loading...",
"refresh": "Refresh",
"loadingUsers": "Loading users...",
"username": "Username",
"type": "Type",
"actions": "Actions",
"external": "External",
"local": "Local",
"adminManagement": "Admin Management",
"makeUserAdmin": "Make User Admin",
"adding": "Adding...",
"currentAdmins": "Current Admins",
"adminBadge": "Admin",
"removeAdminButton": "Remove Admin"
},
"hosts": {
"title": "Host Manager",
"addHost": "Add Host",
"editHost": "Edit Host",
"deleteHost": "Delete Host",
"hostName": "Host Name",
"ipAddress": "IP Address",
"port": "Port",
"authType": "Authentication Type",
"passwordAuth": "Password",
"keyAuth": "SSH Key",
"keyPassword": "Key Password",
"keyType": "Key Type",
"folder": "Folder",
"tags": "Tags",
"pin": "Pin",
"enableTerminal": "Enable Terminal",
"enableTunnel": "Enable Tunnel",
"enableFileManager": "Enable File Manager",
"defaultPath": "Default Path",
"testConnection": "Test Connection",
"connect": "Connect",
"disconnect": "Disconnect",
"connected": "Connected",
"disconnected": "Disconnected",
"connecting": "Connecting...",
"connectionFailed": "Connection Failed",
"connectionSuccess": "Connection Successful",
"connectionDetails": "Connection Details",
"organization": "Organization",
"addTags": "Add tags (space to add)"
},
"terminal": {
"title": "Terminal",
"connect": "Connect to Host",
"disconnect": "Disconnect",
"clear": "Clear",
"copy": "Copy",
"paste": "Paste",
"find": "Find",
"fullscreen": "Fullscreen",
"splitHorizontal": "Split Horizontal",
"splitVertical": "Split Vertical",
"closePanel": "Close Panel",
"reconnect": "Reconnect",
"sessionEnded": "Session Ended",
"connectionLost": "Connection Lost",
"error": "ERROR",
"disconnected": "Disconnected",
"connectionClosed": "Connection closed",
"connectionError": "Connection error"
},
"fileManager": {
"title": "File Manager",
"file": "File",
"folder": "Folder",
"connectToSsh": "Connect to SSH to use file operations",
"uploadFile": "Upload File",
"newFile": "New File",
"newFolder": "New Folder",
"rename": "Rename",
"renameItem": "Rename Item",
"deleteItem": "Delete Item",
"currentPath": "Current Path",
"uploadFileTitle": "Upload File",
"maxFileSize": "Max: 100MB (JSON) / 200MB (Binary)",
"removeFile": "Remove File",
"clickToSelectFile": "Click to select a file",
"chooseFile": "Choose File",
"uploading": "Uploading...",
"createNewFile": "Create New File",
"fileName": "File Name",
"creating": "Creating...",
"createFile": "Create File",
"createNewFolder": "Create New Folder",
"folderName": "Folder Name",
"createFolder": "Create Folder",
"warningCannotUndo": "Warning: This action cannot be undone",
"itemPath": "Item Path",
"thisIsDirectory": "This is a directory (will delete recursively)",
"deleting": "Deleting...",
"currentPathLabel": "Current Path",
"newName": "New Name",
"thisIsDirectoryRename": "This is a directory",
"renaming": "Renaming...",
"fileUploadedSuccessfully": "File \"{{name}}\" uploaded successfully",
"failedToUploadFile": "Failed to upload file",
"fileCreatedSuccessfully": "File \"{{name}}\" created successfully",
"failedToCreateFile": "Failed to create file",
"folderCreatedSuccessfully": "Folder \"{{name}}\" created successfully",
"failedToCreateFolder": "Failed to create folder",
"itemDeletedSuccessfully": "{{type}} deleted successfully",
"failedToDeleteItem": "Failed to delete item",
"itemRenamedSuccessfully": "{{type}} renamed successfully",
"failedToRenameItem": "Failed to rename item",
"upload": "Upload",
"download": "Download",
"newFile": "New File",
"newFolder": "New Folder",
"rename": "Rename",
"delete": "Delete",
"permissions": "Permissions",
"size": "Size",
"modified": "Modified",
"path": "Path",
"fileName": "File Name",
"folderName": "Folder Name",
"confirmDelete": "Are you sure you want to delete {{name}}?",
"uploadSuccess": "File uploaded successfully",
"uploadFailed": "File upload failed",
"downloadSuccess": "File downloaded successfully",
"downloadFailed": "File download failed",
"permissionDenied": "Permission denied",
"checkDockerLogs": "Check the Docker logs for detailed error information",
"internalServerError": "Internal server error occurred",
"serverError": "Server Error",
"error": "Error",
"requestFailed": "Request failed with status code",
"unknown": "unknown",
"cannotReadFile": "Cannot read file",
"noSshSessionId": "No SSH session ID available",
"noFilePath": "No file path available",
"noCurrentHost": "No current host available",
"fileSavedSuccessfully": "File saved successfully",
"saveTimeout": "Save operation timed out. The file may have been saved successfully, but the operation took too long to complete. Check the Docker logs for confirmation.",
"failedToSaveFile": "Failed to save file",
"folder": "Folder",
"file": "File",
"deletedSuccessfully": "deleted successfully",
"failedToDeleteItem": "Failed to delete item",
"connectToServer": "Connect to a Server",
"selectServerToEdit": "Select a server from the sidebar to start editing files",
"fileOperations": "File Operations",
"confirmDeleteMessage": "Are you sure you want to delete <strong>{{name}}</strong>?",
"deleteDirectoryWarning": "This will delete the folder and all its contents.",
"actionCannotBeUndone": "This action cannot be undone.",
"recent": "Recent",
"pinned": "Pinned",
"folderShortcuts": "Folder Shortcuts",
"noRecentFiles": "No recent files.",
"noPinnedFiles": "No pinned files.",
"enterFolderPath": "Enter folder path",
"noShortcuts": "No shortcuts.",
"searchFilesAndFolders": "Search files and folders...",
"noFilesOrFoldersFound": "No files or folders found."
},
"tunnels": {
"title": "SSH Tunnels",
"addTunnel": "Add Tunnel",
"editTunnel": "Edit Tunnel",
"deleteTunnel": "Delete Tunnel",
"tunnelName": "Tunnel Name",
"localPort": "Local Port",
"remoteHost": "Remote Host",
"remotePort": "Remote Port",
"autoStart": "Auto Start",
"status": "Status",
"active": "Active",
"inactive": "Inactive",
"start": "Start",
"stop": "Stop",
"restart": "Restart",
"connectionType": "Connection Type",
"local": "Local",
"remote": "Remote",
"dynamic": "Dynamic",
"noSshTunnels": "No SSH Tunnels",
"createFirstTunnelMessage": "Create your first SSH tunnel to get started. Use the SSH Manager to add hosts with tunnel connections.",
"unknown": "Unknown",
"connected": "Connected",
"connecting": "Connecting...",
"disconnecting": "Disconnecting...",
"disconnected": "Disconnected",
"portMapping": "Port {{sourcePort}} → {{endpointHost}}:{{endpointPort}}",
"disconnect": "Disconnect",
"connect": "Connect",
"canceling": "Canceling..."
},
"serverStats": {
"title": "Server Statistics",
"cpu": "CPU",
"memory": "Memory",
"disk": "Disk",
"network": "Network",
"uptime": "Uptime",
"loadAverage": "Load Average",
"processes": "Processes",
"connections": "Connections",
"usage": "Usage",
"available": "Available",
"total": "Total",
"free": "Free",
"used": "Used",
"percentage": "Percentage",
"refreshStatusAndMetrics": "Refresh status and metrics",
"refreshStatus": "Refresh Status",
"fileManagerAlreadyOpen": "File Manager already open for this host",
"openFileManager": "Open File Manager",
"cpuCores_one": "{{count}} CPU",
"cpuCores_other": "{{count}} CPUs",
"naCpus": "N/A CPU(s)",
"loadAverage": "Avg: {{avg1}}, {{avg5}}, {{avg15}}",
"loadAverageNA": "Avg: N/A",
"cpuUsage": "CPU Usage",
"memoryUsage": "Memory Usage",
"rootStorageSpace": "Root Storage Space",
"of": "of",
"feedbackMessage": "Have ideas for what should come next for server management? Share them on"
},
"auth": {
"loginTitle": "Login to Termix",
"registerTitle": "Create Account",
"loginButton": "Login",
"registerButton": "Register",
"forgotPassword": "Forgot Password?",
"rememberMe": "Remember Me",
"noAccount": "Don't have an account?",
"hasAccount": "Already have an account?",
"loginSuccess": "Login successful",
"loginFailed": "Login failed",
"registerSuccess": "Registration successful",
"registerFailed": "Registration failed",
"logoutSuccess": "Logged out successfully",
"invalidCredentials": "Invalid username or password",
"accountCreated": "Account created successfully",
"passwordReset": "Password reset link sent",
"twoFactorAuth": "Two-Factor Authentication",
"enterCode": "Enter verification code",
"backupCode": "Use backup code",
"verifyCode": "Verify Code",
"enableTwoFactor": "Enable Two-Factor Authentication",
"disableTwoFactor": "Disable Two-Factor Authentication",
"scanQRCode": "Scan this QR code with your authenticator app",
"backupCodes": "Backup Codes",
"saveBackupCodes": "Save these backup codes in a safe place",
"twoFactorEnabledSuccess": "Two-factor authentication enabled successfully!",
"twoFactorDisabled": "Two-factor authentication disabled",
"newBackupCodesGenerated": "New backup codes generated",
"backupCodesDownloaded": "Backup codes downloaded",
"pleaseEnterSixDigitCode": "Please enter a 6-digit code",
"invalidVerificationCode": "Invalid verification code",
"failedToDisableTotp": "Failed to disable TOTP",
"failedToGenerateBackupCodes": "Failed to generate backup codes",
"enterPassword": "Enter your password",
"lockedOidcAuth": "Locked (OIDC Auth)",
"twoFactorTitle": "Two-Factor Authentication",
"twoFactorProtected": "Your account is protected with two-factor authentication",
"twoFactorActive": "Two-factor authentication is currently active on your account",
"disable2FA": "Disable 2FA",
"disableTwoFactorWarning": "Disabling two-factor authentication will make your account less secure",
"passwordOrTotpCode": "Password or TOTP Code",
"or": "Or",
"generateNewBackupCodesText": "Generate new backup codes if you've lost your existing ones",
"generateNewBackupCodes": "Generate New Backup Codes",
"yourBackupCodes": "Your Backup Codes",
"download": "Download",
"setupTwoFactorTitle": "Set Up Two-Factor Authentication",
"step1ScanQR": "Step 1: Scan the QR code with your authenticator app",
"manualEntryCode": "Manual Entry Code",
"cannotScanQRText": "If you can't scan the QR code, enter this code manually in your authenticator app",
"nextVerifyCode": "Next: Verify Code",
"verifyAuthenticator": "Verify Your Authenticator",
"step2EnterCode": "Step 2: Enter the 6-digit code from your authenticator app",
"verificationCode": "Verification Code",
"back": "Back",
"verifyAndEnable": "Verify and Enable",
"saveBackupCodesTitle": "Save Your Backup Codes",
"step3StoreCodesSecurely": "Step 3: Store these codes in a safe place",
"importantBackupCodesText": "Save these backup codes in a secure location. You can use them to access your account if you lose your authenticator device.",
"completeSetup": "Complete Setup",
"notEnabledText": "Two-factor authentication adds an extra layer of security by requiring a code from your authenticator app when signing in.",
"enableTwoFactorButton": "Enable Two-Factor Authentication",
"addExtraSecurityLayer": "Add an extra layer of security to your account",
"firstUser": "First User",
"firstUserMessage": "You are the first user and will be made an admin. You can view admin settings in the sidebar user dropdown. If you think this is a mistake, check the docker logs, or create a",
"external": "External",
"loginWithExternal": "Login with External Provider",
"loginWithExternalDesc": "Login using your configured external identity provider",
"resetPasswordButton": "Reset Password",
"sendResetCode": "Send Reset Code",
"resetCodeDesc": "Enter your username to receive a password reset code. The code will be logged in the docker container logs.",
"resetCode": "Reset Code",
"verifyCodeButton": "Verify Code",
"enterResetCode": "Enter the 6-digit code from the docker container logs for user:",
"goToLogin": "Go to Login",
"newPassword": "New Password",
"confirmNewPassword": "Confirm Password",
"enterNewPassword": "Enter your new password for user:",
"passwordResetSuccess": "Success!",
"passwordResetSuccessDesc": "Your password has been successfully reset! You can now log in with your new password.",
"signUp": "Sign Up"
},
"errors": {
"notFound": "Page not found",
"unauthorized": "Unauthorized access",
"forbidden": "Access forbidden",
"serverError": "Server error",
"networkError": "Network error",
"databaseConnection": "Could not connect to the database. Please try again later.",
"unknownError": "Unknown error",
"failedPasswordReset": "Failed to initiate password reset",
"failedVerifyCode": "Failed to verify reset code",
"failedCompleteReset": "Failed to complete password reset",
"invalidTotpCode": "Invalid TOTP code",
"failedOidcLogin": "Failed to start OIDC login",
"failedUserInfo": "Failed to get user info after OIDC login",
"oidcAuthFailed": "OIDC authentication failed",
"noTokenReceived": "No token received from login",
"invalidAuthUrl": "Invalid authorization URL received from backend",
"connectionTimeout": "Connection timeout",
"invalidInput": "Invalid input",
"requiredField": "This field is required",
"minLength": "Minimum length is {{min}}",
"maxLength": "Maximum length is {{max}}",
"invalidEmail": "Invalid email address",
"passwordMismatch": "Passwords do not match",
"weakPassword": "Password is too weak",
"usernameExists": "Username already exists",
"emailExists": "Email already exists",
"loadFailed": "Failed to load data",
"saveError": "Failed to save"
},
"messages": {
"saveSuccess": "Saved successfully",
"saveError": "Failed to save",
"deleteSuccess": "Deleted successfully",
"deleteError": "Failed to delete",
"updateSuccess": "Updated successfully",
"updateError": "Failed to update",
"copySuccess": "Copied to clipboard",
"copyError": "Failed to copy",
"copiedToClipboard": "{{item}} copied to clipboard",
"connectionEstablished": "Connection established",
"connectionClosed": "Connection closed",
"reconnecting": "Reconnecting...",
"processing": "Processing...",
"pleaseWait": "Please wait...",
"registrationDisabled": "New account registration is currently disabled by an admin. Please log in or contact an administrator."
},
"profile": {
"title": "User Profile",
"description": "Manage your account settings and security",
"security": "Security",
"changePassword": "Change Password",
"twoFactorAuth": "Two-Factor Authentication",
"accountInfo": "Account Information",
"role": "Role",
"admin": "Administrator",
"user": "User",
"authMethod": "Authentication Method",
"local": "Local",
"external": "External (OIDC)"
},
"placeholders": {
"language": "Language",
"username": "username",
"hostname": "host name",
"folder": "folder",
"password": "password",
"keyPassword": "key password",
"sshConfig": "endpoint ssh configuration",
"homePath": "/home",
"clientId": "your-client-id",
"clientSecret": "your-client-secret",
"authUrl": "https://your-provider.com/application/o/authorize/",
"redirectUrl": "https://your-provider.com/application/o/termix/",
"tokenUrl": "https://your-provider.com/application/o/token/",
"userIdField": "sub",
"usernameField": "name",
"scopes": "openid email profile",
"enterUsername": "Enter username to make admin",
"searchHosts": "Search hosts by name, username, IP, folder, tags...",
"enterPassword": "Enter your password",
"totpCode": "6-digit TOTP code",
"searchHostsAny": "Search hosts by any info...",
"confirmPassword": "Enter your password to confirm",
"typeHere": "Type here",
"fileName": "Enter file name (e.g., example.txt)",
"folderName": "Enter folder name",
"fullPath": "Enter full path to item",
"currentPath": "Enter current path to item",
"newName": "Enter new name"
},
"leftSidebar": {
"failedToLoadHosts": "Failed to load hosts",
"noFolder": "No Folder",
"passwordRequired": "Password is required",
"failedToDeleteAccount": "Failed to delete account",
"failedToMakeUserAdmin": "Failed to make user admin",
"userIsNowAdmin": "User {{username}} is now an admin",
"removeAdminConfirm": "Are you sure you want to remove admin status from {{username}}?",
"deleteUserConfirm": "Are you sure you want to delete user {{username}}? This action cannot be undone.",
"deleteAccount": "Delete Account",
"closeDeleteAccount": "Close Delete Account",
"deleteAccountWarning": "This action cannot be undone. This will permanently delete your account and all associated data.",
"deleteAccountWarningDetails": "Deleting your account will remove all your data including SSH hosts, configurations, and settings. This action is irreversible.",
"cannotDeleteAccount": "Cannot Delete Account",
"lastAdminWarning": "You are the last admin user. You cannot delete your account as this would leave the system without any administrators. Please make another user an admin first, or contact system support.",
"confirmPassword": "Confirm Password",
"deleting": "Deleting...",
"cancel": "Cancel"
},
"interface": {
"sidebar": "Sidebar",
"toggleSidebar": "Toggle Sidebar",
"close": "Close",
"online": "Online",
"offline": "Offline",
"maintenance": "Maintenance",
"degraded": "Degraded",
"noTunnelConnections": "No tunnel connections configured",
"discord": "Discord",
"connectToSshForOperations": "Connect to SSH to use file operations",
"uploadFile": "Upload File",
"newFile": "New File",
"newFolder": "New Folder",
"rename": "Rename",
"deleteItem": "Delete Item",
"createNewFile": "Create New File",
"createNewFolder": "Create New Folder",
"deleteItem": "Delete Item",
"renameItem": "Rename Item",
"clickToSelectFile": "Click to select a file",
"noSshHosts": "No SSH Hosts",
"sshHosts": "SSH Hosts",
"importSshHosts": "Import SSH Hosts from JSON",
"hostViewer": "Host Viewer",
"clientId": "Client ID",
"clientSecret": "Client Secret",
"error": "Error",
"warning": "Warning",
"deleteAccount": "Delete Account",
"closeDeleteAccount": "Close Delete Account",
"cannotDeleteAccount": "Cannot Delete Account",
"confirmPassword": "Confirm Password",
"deleting": "Deleting...",
"externalAuth": "External Authentication (OIDC)",
"configureExternalProvider": "Configure external identity provider for",
"waitingForRetry": "Waiting for retry",
"retryingConnection": "Retrying connection",
"resetSplitSizes": "Reset split sizes",
"sshManagerAlreadyOpen": "SSH Manager already open",
"disabledDuringSplitScreen": "Disabled during split screen",
"unknown": "Unknown",
"connected": "Connected",
"disconnected": "Disconnected",
"maxRetriesExhausted": "Max retries exhausted",
"endpointHostNotFound": "Endpoint host not found",
"administrator": "Administrator",
"user": "User",
"external": "External",
"local": "Local",
"saving": "Saving...",
"saveConfiguration": "Save Configuration",
"loading": "Loading...",
"refresh": "Refresh",
"adding": "Adding...",
"makeAdmin": "Make Admin",
"verifying": "Verifying...",
"verifyAndEnable": "Verify and Enable",
"secretKey": "Secret key",
"totpQrCode": "TOTP QR Code",
"passwordRequired": "Password is required when using password authentication",
"sshKeyRequired": "SSH Private Key is required when using key authentication",
"keyTypeRequired": "Key Type is required when using key authentication",
"validSshConfigRequired": "Must select a valid SSH configuration from the list",
"updateHost": "Update Host",
"addHost": "Add Host",
"editHost": "Edit Host",
"productionFolder": "Production",
"databaseServer": "Database Server",
"unknownError": "Unknown error",
"failedToInitiatePasswordReset": "Failed to initiate password reset",
"failedToVerifyResetCode": "Failed to verify reset code",
"failedToCompletePasswordReset": "Failed to complete password reset",
"invalidTotpCode": "Invalid TOTP code",
"failedToStartOidcLogin": "Failed to start OIDC login",
"failedToGetUserInfoAfterOidc": "Failed to get user info after OIDC login",
"loginWithExternalProvider": "Login with external provider",
"loginWithExternal": "Login with External Provider",
"sendResetCode": "Send Reset Code",
"verifyCode": "Verify Code",
"resetPassword": "Reset Password",
"login": "Login",
"signUp": "Sign Up",
"failedToUpdateOidcConfig": "Failed to update OIDC configuration",
"failedToMakeUserAdmin": "Failed to make user admin",
"failedToStartTotpSetup": "Failed to start TOTP setup",
"invalidVerificationCode": "Invalid verification code",
"failedToDisableTotp": "Failed to disable TOTP",
"failedToGenerateBackupCodes": "Failed to generate backup codes"
}
}