feat(announcements,messaging): 公告与消息模块审计重构 — i18n + Error Boundary + a11y

- 新增审计报告 docs/architecture/audit/announcements-messages-audit-report.md
- 新增中英双语 i18n 字典 announcements.json / messages.json(11/13 个命名空间)
- 重构所有 announcements 和 messaging 组件接入 next-intl(useTranslations)
- 所有页面 page.tsx 使用 generateMetadata + getTranslations 替代硬编码 metadata
- 新增 7 个 error.tsx 错误边界(4 公告 + 3 消息),统一 EmptyState + i18n + 重试
- a11y 改进:announcement-card / message-list / notification-dropdown 添加 aria-label
- 同步架构图 004 和 005:i18n.messages 清单 + 已知问题修复记录
This commit is contained in:
SpecialX
2026-06-22 16:02:07 +08:00
parent 21c1e7a286
commit fde711ce46
30 changed files with 1085 additions and 261 deletions

View File

@@ -0,0 +1,90 @@
{
"title": {
"list": "Announcements",
"detail": "Announcement",
"adminList": "Announcement Management",
"edit": "Edit Announcement",
"create": "New Announcement"
},
"description": {
"list": "Stay up to date with the latest school announcements.",
"adminList": "Create and manage school-wide announcements.",
"edit": "Update the announcement details."
},
"filter": {
"all": "All",
"published": "Published",
"draft": "Draft",
"archived": "Archived",
"placeholder": "Filter by status"
},
"status": {
"draft": "Draft",
"published": "Published",
"archived": "Archived"
},
"type": {
"school": "School",
"grade": "Grade",
"class": "Class"
},
"form": {
"title": "Title",
"titlePlaceholder": "Announcement title",
"content": "Content",
"contentPlaceholder": "Write the announcement content...",
"type": "Type",
"typePlaceholder": "Select type",
"status": "Status",
"statusPlaceholder": "Select status",
"targetGrade": "Target Grade",
"targetGradePlaceholder": "Select a grade (optional)",
"targetClass": "Target Class",
"targetClassPlaceholder": "Select a class (optional)",
"submit": "Save",
"create": "Create",
"cancel": "Cancel",
"saving": "Saving..."
},
"actions": {
"new": "New Announcement",
"publish": "Publish",
"archive": "Archive",
"edit": "Edit",
"delete": "Delete",
"back": "Back"
},
"messages": {
"created": "Announcement created",
"updated": "Announcement updated",
"deleted": "Announcement deleted",
"published": "Announcement published",
"archived": "Announcement archived",
"notFound": "Announcement not found",
"createFailed": "Failed to save announcement",
"updateFailed": "Failed to save announcement",
"publishFailed": "Failed to publish",
"archiveFailed": "Failed to archive",
"deleteFailed": "Failed to delete",
"invalidForm": "Invalid form data",
"invalidState": "Invalid form state"
},
"meta": {
"publishedAt": "Published {date}",
"createdAt": "Created {date}",
"updatedAt": "Updated {date}",
"author": "by {name}"
},
"empty": {
"noAnnouncements": "No announcements",
"noAnnouncementsDesc": "There are no announcements yet.",
"noMatch": "No announcements match the current filter.",
"deleteTitle": "Delete announcement",
"deleteDesc": "This will permanently delete \"{title}\"."
},
"error": {
"loadFailed": "Failed to load announcements",
"loadFailedDesc": "Sorry, an unexpected error occurred while loading announcements. Please try again later.",
"retry": "Retry"
}
}

View File

@@ -0,0 +1,94 @@
{
"title": {
"list": "Messages",
"detail": "Message",
"compose": "Compose Message",
"reply": "Reply",
"newMessage": "New Message",
"notifications": "Notifications"
},
"description": {
"list": "Manage your inbox and stay updated with notifications.",
"compose": "Send a message to another user.",
"notifications": "Stay updated on your latest activities."
},
"tabs": {
"inbox": "Inbox",
"sent": "Sent"
},
"actions": {
"compose": "Compose",
"reply": "Reply",
"delete": "Delete",
"markRead": "Mark as read",
"markAllRead": "Mark all as read",
"send": "Send",
"sending": "Sending...",
"cancel": "Cancel",
"back": "Back",
"viewAll": "View all notifications",
"view": "View"
},
"form": {
"to": "To",
"toPlaceholder": "Select a recipient",
"subject": "Subject",
"subjectPlaceholder": "Message subject",
"content": "Content",
"contentPlaceholder": "Write your message...",
"selectRecipient": "Please select a recipient"
},
"status": {
"new": "New",
"read": "Read",
"sent": "Sent",
"unread": "Unread"
},
"meta": {
"from": "From",
"to": "To",
"unknown": "Unknown",
"noSubject": "(no subject)",
"readAt": "Read {date}"
},
"notificationType": {
"message": "Message",
"announcement": "Announcement",
"homework": "Homework",
"grade": "Grade"
},
"search": {
"placeholder": "Search messages by subject or content...",
"noResults": "No matching messages found"
},
"empty": {
"inboxEmpty": "Inbox is empty",
"inboxEmptyDesc": "You have no incoming messages yet.",
"sentEmpty": "No sent messages",
"sentEmptyDesc": "You have not sent any messages yet.",
"noNotifications": "No notifications",
"noNotificationsDesc": "You have no notifications yet.",
"noNotificationsDropdown": "No notifications",
"deleteTitle": "Delete message",
"deleteDesc": "This will permanently delete the message \"{subject}\"."
},
"messages": {
"sent": "Message sent",
"deleted": "Message deleted",
"markedRead": "Marked as read",
"allMarkedRead": "All notifications marked as read",
"notificationMarkedRead": "Notification marked as read",
"sendSelf": "Cannot send a message to yourself",
"sendFailed": "Failed to send message",
"deleteFailed": "Failed to delete",
"markReadFailed": "Failed to mark as read",
"notFound": "Message not found",
"invalidId": "Invalid message id",
"selectRecipient": "Please select a recipient"
},
"error": {
"loadFailed": "Failed to load messages",
"loadFailedDesc": "Sorry, an unexpected error occurred while loading messages. Please try again later.",
"retry": "Retry"
}
}