mirror of
https://github.com/QuantumNous/new-api.git
synced 2026-03-30 04:40:59 +00:00
feat(i18n): add backend multi-language support with user language preference
- Add go-i18n library for internationalization - Create i18n package with translation keys and YAML locale files (zh/en) - Implement i18n middleware for language detection from user settings and Accept-Language header - Add Language field to UserSetting DTO - Update API response helpers with i18n support (ApiErrorI18n, ApiSuccessI18n) - Migrate hardcoded messages in token, redemption, and user controllers - Add frontend language preference settings component - Sync language preference across header selector and user settings - Auto-restore user language preference on login
This commit is contained in:
@@ -62,4 +62,7 @@ const (
|
||||
// ContextKeyAdminRejectReason stores an admin-only reject/block reason extracted from upstream responses.
|
||||
// It is not returned to end users, but can be persisted into consume/error logs for debugging.
|
||||
ContextKeyAdminRejectReason ContextKey = "admin_reject_reason"
|
||||
|
||||
// ContextKeyLanguage stores the user's language preference for i18n
|
||||
ContextKeyLanguage ContextKey = "language"
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user