Localize user-facing UI, agent output, and backend messages to Simplified Chinese
ci / go (push) Waiting to run
ci / go-db (agent) (push) Waiting to run
ci / go-db (config) (push) Waiting to run
ci / go-db (db) (push) Waiting to run
ci / go-db (evidence) (push) Waiting to run
ci / go-db (llmrec) (push) Waiting to run
ci / go-db (server) (push) Waiting to run
detections / detections (push) Waiting to run
docs / links (push) Waiting to run
web / web (push) Waiting to run

This commit is contained in:
dela
2026-10-09 14:08:31 +08:00
parent 8af63417c8
commit 97668dab7e
148 changed files with 1671 additions and 1672 deletions
+14 -14
View File
@@ -40,17 +40,17 @@ func (emailChannel) DestinationKeys() []string { return []string{"host", "port",
func (emailChannel) Validate(cfg map[string]any) error {
if cfgString(cfg, "host") == "" {
return errors.New("SMTP 서버 주소가 없습니다")
return errors.New("缺少 SMTP 服务器地址")
}
port := cfgInt(cfg, "port")
if port <= 0 || port > 65535 {
return errors.New("SMTP 포트가 올바르지 않습니다 (1-65535 범위여야 합니다)")
return errors.New("SMTP 端口无效(必须在 1-65535 范围内)")
}
if cfgString(cfg, "from") == "" {
return errors.New("발신자 주소가 없습니다")
return errors.New("缺少发件人地址")
}
if len(cfgStrings(cfg, "to")) == 0 {
return errors.New("수신자 주소가 최소 하나 필요합니다")
return errors.New("至少需要一个收件人地址")
}
return nil
}
@@ -83,7 +83,7 @@ func (c emailChannel) Send(ctx context.Context, cfg map[string]any, m Message) (
if !implicitTLS {
if ok, _ := client.Extension("STARTTLS"); ok {
if err := client.StartTLS(&tls.Config{ServerName: host, MinVersion: tls.VersionTLS12}); err != nil {
return 0, fmt.Errorf("STARTTLS 실패: %w", err)
return 0, fmt.Errorf("STARTTLS 失败:%w", err)
}
}
}
@@ -93,28 +93,28 @@ func (c emailChannel) Send(ctx context.Context, cfg map[string]any, m Message) (
// 这是**正确**的安全行为,不能绕过,但需要把原因翻译清楚——
// 否则使用者只会看到「unencrypted connection」而不知道该怎么办。
if strings.Contains(err.Error(), "unencrypted connection") {
return 0, Permanent(fmt.Errorf("자격 증명 전송을 거부했습니다: 연결이 암호화되지 않았습니다. TLS 를 켜거나, 465 포트(암시적 TLS)를 사용하거나, 「TLS 사용」을 체크하세요 (%w)", err))
return 0, Permanent(fmt.Errorf("拒绝发送凭据:连接未加密。请开启 TLS、使用 465 端口(隐式 TLS),或勾选「使用 TLS」(%w)", err))
}
return 0, Permanent(fmt.Errorf("SMTP 인증 실패: %w", err))
return 0, Permanent(fmt.Errorf("SMTP 认证失败:%w", err))
}
}
if err := client.Mail(from); err != nil {
return 0, smtpStageError(fmt.Sprintf("발신자 %s 주소가 거부되었습니다", from), err)
return 0, smtpStageError(fmt.Sprintf("发件人地址 %s 被拒绝", from), err)
}
for _, rcpt := range to {
if err := client.Rcpt(rcpt); err != nil {
return 0, smtpStageError(fmt.Sprintf("수신자 %s 주소가 거부되었습니다", rcpt), err)
return 0, smtpStageError(fmt.Sprintf("收件人地址 %s 被拒绝", rcpt), err)
}
}
w, err := client.Data()
if err != nil {
return 0, fmt.Errorf("SMTP DATA 실패: %w", err)
return 0, fmt.Errorf("SMTP DATA 失败:%w", err)
}
if _, err := w.Write([]byte(msg)); err != nil {
return 0, fmt.Errorf("메일 본문 쓰기 실패: %w", err)
return 0, fmt.Errorf("写入邮件正文失败:%w", err)
}
if err := w.Close(); err != nil {
return 0, fmt.Errorf("메일 제출 실패: %w", err)
return 0, fmt.Errorf("提交邮件失败:%w", err)
}
// Quit 失败不影响「邮件已被服务器接收」这个事实,因此忽略其错误。
_ = client.Quit()
@@ -145,13 +145,13 @@ func emailDial(ctx context.Context, addr, host string, implicitTLS bool) (*smtp.
conn, err = d.DialContext(ctx, "tcp", addr)
}
if err != nil {
return nil, fmt.Errorf("SMTP 서버 연결 실패: %w", err)
return nil, fmt.Errorf("连接 SMTP 服务器失败:%w", err)
}
_ = conn.SetDeadline(time.Now().Add(emailSessionTimeout))
client, err := smtp.NewClient(conn, host)
if err != nil {
conn.Close()
return nil, fmt.Errorf("SMTP 핸드셰이크 실패: %w", err)
return nil, fmt.Errorf("SMTP 握手失败:%w", err)
}
return client, nil
}