feat: introduce i18n system and class invitation codes
Add complete i18n infrastructure using next-intl (cookie-driven, without i18n routing) with zh-CN/en dictionary files, locale switcher, and NextIntlClientProvider in root layout. Add class invitation code system with new class_invitation_codes table, data-access layer (generate/validate/consume/revoke), server actions with permission checks, rate limiting, and audit logging. Add class-invitation-manager UI component. Refactor onboarding stepper to use i18n translations and accept new invitation code format (6-char alphanumeric) with backward compatibility for legacy 6-digit codes.
This commit is contained in:
23
src/shared/i18n/messages/en/errors.json
Normal file
23
src/shared/i18n/messages/en/errors.json
Normal file
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"auth": {
|
||||
"required": "Please sign in first",
|
||||
"forbidden": "Access denied",
|
||||
"sessionExpired": "Session expired, please sign in again"
|
||||
},
|
||||
"network": {
|
||||
"requestFailed": "Request failed, please try again later",
|
||||
"timeout": "Request timed out",
|
||||
"serverError": "Server error"
|
||||
},
|
||||
"validation": {
|
||||
"required": "This field is required",
|
||||
"invalidFormat": "Invalid format",
|
||||
"tooShort": "Too short",
|
||||
"tooLong": "Too long"
|
||||
},
|
||||
"db": {
|
||||
"notFound": "Record not found",
|
||||
"duplicate": "Record already exists",
|
||||
"constraintViolation": "Data constraint violation"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user