feat: add internationalization support with next-intl

This commit is contained in:
beilunyang
2025-10-13 00:57:32 +08:00
parent 0fcc4b9e85
commit d175017b51
46 changed files with 1436 additions and 432 deletions
+43
View File
@@ -0,0 +1,43 @@
{
"signButton": {
"login": "Login / Sign Up",
"logout": "Logout",
"userAvatar": "User Avatar",
"linked": "Linked"
},
"loginForm": {
"title": "Welcome to MoeMail",
"subtitle": "Cute Temporary Email Service (。・∀・)",
"tabs": {
"login": "Login",
"register": "Sign Up"
},
"fields": {
"username": "Username",
"password": "Password",
"confirmPassword": "Confirm Password"
},
"actions": {
"login": "Login",
"register": "Sign Up",
"or": "OR",
"githubLogin": "Login with GitHub"
},
"errors": {
"usernameRequired": "Please enter username",
"passwordRequired": "Please enter password",
"confirmPasswordRequired": "Please confirm password",
"usernameInvalid": "Username cannot contain @ symbol",
"passwordTooShort": "Password must be at least 8 characters",
"passwordMismatch": "Passwords do not match"
},
"toast": {
"loginFailed": "Login Failed",
"loginFailedDesc": "Incorrect username or password",
"registerFailed": "Registration Failed",
"registerFailedDesc": "Please try again later",
"autoLoginFailed": "Auto-login failed, please login manually"
}
}
}
+26
View File
@@ -0,0 +1,26 @@
{
"app": {
"name": "MoeMail"
},
"lang": {
"en": "English",
"zhCN": "简体中文",
"switch": "Switch Language"
},
"actions": {
"ok": "OK",
"cancel": "Cancel",
"save": "Save",
"delete": "Delete"
},
"nav": {
"home": "Home",
"login": "Login",
"profile": "Profile",
"logout": "Logout",
"backToMailbox": "Back to Mailbox"
},
"github": "Get Source Code"
}
+87
View File
@@ -0,0 +1,87 @@
{
"noPermission": {
"title": "Insufficient Permission",
"description": "You don't have permission to access this page. Please contact the website administrator.",
"adminContact": "Admin Contact",
"backToHome": "Back to Home"
},
"layout": {
"myEmails": "My Emails",
"selectEmail": "Select an email to view messages",
"messageContent": "Message Content",
"selectMessage": "Select a message to view details",
"backToEmailList": "← Back to Email List",
"backToMessageList": "← Back to Message List"
},
"list": {
"emailCount": "{count}/{max} emails",
"emailCountUnlimited": "{count}/∞ emails",
"loading": "Loading...",
"loadingMore": "Loading more...",
"noEmails": "No emails yet, create one!",
"expiresAt": "Expires",
"permanent": "Permanent",
"deleteConfirm": "Confirm Delete",
"deleteDescription": "Are you sure you want to delete {email}? This will also delete all messages in this mailbox and cannot be undone.",
"deleteSuccess": "Email deleted successfully",
"deleteFailed": "Failed to delete email",
"error": "Error",
"success": "Success"
},
"create": {
"title": "Create Email",
"name": "Email Prefix",
"namePlaceholder": "Leave empty for random generation",
"domain": "Domain",
"domainPlaceholder": "Select a domain",
"expiryTime": "Validity Period",
"oneHour": "1 Hour",
"oneDay": "1 Day",
"threeDays": "3 Days",
"permanent": "Permanent",
"create": "Create",
"creating": "Creating...",
"success": "Email created successfully",
"failed": "Failed to create email"
},
"messages": {
"received": "Received",
"sent": "Sent",
"noMessages": "No messages yet",
"from": "From",
"to": "To",
"subject": "Subject",
"date": "Date",
"loading": "Loading...",
"loadingMore": "Loading more..."
},
"send": {
"title": "Send Email",
"from": "From",
"to": "To",
"toPlaceholder": "Recipient email address",
"subject": "Subject",
"subjectPlaceholder": "Email subject",
"content": "Content",
"contentPlaceholder": "Email content (supports HTML)",
"send": "Send",
"sending": "Sending...",
"success": "Email sent successfully",
"failed": "Failed to send email",
"dailyLimitReached": "Daily sending limit reached",
"dailyLimit": "Daily Limit: {count}/{max}",
"dailyLimitUnit": "emails/day"
},
"messageView": {
"loading": "Loading message details...",
"loadError": "Failed to load message details",
"networkError": "Network error, please try again later",
"retry": "Click to retry",
"from": "From",
"to": "To",
"time": "Time",
"htmlFormat": "HTML Format",
"textFormat": "Plain Text Format"
}
}
+23
View File
@@ -0,0 +1,23 @@
{
"title": "MoeMail",
"subtitle": "Cute Temporary Email Service",
"features": {
"privacy": {
"title": "Privacy Protection",
"description": "Protect your real email address"
},
"instant": {
"title": "Instant Delivery",
"description": "Receive emails in real-time"
},
"expiry": {
"title": "Auto Expiry",
"description": "Automatically expires when due"
}
},
"actions": {
"enterMailbox": "Enter Mailbox",
"getStarted": "Get Started"
}
}
+6
View File
@@ -0,0 +1,6 @@
{
"title": "MoeMail - Cute Temporary Email Service",
"description": "Secure, fast, and disposable temporary email addresses. Protect your privacy and stay away from spam. Instant delivery with automatic expiration.",
"keywords": "temporary email, disposable email, anonymous email, privacy protection, spam filter, instant delivery, auto expiry, secure email, verification email, temporary account, cute email, email service, privacy security, MoeMail"
}
+123
View File
@@ -0,0 +1,123 @@
{
"title": "Profile",
"card": {
"title": "User Information",
"name": "Name",
"role": "Role",
"roles": {
"EMPEROR": "Emperor",
"DUKE": "Duke",
"KNIGHT": "Knight",
"CIVILIAN": "Civilian"
}
},
"apiKey": {
"title": "API Key Management",
"description": "Create and manage API keys for accessing OpenAPI",
"create": "Create API Key",
"name": "Key Name",
"namePlaceholder": "Enter key name",
"key": "API Key",
"createdAt": "Created At",
"copy": "Copy",
"delete": "Delete",
"noKeys": "No API keys yet",
"createSuccess": "API key created successfully",
"createFailed": "Failed to create API key",
"deleteConfirm": "Confirm Delete",
"deleteDescription": "Are you sure you want to delete API key {name}? This action cannot be undone.",
"deleteSuccess": "API key deleted successfully",
"deleteFailed": "Failed to delete API key",
"viewDocs": "View Documentation",
"docs": {
"getConfig": "Get System Config",
"generateEmail": "Generate Temp Email",
"getEmails": "Get Email List",
"getMessages": "Get Message List",
"getMessage": "Get Single Message",
"notes": "Notes:",
"note1": "Replace YOUR_API_KEY with your actual API Key",
"note2": "/api/config endpoint provides system configuration including available email domains",
"note3": "emailId is the unique identifier for an email",
"note4": "messageId is the unique identifier for a message",
"note5": "expiryTime is the validity period in milliseconds: 3600000 (1 hour), 86400000 (1 day), 604800000 (7 days), 0 (permanent)",
"note6": "domain is the email domain, get available domains from /api/config endpoint",
"note7": "cursor is for pagination, get nextCursor from previous response",
"note8": "All requests require X-API-Key header"
}
},
"emailService": {
"title": "Resend Email Service Configuration",
"configRoleLabel": "Configurable Role Permissions",
"enable": "Enable Email Service",
"fixedRoleLimits": "Fixed Role Limits",
"emperorLimit": "Emperor can send unlimited emails without any restrictions",
"civilianLimit": "Cannot send emails",
"enableDescription": "When enabled, emails will be sent using Resend",
"apiKey": "Resend API Key",
"apiKeyPlaceholder": "Enter Resend API Key",
"dailyLimit": "Daily Limit",
"roleLimits": "Roles allowed to use sending feature",
"save": "Save Configuration",
"saving": "Saving...",
"saveSuccess": "Configuration saved successfully",
"saveFailed": "Failed to save configuration",
"unlimited": "Unlimited",
"disabled": "Sending permission not enabled",
"enabled": "Sending permission enabled"
},
"webhook": {
"title": "Webhook Configuration",
"description": "Notify specified URL when new emails arrive",
"description2": "We will send a POST request to this URL with information about the new email",
"description3": "View data format documentation",
"enable": "Enable Webhook",
"url": "Webhook URL",
"urlPlaceholder": "Enter webhook URL",
"test": "Test",
"testing": "Testing...",
"save": "Save Configuration",
"saving": "Saving...",
"saveSuccess": "Configuration saved successfully",
"saveFailed": "Failed to save configuration",
"testSuccess": "Webhook test successful",
"testFailed": "Webhook test failed",
"docs": {
"intro": "When a new email is received, we will send a POST request to the configured URL with the following headers:",
"exampleBody": "Request body example:",
"subject": "Email Subject",
"content": "Email text content",
"html": "Email HTML content"
}
},
"website": {
"title": "Website Configuration",
"description": "Configure website settings (Emperor only)",
"defaultRole": "Default Role for New Users",
"emailDomains": "Email Domains",
"emailDomainsPlaceholder": "Separate multiple domains with commas",
"adminContact": "Admin Contact",
"adminContactPlaceholder": "Email or other contact method",
"maxEmails": "Max Emails per User",
"save": "Save Configuration",
"saving": "Saving...",
"saveSuccess": "Configuration saved successfully",
"saveFailed": "Failed to save configuration"
},
"promote": {
"title": "Role Management",
"description": "Manage user roles (Emperor only)",
"search": "Search Users",
"searchPlaceholder": "Enter username or email",
"username": "Username",
"email": "Email",
"role": "Role",
"actions": "Actions",
"promote": "Set as",
"noUsers": "No users found",
"loading": "Loading...",
"updateSuccess": "User role updated successfully",
"updateFailed": "Failed to update user role"
}
}