diff --git a/docker/Dockerfile b/docker/Dockerfile index 15f3d81f..7a95cabb 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -57,6 +57,7 @@ RUN apk add --no-cache nginx gettext su-exec && \ COPY docker/nginx.conf /etc/nginx/nginx.conf COPY --from=frontend-builder /app/dist /usr/share/nginx/html +COPY --from=frontend-builder /app/public/locales /usr/share/nginx/html/locales RUN chown -R nginx:nginx /usr/share/nginx/html WORKDIR /app diff --git a/package-lock.json b/package-lock.json index 1ec9298d..a3195012 100644 --- a/package-lock.json +++ b/package-lock.json @@ -53,6 +53,9 @@ "dotenv": "^17.2.0", "drizzle-orm": "^0.44.3", "express": "^5.1.0", + "i18next": "^25.4.2", + "i18next-browser-languagedetector": "^8.2.0", + "i18next-http-backend": "^3.0.2", "jose": "^5.2.3", "jsonwebtoken": "^9.0.2", "lucide-react": "^0.525.0", @@ -64,6 +67,7 @@ "react": "^19.1.0", "react-dom": "^19.1.0", "react-hook-form": "^7.60.0", + "react-i18next": "^15.7.3", "react-resizable-panels": "^3.0.3", "react-xtermjs": "^1.0.10", "sonner": "^2.0.7", @@ -5071,6 +5075,35 @@ "integrity": "sha512-VQ2MBenTq1fWZUH9DJNGti7kKv6EeAuYr3cLwxUWhIu1baTaXh4Ib5W2CqHVqib4/MqbYGJqiL3Zb8GJZr3l4g==", "license": "MIT" }, + "node_modules/cross-fetch": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/cross-fetch/-/cross-fetch-4.0.0.tgz", + "integrity": "sha512-e4a5N8lVvuLgAWgnCrLr2PP0YyDOTHa9H/Rj54dirp61qXnNq46m82bRhNqIA5VccJtWBvPTFRV3TtvHUKPB1g==", + "license": "MIT", + "dependencies": { + "node-fetch": "^2.6.12" + } + }, + "node_modules/cross-fetch/node_modules/node-fetch": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz", + "integrity": "sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==", + "license": "MIT", + "dependencies": { + "whatwg-url": "^5.0.0" + }, + "engines": { + "node": "4.x || >=6.0.0" + }, + "peerDependencies": { + "encoding": "^0.1.0" + }, + "peerDependenciesMeta": { + "encoding": { + "optional": true + } + } + }, "node_modules/cross-spawn": { "version": "7.0.6", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", @@ -6232,6 +6265,15 @@ "node": ">= 0.4" } }, + "node_modules/html-parse-stringify": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/html-parse-stringify/-/html-parse-stringify-3.0.1.tgz", + "integrity": "sha512-KknJ50kTInJ7qIScF3jeaFRpMpE8/lfiTdzf/twXyPBLAGrLRTmkz3AdTnKeh40X8k9L2fdYwEp/42WGXIRGcg==", + "license": "MIT", + "dependencies": { + "void-elements": "3.1.0" + } + }, "node_modules/http-errors": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz", @@ -6257,6 +6299,55 @@ "node": ">= 0.8" } }, + "node_modules/i18next": { + "version": "25.4.2", + "resolved": "https://registry.npmjs.org/i18next/-/i18next-25.4.2.tgz", + "integrity": "sha512-gD4T25a6ovNXsfXY1TwHXXXLnD/K2t99jyYMCSimSCBnBRJVQr5j+VAaU83RJCPzrTGhVQ6dqIga66xO2rtd5g==", + "funding": [ + { + "type": "individual", + "url": "https://locize.com" + }, + { + "type": "individual", + "url": "https://locize.com/i18next.html" + }, + { + "type": "individual", + "url": "https://www.i18next.com/how-to/faq#i18next-is-awesome.-how-can-i-support-the-project" + } + ], + "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.27.6" + }, + "peerDependencies": { + "typescript": "^5" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/i18next-browser-languagedetector": { + "version": "8.2.0", + "resolved": "https://registry.npmjs.org/i18next-browser-languagedetector/-/i18next-browser-languagedetector-8.2.0.tgz", + "integrity": "sha512-P+3zEKLnOF0qmiesW383vsLdtQVyKtCNA9cjSoKCppTKPQVfKd2W8hbVo5ZhNJKDqeM7BOcvNoKJOjpHh4Js9g==", + "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.23.2" + } + }, + "node_modules/i18next-http-backend": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/i18next-http-backend/-/i18next-http-backend-3.0.2.tgz", + "integrity": "sha512-PdlvPnvIp4E1sYi46Ik4tBYh/v/NbYfFFgTjkwFl0is8A18s7/bx9aXqsrOax9WUbeNS6mD2oix7Z0yGGf6m5g==", + "license": "MIT", + "dependencies": { + "cross-fetch": "4.0.0" + } + }, "node_modules/iconv-lite": { "version": "0.6.3", "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", @@ -7644,6 +7735,32 @@ "react": "^16.8.0 || ^17 || ^18 || ^19" } }, + "node_modules/react-i18next": { + "version": "15.7.3", + "resolved": "https://registry.npmjs.org/react-i18next/-/react-i18next-15.7.3.tgz", + "integrity": "sha512-AANws4tOE+QSq/IeMF/ncoHlMNZaVLxpa5uUGW1wjike68elVYr0018L9xYoqBr1OFO7G7boDPrbn0HpMCJxTw==", + "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.27.6", + "html-parse-stringify": "^3.0.1" + }, + "peerDependencies": { + "i18next": ">= 25.4.1", + "react": ">= 16.8.0", + "typescript": "^5" + }, + "peerDependenciesMeta": { + "react-dom": { + "optional": true + }, + "react-native": { + "optional": true + }, + "typescript": { + "optional": true + } + } + }, "node_modules/react-remove-scroll": { "version": "2.7.1", "resolved": "https://registry.npmjs.org/react-remove-scroll/-/react-remove-scroll-2.7.1.tgz", @@ -8365,6 +8482,12 @@ "node": ">=0.6" } }, + "node_modules/tr46": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", + "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==", + "license": "MIT" + }, "node_modules/ts-api-utils": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-2.1.0.tgz", @@ -8493,7 +8616,7 @@ "version": "5.9.2", "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.2.tgz", "integrity": "sha512-CWBzXQrc/qOkhidw1OzBTQuYRbfyxDXJMVJ1XNwUHGROVmuaeiEm3OslpZ1RV96d7SKKjZKrSJu3+t/xlw3R9A==", - "dev": true, + "devOptional": true, "license": "Apache-2.0", "bin": { "tsc": "bin/tsc", @@ -8769,6 +8892,15 @@ "url": "https://github.com/sponsors/jonschlinkert" } }, + "node_modules/void-elements": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/void-elements/-/void-elements-3.1.0.tgz", + "integrity": "sha512-Dhxzh5HZuiHQhbvTW9AMetFfBHDMYpo23Uo9btPXgdYP+3T5S+p+jgNy7spra+veYhBP2dCSgxR/i2Y02h5/6w==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/w3c-keyname": { "version": "2.2.8", "resolved": "https://registry.npmjs.org/w3c-keyname/-/w3c-keyname-2.2.8.tgz", @@ -8784,6 +8916,22 @@ "node": ">= 8" } }, + "node_modules/webidl-conversions": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", + "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==", + "license": "BSD-2-Clause" + }, + "node_modules/whatwg-url": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", + "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==", + "license": "MIT", + "dependencies": { + "tr46": "~0.0.3", + "webidl-conversions": "^3.0.0" + } + }, "node_modules/which": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", diff --git a/package.json b/package.json index bfb57933..81530bff 100644 --- a/package.json +++ b/package.json @@ -57,6 +57,9 @@ "dotenv": "^17.2.0", "drizzle-orm": "^0.44.3", "express": "^5.1.0", + "i18next": "^25.4.2", + "i18next-browser-languagedetector": "^8.2.0", + "i18next-http-backend": "^3.0.2", "jose": "^5.2.3", "jsonwebtoken": "^9.0.2", "lucide-react": "^0.525.0", @@ -68,6 +71,7 @@ "react": "^19.1.0", "react-dom": "^19.1.0", "react-hook-form": "^7.60.0", + "react-i18next": "^15.7.3", "react-resizable-panels": "^3.0.3", "react-xtermjs": "^1.0.10", "sonner": "^2.0.7", diff --git a/public/locales/en/translation.json b/public/locales/en/translation.json new file mode 100644 index 00000000..08267e20 --- /dev/null +++ b/public/locales/en/translation.json @@ -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 {{name}}?", + "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" + } +} \ No newline at end of file diff --git a/public/locales/zh/translation.json b/public/locales/zh/translation.json new file mode 100644 index 00000000..e58e8d6e --- /dev/null +++ b/public/locales/zh/translation.json @@ -0,0 +1,593 @@ +{ + "common": { + "login": "登录", + "logout": "登出", + "register": "注册", + "username": "用户名", + "password": "密码", + "confirmPassword": "确认密码", + "back": "返回", + "email": "邮箱", + "submit": "提交", + "cancel": "取消", + "save": "保存", + "delete": "删除", + "edit": "编辑", + "add": "添加", + "search": "搜索", + "loading": "加载中...", + "error": "错误", + "success": "成功", + "warning": "警告", + "info": "信息", + "confirm": "确认", + "yes": "是", + "no": "否", + "ok": "确定", + "close": "关闭", + "enabled": "已启用", + "disabled": "已禁用", + "important": "重要", + "notEnabled": "未启用", + "settingUp": "设置中...", + "back": "返回", + "next": "下一步", + "previous": "上一步", + "refresh": "刷新", + "settings": "设置", + "profile": "个人资料", + "help": "帮助", + "about": "关于", + "language": "语言", + "autoDetect": "自动检测" + }, + "nav": { + "home": "首页", + "hosts": "主机", + "terminal": "终端", + "tunnels": "隧道", + "fileManager": "文件管理器", + "serverStats": "服务器统计", + "admin": "管理员", + "tools": "工具", + "newTab": "新标签页", + "splitScreen": "分屏", + "closeTab": "关闭标签页", + "sshManager": "SSH 管理器", + "cannotSplitTab": "无法分割此标签页" + }, + "admin": { + "title": "管理员设置", + "users": "用户", + "userManagement": "用户管理", + "makeAdmin": "设为管理员", + "removeAdmin": "移除管理员", + "deleteUser": "删除用户", + "allowRegistration": "允许注册", + "oidcSettings": "OIDC 设置", + "clientId": "客户端 ID", + "clientSecret": "客户端密钥", + "issuerUrl": "颁发者 URL", + "authorizationUrl": "授权 URL", + "tokenUrl": "令牌 URL", + "updateSettings": "更新设置", + "confirmDelete": "确定要删除此用户吗?", + "confirmMakeAdmin": "确定要将此用户设为管理员吗?", + "confirmRemoveAdmin": "确定要移除此用户的管理员权限吗?", + "externalAuthentication": "外部认证 (OIDC)", + "configureExternalProvider": "配置 OIDC/OAuth2 认证的外部身份提供者。", + "userIdentifierPath": "用户标识符路径", + "displayNamePath": "显示名称路径", + "scopes": "作用域", + "saving": "保存中...", + "saveConfiguration": "保存配置", + "reset": "重置", + "success": "成功", + "loading": "加载中...", + "refresh": "刷新", + "loadingUsers": "加载用户中...", + "username": "用户名", + "type": "类型", + "actions": "操作", + "external": "外部", + "local": "本地", + "adminManagement": "管理员管理", + "makeUserAdmin": "设置用户为管理员", + "adding": "添加中...", + "currentAdmins": "当前管理员", + "adminBadge": "管理员", + "removeAdminButton": "移除管理员" + }, + "hosts": { + "title": "主机管理", + "addHost": "添加主机", + "editHost": "编辑主机", + "deleteHost": "删除主机", + "hostName": "主机名", + "ipAddress": "IP 地址", + "port": "端口", + "authType": "认证类型", + "passwordAuth": "密码", + "keyAuth": "SSH 密钥", + "keyPassword": "密钥密码", + "keyType": "密钥类型", + "folder": "文件夹", + "tags": "标签", + "pin": "固定", + "enableTerminal": "启用终端", + "enableTunnel": "启用隧道", + "enableFileManager": "启用文件管理器", + "defaultPath": "默认路径", + "testConnection": "测试连接", + "connect": "连接", + "disconnect": "断开连接", + "connected": "已连接", + "disconnected": "已断开", + "connecting": "连接中...", + "connectionFailed": "连接失败", + "connectionSuccess": "连接成功", + "connectionDetails": "连接详情", + "organization": "组织管理", + "addTags": "添加标签(空格添加)" + }, + "terminal": { + "title": "终端", + "connect": "连接主机", + "disconnect": "断开连接", + "clear": "清屏", + "copy": "复制", + "paste": "粘贴", + "find": "查找", + "fullscreen": "全屏", + "splitHorizontal": "水平分屏", + "splitVertical": "垂直分屏", + "closePanel": "关闭面板", + "reconnect": "重新连接", + "sessionEnded": "会话已结束", + "connectionLost": "连接已断开", + "error": "错误", + "disconnected": "已断开连接", + "connectionClosed": "连接已关闭", + "connectionError": "连接错误" + }, + "fileManager": { + "title": "文件管理器", + "file": "文件", + "folder": "文件夹", + "connectToSsh": "连接 SSH 以使用文件操作", + "uploadFile": "上传文件", + "newFile": "新建文件", + "newFolder": "新建文件夹", + "rename": "重命名", + "renameItem": "重命名项目", + "deleteItem": "删除项目", + "currentPath": "当前路径", + "uploadFileTitle": "上传文件", + "maxFileSize": "最大:100MB(JSON)/ 200MB(二进制)", + "removeFile": "移除文件", + "clickToSelectFile": "点击选择文件", + "chooseFile": "选择文件", + "uploading": "上传中...", + "createNewFile": "创建新文件", + "fileName": "文件名", + "creating": "创建中...", + "createFile": "创建文件", + "createNewFolder": "创建新文件夹", + "folderName": "文件夹名", + "createFolder": "创建文件夹", + "warningCannotUndo": "警告:此操作无法撤销", + "itemPath": "项目路径", + "thisIsDirectory": "这是一个目录(将递归删除)", + "deleting": "删除中...", + "currentPathLabel": "当前路径", + "newName": "新名称", + "thisIsDirectoryRename": "这是一个目录", + "renaming": "重命名中...", + "fileUploadedSuccessfully": "文件 \"{{name}}\" 上传成功", + "failedToUploadFile": "上传文件失败", + "fileCreatedSuccessfully": "文件 \"{{name}}\" 创建成功", + "failedToCreateFile": "创建文件失败", + "folderCreatedSuccessfully": "文件夹 \"{{name}}\" 创建成功", + "failedToCreateFolder": "创建文件夹失败", + "itemDeletedSuccessfully": "{{type}}删除成功", + "failedToDeleteItem": "删除项目失败", + "itemRenamedSuccessfully": "{{type}}重命名成功", + "failedToRenameItem": "重命名项目失败", + "upload": "上传", + "download": "下载", + "newFile": "新建文件", + "newFolder": "新建文件夹", + "rename": "重命名", + "delete": "删除", + "permissions": "权限", + "size": "大小", + "modified": "修改时间", + "path": "路径", + "fileName": "文件名", + "folderName": "文件夹名", + "confirmDelete": "确定要删除 {{name}} 吗?", + "uploadSuccess": "文件上传成功", + "uploadFailed": "文件上传失败", + "downloadSuccess": "文件下载成功", + "downloadFailed": "文件下载失败", + "permissionDenied": "权限被拒绝", + "checkDockerLogs": "请检查 Docker 日志以获取详细的错误信息", + "internalServerError": "内部服务器错误发生", + "serverError": "服务器错误", + "error": "错误", + "requestFailed": "请求失败,状态码", + "unknown": "未知", + "cannotReadFile": "无法读取文件", + "noSshSessionId": "没有可用的 SSH 会话 ID", + "noFilePath": "没有可用的文件路径", + "noCurrentHost": "没有可用的当前主机", + "fileSavedSuccessfully": "文件保存成功", + "saveTimeout": "保存操作超时。文件可能已成功保存,但操作用时过长。请检查 Docker 日志以确认。", + "failedToSaveFile": "保存文件失败", + "folder": "文件夹", + "file": "文件", + "deletedSuccessfully": "删除成功", + "failedToDeleteItem": "删除项目失败", + "connectToServer": "连接到服务器", + "selectServerToEdit": "从侧边栏选择服务器以开始编辑文件", + "fileOperations": "文件操作", + "confirmDeleteMessage": "确定要删除 {{name}} 吗?", + "deleteDirectoryWarning": "这将删除文件夹及其所有内容。", + "actionCannotBeUndone": "此操作无法撤销。", + "recent": "最近的", + "pinned": "固定的", + "folderShortcuts": "文件夹快捷方式", + "noRecentFiles": "没有最近的文件。", + "noPinnedFiles": "没有固定的文件。", + "enterFolderPath": "输入文件夹路径", + "noShortcuts": "没有快捷方式。", + "searchFilesAndFolders": "搜索文件和文件夹...", + "noFilesOrFoldersFound": "没有找到文件或文件夹。" + }, + "tunnels": { + "title": "SSH 隧道", + "addTunnel": "添加隧道", + "editTunnel": "编辑隧道", + "deleteTunnel": "删除隧道", + "tunnelName": "隧道名称", + "localPort": "本地端口", + "remoteHost": "远程主机", + "remotePort": "远程端口", + "autoStart": "自动启动", + "status": "状态", + "active": "活动", + "inactive": "未激活", + "start": "启动", + "stop": "停止", + "restart": "重启", + "connectionType": "连接类型", + "local": "本地", + "remote": "远程", + "dynamic": "动态", + "noSshTunnels": "没有 SSH 隧道", + "createFirstTunnelMessage": "创建您的第一个 SSH 隧道以开始使用。使用 SSH 管理器添加具有隧道连接的主机。", + "unknown": "未知", + "connected": "已连接", + "connecting": "连接中...", + "disconnecting": "断开连接中...", + "disconnected": "已断开连接", + "portMapping": "端口 {{sourcePort}} → {{endpointHost}}:{{endpointPort}}", + "disconnect": "断开连接", + "connect": "连接", + "canceling": "取消中..." + }, + "serverStats": { + "title": "服务器统计", + "cpu": "CPU", + "memory": "内存", + "disk": "磁盘", + "network": "网络", + "uptime": "运行时间", + "loadAverage": "平均负载", + "processes": "进程", + "connections": "连接", + "usage": "使用率", + "available": "可用", + "total": "总计", + "free": "空闲", + "used": "已用", + "percentage": "百分比", + "refreshStatusAndMetrics": "刷新状态和指标", + "refreshStatus": "刷新状态", + "fileManagerAlreadyOpen": "此主机的文件管理器已打开", + "openFileManager": "打开文件管理器", + "cpuCores_one": "{{count}} 个 CPU", + "cpuCores_other": "{{count}} 个 CPU", + "naCpus": "N/A CPU", + "loadAverage": "平均: {{avg1}}, {{avg5}}, {{avg15}}", + "loadAverageNA": "平均: N/A", + "cpuUsage": "CPU 使用率", + "memoryUsage": "内存使用率", + "rootStorageSpace": "根目录存储空间", + "of": "的", + "feedbackMessage": "对服务器管理的下一步功能有想法?在这里分享吧" + }, + "auth": { + "loginTitle": "登录 Termix", + "registerTitle": "创建账户", + "loginButton": "登录", + "registerButton": "注册", + "forgotPassword": "忘记密码?", + "rememberMe": "记住我", + "noAccount": "还没有账户?", + "hasAccount": "已有账户?", + "loginSuccess": "登录成功", + "loginFailed": "登录失败", + "registerSuccess": "注册成功", + "registerFailed": "注册失败", + "logoutSuccess": "登出成功", + "invalidCredentials": "用户名或密码错误", + "accountCreated": "账户创建成功", + "passwordReset": "密码重置链接已发送", + "twoFactorAuth": "双因素认证", + "enterCode": "输入验证码", + "backupCode": "使用备用码", + "verifyCode": "验证码", + "enableTwoFactor": "启用双因素认证", + "disableTwoFactor": "禁用双因素认证", + "scanQRCode": "使用您的身份验证器应用扫描此二维码", + "backupCodes": "备用码", + "saveBackupCodes": "请将这些备用码保存在安全的地方", + "twoFactorEnabledSuccess": "双因素认证启用成功!", + "twoFactorDisabled": "双因素认证已禁用", + "newBackupCodesGenerated": "新备用码已生成", + "backupCodesDownloaded": "备用码已下载", + "pleaseEnterSixDigitCode": "请输入 6 位验证码", + "invalidVerificationCode": "无效的验证码", + "failedToDisableTotp": "禁用 TOTP 失败", + "failedToGenerateBackupCodes": "生成备用码失败", + "enterPassword": "输入您的密码", + "lockedOidcAuth": "已锁定 (OIDC 认证)", + "twoFactorTitle": "双因素认证", + "twoFactorProtected": "您的账户已启用双因素认证保护", + "twoFactorActive": "双因素认证当前在您的账户上处于活动状态", + "disable2FA": "禁用 2FA", + "disableTwoFactorWarning": "禁用双因素认证将降低您账户的安全性", + "passwordOrTotpCode": "密码或 TOTP 验证码", + "or": "或", + "generateNewBackupCodesText": "如果您丢失了现有的备用码,请生成新的备用码", + "generateNewBackupCodes": "生成新的备用码", + "yourBackupCodes": "您的备用码", + "download": "下载", + "setupTwoFactorTitle": "设置双因素认证", + "step1ScanQR": "步骤 1:使用您的身份验证器应用扫描二维码", + "manualEntryCode": "手动输入代码", + "cannotScanQRText": "如果无法扫描二维码,请在身份验证器应用中手动输入此代码", + "nextVerifyCode": "下一步:验证代码", + "verifyAuthenticator": "验证您的身份验证器", + "step2EnterCode": "步骤 2:输入身份验证器应用中的6位数代码", + "verificationCode": "验证码", + "back": "返回", + "verifyAndEnable": "验证并启用", + "saveBackupCodesTitle": "保存您的备用码", + "step3StoreCodesSecurely": "步骤 3:将这些代码保存在安全的地方", + "importantBackupCodesText": "请将这些备用码保存在安全的地方。如果您丢失了身份验证器设备,可以使用它们访问您的账户。", + "completeSetup": "完成设置", + "notEnabledText": "双因素认证通过在登录时要求来自身份验证器应用的代码,为您的账户增加额外的安全层。", + "enableTwoFactorButton": "启用双因素认证", + "addExtraSecurityLayer": "为您的账户添加额外的安全层", + "firstUser": "首位用户", + "firstUserMessage": "您是第一个用户,将被设为管理员。您可以在侧边栏用户下拉菜单中查看管理员设置。如果您认为这是错误,请检查 docker 日志,或创建", + "external": "外部", + "loginWithExternal": "使用外部提供商登录", + "loginWithExternalDesc": "使用您配置的外部身份提供商登录", + "resetPasswordButton": "重置密码", + "sendResetCode": "发送重置代码", + "resetCodeDesc": "输入您的用户名以接收密码重置代码。代码将记录在 docker 容器日志中。", + "resetCode": "重置代码", + "verifyCodeButton": "验证代码", + "enterResetCode": "输入来自 docker 容器日志中用户的 6 位数代码:", + "goToLogin": "转到登录", + "newPassword": "新密码", + "confirmNewPassword": "确认密码", + "enterNewPassword": "为用户输入新密码:", + "passwordResetSuccess": "成功!", + "passwordResetSuccessDesc": "您的密码已成功重置!您现在可以使用新密码登录。", + "signUp": "注册" + }, + "errors": { + "notFound": "页面未找到", + "unauthorized": "未授权访问", + "forbidden": "访问被禁止", + "serverError": "服务器错误", + "networkError": "网络错误", + "databaseConnection": "无法连接到数据库。请稍后再试。", + "unknownError": "未知错误", + "failedPasswordReset": "无法启动密码重置", + "failedVerifyCode": "验证重置代码失败", + "failedCompleteReset": "无法完成密码重置", + "invalidTotpCode": "无效的 TOTP 代码", + "failedOidcLogin": "无法启动 OIDC 登录", + "failedUserInfo": "OIDC 登录后无法获取用户信息", + "oidcAuthFailed": "OIDC 认证失败", + "noTokenReceived": "登录未收到令牌", + "invalidAuthUrl": "从后端收到无效的授权 URL", + "connectionTimeout": "连接超时", + "invalidInput": "输入无效", + "requiredField": "此字段为必填项", + "minLength": "最小长度为 {{min}}", + "maxLength": "最大长度为 {{max}}", + "invalidEmail": "邮箱地址无效", + "passwordMismatch": "密码不匹配", + "weakPassword": "密码强度太弱", + "usernameExists": "用户名已存在", + "emailExists": "邮箱已存在", + "loadFailed": "加载数据失败", + "saveError": "保存失败" + }, + "messages": { + "saveSuccess": "保存成功", + "saveError": "保存失败", + "deleteSuccess": "删除成功", + "deleteError": "删除失败", + "updateSuccess": "更新成功", + "updateError": "更新失败", + "copySuccess": "已复制到剪贴板", + "copyError": "复制失败", + "copiedToClipboard": "{{item}} 已复制到剪贴板", + "connectionEstablished": "连接已建立", + "connectionClosed": "连接已关闭", + "reconnecting": "重新连接中...", + "processing": "处理中...", + "pleaseWait": "请稍候...", + "registrationDisabled": "新用户注册已被管理员禁用。请登录或联系管理员。" + }, + "profile": { + "title": "用户资料", + "description": "管理您的账户设置和安全", + "security": "安全", + "changePassword": "修改密码", + "twoFactorAuth": "双因素认证", + "accountInfo": "账户信息", + "role": "角色", + "admin": "管理员", + "user": "用户", + "authMethod": "认证方式", + "local": "本地", + "external": "外部 (OIDC)" + }, + "placeholders": { + "language": "语言", + "username": "用户名", + "hostname": "主机名", + "folder": "文件夹", + "password": "密码", + "keyPassword": "密钥密码", + "sshConfig": "端点 SSH 配置", + "homePath": "/home", + "clientId": "您的客户端 ID", + "clientSecret": "您的客户端密钥", + "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": "输入用户名以设为管理员", + "searchHosts": "按名称、用户名、IP、文件夹、标签搜索主机...", + "enterPassword": "输入您的密码", + "totpCode": "6 位 TOTP 验证码", + "searchHostsAny": "按任意信息搜索主机...", + "confirmPassword": "输入您的密码以确认", + "typeHere": "在此输入", + "fileName": "输入文件名(例如:example.txt)", + "folderName": "输入文件夹名", + "fullPath": "输入项目的完整路径", + "currentPath": "输入项目的当前路径", + "newName": "输入新名称" + }, + "leftSidebar": { + "failedToLoadHosts": "加载主机失败", + "noFolder": "无文件夹", + "passwordRequired": "需要输入密码", + "failedToDeleteAccount": "删除账户失败", + "failedToMakeUserAdmin": "设为管理员失败", + "userIsNowAdmin": "用户 {{username}} 现在是管理员", + "removeAdminConfirm": "确定要移除 {{username}} 的管理员权限吗?", + "deleteUserConfirm": "确定要删除用户 {{username}} 吗?此操作无法撤销。", + "deleteAccount": "删除账户", + "closeDeleteAccount": "关闭删除账户", + "deleteAccountWarning": "此操作无法撤销。这将永久删除您的账户和所有相关数据。", + "deleteAccountWarningDetails": "删除您的账户将删除所有数据,包括 SSH 主机、配置和设置。此操作不可逆。", + "cannotDeleteAccount": "无法删除账户", + "lastAdminWarning": "您是最后一个管理员用户。您不能删除自己的账户,否则系统将没有任何管理员。请先将其他用户设为管理员,或联系系统支持。", + "confirmPassword": "确认密码", + "deleting": "删除中...", + "cancel": "取消" + }, + "interface": { + "sidebar": "侧边栏", + "toggleSidebar": "切换侧边栏", + "close": "关闭", + "online": "在线", + "offline": "离线", + "maintenance": "维护中", + "degraded": "降级", + "noTunnelConnections": "未配置隧道连接", + "discord": "Discord", + "connectToSshForOperations": "连接 SSH 以使用文件操作", + "uploadFile": "上传文件", + "newFile": "新建文件", + "newFolder": "新建文件夹", + "rename": "重命名", + "deleteItem": "删除项目", + "createNewFile": "创建新文件", + "createNewFolder": "创建新文件夹", + "deleteItem": "删除项目", + "renameItem": "重命名项目", + "clickToSelectFile": "点击选择文件", + "noSshHosts": "没有 SSH 主机", + "sshHosts": "SSH 主机", + "importSshHosts": "从 JSON 导入 SSH 主机", + "hostViewer": "主机查看器", + "clientId": "客户端 ID", + "clientSecret": "客户端密钥", + "error": "错误", + "warning": "警告", + "deleteAccount": "删除账户", + "closeDeleteAccount": "关闭删除账户", + "cannotDeleteAccount": "无法删除账户", + "confirmPassword": "确认密码", + "deleting": "删除中...", + "externalAuth": "外部认证 (OIDC)", + "configureExternalProvider": "配置外部身份提供者", + "waitingForRetry": "等待重试", + "retryingConnection": "重试连接中", + "resetSplitSizes": "重置分屏大小", + "sshManagerAlreadyOpen": "SSH 管理器已打开", + "disabledDuringSplitScreen": "分屏期间禁用", + "unknown": "未知", + "connected": "已连接", + "disconnected": "已断开连接", + "maxRetriesExhausted": "已达到最大重试次数", + "endpointHostNotFound": "未找到端点主机", + "administrator": "管理员", + "user": "用户", + "external": "外部", + "local": "本地", + "saving": "保存中...", + "saveConfiguration": "保存配置", + "loading": "加载中...", + "refresh": "刷新", + "adding": "添加中...", + "makeAdmin": "设为管理员", + "verifying": "验证中...", + "verifyAndEnable": "验证并启用", + "secretKey": "密钥", + "totpQrCode": "TOTP 二维码", + "passwordRequired": "使用密码认证时需要密码", + "sshKeyRequired": "使用密钥认证时需要 SSH 私钥", + "keyTypeRequired": "使用密钥认证时需要密钥类型", + "validSshConfigRequired": "必须从列表中选择有效的 SSH 配置", + "updateHost": "更新主机", + "addHost": "添加主机", + "editHost": "编辑主机", + "productionFolder": "生产环境", + "databaseServer": "数据库服务器", + "unknownError": "未知错误", + "failedToInitiatePasswordReset": "启动密码重置失败", + "failedToVerifyResetCode": "验证重置代码失败", + "failedToCompletePasswordReset": "完成密码重置失败", + "invalidTotpCode": "无效的 TOTP 代码", + "failedToStartOidcLogin": "启动 OIDC 登录失败", + "failedToGetUserInfoAfterOidc": "OIDC 登录后获取用户信息失败", + "loginWithExternalProvider": "使用外部提供者登录", + "loginWithExternal": "使用外部提供者登录", + "sendResetCode": "发送重置代码", + "verifyCode": "验证代码", + "resetPassword": "重置密码", + "login": "登录", + "signUp": "注册", + "failedToUpdateOidcConfig": "更新 OIDC 配置失败", + "failedToMakeUserAdmin": "设为管理员失败", + "failedToStartTotpSetup": "启动 TOTP 设置失败", + "invalidVerificationCode": "无效的验证码", + "failedToDisableTotp": "禁用 TOTP 失败", + "failedToGenerateBackupCodes": "生成备用码失败" + } +} \ No newline at end of file diff --git a/src/components/LanguageSwitcher.tsx b/src/components/LanguageSwitcher.tsx new file mode 100644 index 00000000..4e51dd22 --- /dev/null +++ b/src/components/LanguageSwitcher.tsx @@ -0,0 +1,44 @@ +// Language switcher component for changing UI language +import React from 'react'; +import { useTranslation } from 'react-i18next'; +import { + Select, + SelectContent, + SelectItem, + SelectTrigger, + SelectValue, +} from '@/components/ui/select'; +import { Globe } from 'lucide-react'; + +const languages = [ + { code: 'en', name: 'English', nativeName: 'English' }, + { code: 'zh', name: 'Chinese', nativeName: '中文' }, +]; + +export function LanguageSwitcher() { + const { i18n, t } = useTranslation(); + + const handleLanguageChange = (value: string) => { + i18n.changeLanguage(value); + // Save to localStorage for persistence + localStorage.setItem('i18nextLng', value); + }; + + return ( +
Configure external identity provider for - OIDC/OAuth2 authentication.
+{t('admin.configureExternalProvider')}
{oidcError && (