Files
artex/db/task_assets_localized_test.go
T
dela 97668dab7e
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
Localize user-facing UI, agent output, and backend messages to Simplified Chinese
2026-10-09 14:08:31 +08:00

31 lines
1.0 KiB
Go

package db
import (
"testing"
"unicode"
)
// TestManualTaskScopeSummaryLocalized pins the manual task-scope provenance label.
// It is stored on task_asset_links.source_summary (AddTaskScope / SetTaskAssetSource)
// and rendered verbatim on the task detail sessions/assets tabs, so reverting it to
// Chinese would surface mixed-language provenance labels in the same panel. The
// existing task_assets_test.go already asserts the stored value equals this constant
// via the symbol, so pinning the constant here protects the user-facing text too.
func TestManualTaskScopeSummaryLocalized(t *testing.T) {
if manualTaskScopeSummary == "" {
t.Fatal("manualTaskScopeSummary: 空字符串")
}
hasHan := false
for _, r := range manualTaskScopeSummary {
if unicode.Is(unicode.Hangul, r) {
t.Fatalf("manualTaskScopeSummary: 仍残留韩文: %q", manualTaskScopeSummary)
}
if unicode.Is(unicode.Han, r) {
hasHan = true
}
}
if !hasHan {
t.Fatalf("manualTaskScopeSummary: 缺少汉字: %q", manualTaskScopeSummary)
}
}