feat(i18n): default to English, localize runtime text and add Russian (#52)

This commit is contained in:
ryan
2026-11-07 21:35:55 +08:00
359 changed files with 15795 additions and 4333 deletions
+8 -8
View File
@@ -6,12 +6,12 @@ package model
// Domain validation messages used by model.Validate and other no-IO rules.
// Persistence / data-access messages belong in internal/repository (do not import repository).
const (
errTemplateKeyRequired = "模板标识符不能为空"
errTemplateNameRequired = "模板名称不能为空"
errTemplateContentRequired = "模板内容不能为空"
errAuthSourceNameRequired = "认证源名称不能为空"
errAuthSourceNameInvalid = "认证源名称只能包含字母、数字、短横线或下划线,且必须以字母或数字开头"
errAuthSourceTypeUnsupported = "认证源类型仅支持 oidc"
errAuthSourceDiscoveryURLRequired = "OIDC 认证源必须配置 Discovery URL"
errAuthSourceClientCredentialsRequired = "启用认证源前必须配置 Client ID 和 Client Secret" //nolint:gosec // false positive: this is an error message, not hardcoded credentials
errTemplateKeyRequired = "Template identifier must not be empty"
errTemplateNameRequired = "Template name must not be empty"
errTemplateContentRequired = "Template content must not be empty"
errAuthSourceNameRequired = "authentication source name must not be empty"
errAuthSourceNameInvalid = "authentication source name may only contain letters, digits, hyphens and underscores, and must start with a letter or digit"
errAuthSourceTypeUnsupported = "authentication source type must be oidc"
errAuthSourceDiscoveryURLRequired = "OIDC authentication sources require a Discovery URL"
errAuthSourceClientCredentialsRequired = "client ID and Client Secret are required before enabling an authentication source" //nolint:gosec // false positive: this is an error message, not hardcoded credentials
)
+1 -1
View File
@@ -34,7 +34,7 @@ type TaskExecution struct {
Result string `json:"result" gorm:"type:text"`
StartedAt *time.Time `json:"started_at" gorm:"index"`
FinishedAt *time.Time `json:"finished_at"`
Duration int64 `json:"duration" gorm:"comment:耗时毫秒"`
Duration int64 `json:"duration" gorm:"comment:Duration in milliseconds"`
Payload string `json:"payload" gorm:"type:text"`
TriggeredBy string `json:"triggered_by" gorm:"size:32;not null;default:system"`
CreatedAt time.Time `json:"created_at" gorm:"autoCreateTime;index"`