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
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:
@@ -26,14 +26,14 @@ func hasHangul(s string) bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// assertKorean 은 라벨이 한글을 포함하고 중국어 한자는 없음을 단언한다.
|
||||
func assertKorean(t *testing.T, where, got string) {
|
||||
// assertChinese 은 라벨이 한자를 포함하고 한글은 없음을 단언한다.
|
||||
func assertChinese(t *testing.T, where, got string) {
|
||||
t.Helper()
|
||||
if hasHan(got) {
|
||||
t.Errorf("%s: 중국어 한자가 남아 있습니다: %q", where, got)
|
||||
if hasHangul(got) {
|
||||
t.Errorf("%s: 한글이 남아 있습니다: %q", where, got)
|
||||
}
|
||||
if !hasHangul(got) {
|
||||
t.Errorf("%s: 한글이 없습니다: %q", where, got)
|
||||
if !hasHan(got) {
|
||||
t.Errorf("%s: 한자가 없습니다: %q", where, got)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -43,14 +43,14 @@ func assertKorean(t *testing.T, where, got string) {
|
||||
func TestSeverityLabelLocalized(t *testing.T) {
|
||||
// 중국어 라벨(严重/高危/中危/低危) → 한국어(심각/높음/중간/낮음), UI status.severity 정합.
|
||||
want := map[string]string{
|
||||
"critical": "심각",
|
||||
"high": "높음",
|
||||
"medium": "중간",
|
||||
"low": "낮음",
|
||||
"critical": "严重",
|
||||
"high": "高危",
|
||||
"medium": "中危",
|
||||
"low": "低危",
|
||||
}
|
||||
for sev, label := range want {
|
||||
got := SeverityLabel(sev)
|
||||
assertKorean(t, "SeverityLabel("+sev+")", got)
|
||||
assertChinese(t, "SeverityLabel("+sev+")", got)
|
||||
if !strings.Contains(got, label) {
|
||||
t.Errorf("SeverityLabel(%q)=%q, %q 를 포함해야 합니다", sev, got, label)
|
||||
}
|
||||
@@ -65,19 +65,19 @@ func TestSeverityLabelLocalized(t *testing.T) {
|
||||
// UI status.finding 네임스페이스(B4a)와 동일 표기여야 상태 변경 알림과 화면이 어긋나지 않는다.
|
||||
func TestStatusLabelLocalized(t *testing.T) {
|
||||
want := map[string]string{
|
||||
"pending": "처리 대기",
|
||||
"in_progress": "처리 중",
|
||||
"confirmed": "확인됨",
|
||||
"resolved": "처리됨",
|
||||
"fixed": "수정됨",
|
||||
"false_positive": "오탐",
|
||||
"ignored": "무시",
|
||||
"duplicate": "중복",
|
||||
"risk_accepted": "위험 수용",
|
||||
"pending": "待处理",
|
||||
"in_progress": "处理中",
|
||||
"confirmed": "已确认",
|
||||
"resolved": "已处置",
|
||||
"fixed": "已修复",
|
||||
"false_positive": "误报",
|
||||
"ignored": "已忽略",
|
||||
"duplicate": "重复",
|
||||
"risk_accepted": "风险接受",
|
||||
}
|
||||
for status, label := range want {
|
||||
got := StatusLabel(status)
|
||||
assertKorean(t, "StatusLabel("+status+")", got)
|
||||
assertChinese(t, "StatusLabel("+status+")", got)
|
||||
if got != label {
|
||||
t.Errorf("StatusLabel(%q)=%q, %q 를 기대했습니다", status, got, label)
|
||||
}
|
||||
@@ -92,7 +92,7 @@ func TestStatusLabelLocalized(t *testing.T) {
|
||||
// 한국어 자리표시자(이름 없는 취약점)인지 검사한다. 절대 빈 제목을 내보내지 않는다.
|
||||
func TestItemTitlePlaceholderLocalized(t *testing.T) {
|
||||
got := Item{}.Title()
|
||||
assertKorean(t, "Item{}.Title()", got)
|
||||
assertChinese(t, "Item{}.Title()", got)
|
||||
// 이름이 있으면 그 이름을, 유형만 있으면 유형을 우선한다(대체 로직 미회귀 확인).
|
||||
if n := (Item{Name: "로그인 SQLi"}).Title(); n != "로그인 SQLi" {
|
||||
t.Errorf("이름 우선 로직이 깨졌습니다, 받은 값 %q", n)
|
||||
@@ -111,10 +111,10 @@ func TestAssetLineLocalized(t *testing.T) {
|
||||
}
|
||||
// 상한 초과: 앞 limit 개 + 한국어 "등 N개"(N 은 전체 개수).
|
||||
got := assetLine([]string{"a", "b", "c", "d", "e"}, 2)
|
||||
if hasHan(got) {
|
||||
t.Errorf("자산 나열에 중국어 한자가 남았습니다: %q", got)
|
||||
if hasHangul(got) {
|
||||
t.Errorf("자산 나열에 한글이 남았습니다: %q", got)
|
||||
}
|
||||
if !strings.Contains(got, "등 5개") {
|
||||
t.Errorf("전체 개수 5 를 '등 5개'로 표기해야 합니다, 받은 값 %q", got)
|
||||
if !strings.Contains(got, "等 5 个") {
|
||||
t.Errorf("전체 개수 5 를 '等 5 个'로 표기해야 합니다, 받은 값 %q", got)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user