refactor(i18n): Extracted multiple fields in the Service component for translation.

- Extracted multiple fields in the Service component for translation.
- Optimized the structure of the translation file, categorizing it by functional modules.
This commit is contained in:
YiZixuan
2025-08-17 15:19:01 +08:00
parent b068c0cd51
commit 6bf75b2bf7
15 changed files with 319 additions and 92 deletions
+68 -3
View File
@@ -2,9 +2,6 @@
import { ServicesTranslations } from '../types/services';
export const servicesTranslations: ServicesTranslations = {
serviceName: "Service Name",
serviceNameDesc: "Enter a descriptive name for your service",
serviceType: "Service Type",
serviceStatus: "Service Status",
responseTime: "Response Time",
uptime: "Uptime",
@@ -19,4 +16,72 @@ export const servicesTranslations: ServicesTranslations = {
allTypes: "All Types",
createNewService: "Create New Service",
createNewServiceDesc: "Fill in the details to create a new service to monitor.",
// ServiceBasicFields.tsx
serviceName: "Service Name",
serviceNameDesc: "Enter a descriptive name for your service",
// ServiceConfigFields.tsx
checkInterval: "Check Interval",
seconds: "seconds",
minute: "minute",
minutes: "minutes",
hour: "hour",
hours: "hours",
custom: "Custom",
checkIntervalPlaceholder: "Enter interval in seconds",
backToPresets: "Back to presets",
checkIntervalDesc: "How often to check the service status",
checkIntervalDescCustom: "Enter custom interval in seconds (minimum 10 seconds)",
retryAttempts: "Retry Attempts",
attempt: "attempt",
attempts: "attempts",
retryAttemptsDesc: "Number of retry attempts before marking as down",
// ServiceForm.tsx
updateService: "Update Service",
createService: "Create Service",
// ServiceNotificationFields.tsx
enableNotifications: "Enable Notifications",
enableNotificationsDesc: "Enable or disable notifications for this service",
notificationChannels: "Notification Channels",
notificationChannelsEnabledDesc: "Select notification channels for this service",
notificationChannelsDesc: "Enable notifications first to select channels",
notificationChannelsPlaceholder: "Add a notification channel",
alertTemplate: "Alert Template",
alertTemplateLoading: "Loading templates...",
alertTemplatePlaceholder: "Select an alert template",
alertTemplateEnabledDesc: "Choose a template for alert messages",
alertTemplateDesc: "Enable notifications first to select template",
// ServiceTypeField.tsx
serviceType: "Service Type",
serviceTypeHTTPDesc: "Monitor websites and REST APIs with HTTP/HTTPS Protocol",
serviceTypePINGDesc: "Monitor host availability with PING Protocol",
serviceTypeTCPDesc: "Monitor TCP port connectivity with TCP Protocol",
serviceTypeDNSDesc: "Monitor DNS resolution",
// ServiceRegionalFields.tsx
regionalMonitoring: "Regional Monitoring",
regionalMonitoringDesc: "Assign this service to regional monitoring agents for distributed monitoring",
regionalAgents: "Regional Agents",
regionalAgentsLoading: "Loading agents...",
regionalAgentsAvailablePlaceholder: "Select additional regional agents...",
regionalAgentsAllSelected: "All available agents selected",
regionalAgentsNoAvailable: "No regional agents available",
regionalAgentsNoOnlineAvailable: "No online regional agents available",
regionalAgentsNotFoundMessage: "No online regional agents found. Services will use default monitoring.",
regionalAgentsNotSelectedMessage: "No regional agents selected. Service will use default monitoring.",
// ServiceUrlField.tsx
targetDefault: "Target URL/Host",
targetDNS: "Domain Name",
targetHTTPDesc: "Enter the full URL including protocol (http:// or https://)",
targetPINGDesc: "Enter hostname or IP address to ping",
targetTCPDesc: "Enter hostname or IP address for TCP connection test",
targetTCPPortDesc: "Enter the port number for TCP connection test",
targetDNSDesc: "Enter domain name for DNS record monitoring (A, AAAA, MX, etc.)",
targetDefaultDesc: "Enter the target URL or hostname for monitoring",
targetDefaultPlaceholder: "Enter URL or hostname",
};
+13 -6
View File
@@ -2,18 +2,18 @@
import { SettingsTranslations } from '../types/settings';
export const settingsTranslations: SettingsTranslations = {
// Tabs
// General Settings - Tabs
systemSettings: "System Settings",
mailSettings: "Mail Settings",
// System Settings
// General Settings - System Settings
appName: "Application Name",
appURL: "Application URL",
senderName: "Sender Name",
senderEmail: "Sender Email Address",
hideControls: "Hide Controls",
// Mail Settings
// General Settings - Mail Settings
smtpSettings: "SMTP Configuration",
smtpEnabled: "Enable SMTP",
smtpHost: "SMTP Host",
@@ -24,7 +24,7 @@ export const settingsTranslations: SettingsTranslations = {
enableTLS: "Enable TLS",
localName: "Local Name",
// Test Email
// General Settings - Test Email
testEmail: "Test Email",
sendTestEmail: "Send test email",
emailTemplate: "Email template",
@@ -39,7 +39,7 @@ export const settingsTranslations: SettingsTranslations = {
enterEmailAddress: "Enter email address",
sending: "Sending...",
// Actions and status
// General Settings - Actions and status
save: "Save Changes",
saving: "Saving...",
settingsUpdated: "Settings updated successfully",
@@ -48,5 +48,12 @@ export const settingsTranslations: SettingsTranslations = {
testConnection: "Test Connection",
testingConnection: "Testing Connection...",
connectionSuccess: "Connection successful",
connectionFailed: "Connection failed"
connectionFailed: "Connection failed",
// User Management
addUser: "Add User",
permissionNotice: "Permission Notice:",
permissionNoticeAddUser: "As an admin user, you do not have access to view or modify system and mail settings. These settings can only be accessed and modified by Super Admins. Contact your Super Admin if you need to make changes to system configuration or mail settings.",
loadingSettings: "Loading settings...",
loadingSettingsError: "Error loading settings",
};