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:
+4
-4
@@ -136,16 +136,16 @@ func SkillDir() string {
|
||||
// DSN came from (for startup logging).
|
||||
func PostgresDSN() (dsn, source string, err error) {
|
||||
if v := strings.TrimSpace(os.Getenv("ARTEX_PG_DSN")); v != "" {
|
||||
return v, "환경 변수 ARTEX_PG_DSN", nil
|
||||
return v, "环境变量 ARTEX_PG_DSN", nil
|
||||
}
|
||||
db := Load().Database
|
||||
if d := strings.TrimSpace(db.DSN); d != "" {
|
||||
return d, "설정 파일 " + Path() + " (database.dsn)", nil
|
||||
return d, "配置文件 " + Path() + " (database.dsn)", nil
|
||||
}
|
||||
if db.Host != "" || db.DBName != "" || db.User != "" {
|
||||
return db.buildDSN(), "설정 파일 " + Path() + " (database 필드)", nil
|
||||
return db.buildDSN(), "配置文件 " + Path() + " (database 字段)", nil
|
||||
}
|
||||
return "", "", fmt.Errorf("데이터베이스 설정을 찾을 수 없습니다: 환경 변수 ARTEX_PG_DSN 이 설정되어 있지 않고, 설정 파일 %s 에도 database (dsn 또는 host/user/dbname) 설정이 없습니다. 설정 파일을 만들거나 환경 변수를 설정한 뒤 다시 시도하세요", Path())
|
||||
return "", "", fmt.Errorf("找不到数据库配置: 环境变量 ARTEX_PG_DSN 未设置,配置文件 %s 中也没有 database (dsn 或 host/user/dbname) 配置。请创建配置文件或设置环境变量后重试", Path())
|
||||
}
|
||||
|
||||
func (d Database) buildDSN() string {
|
||||
|
||||
@@ -27,13 +27,13 @@ func hasHangul(s string) bool {
|
||||
return false
|
||||
}
|
||||
|
||||
func assertKorean(t *testing.T, label, s string) {
|
||||
func assertChinese(t *testing.T, label, s string) {
|
||||
t.Helper()
|
||||
if hasHan(s) {
|
||||
t.Errorf("%s: Chinese Han ideograph remains: %q", label, s)
|
||||
if !hasHan(s) {
|
||||
t.Errorf("%s: no Han found (expected Chinese): %q", label, s)
|
||||
}
|
||||
if !hasHangul(s) {
|
||||
t.Errorf("%s: no Hangul found (expected Korean): %q", label, s)
|
||||
if hasHangul(s) {
|
||||
t.Errorf("%s: Hangul remains: %q", label, s)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -51,7 +51,7 @@ func TestPostgresDSNErrorLocalized(t *testing.T) {
|
||||
if err == nil {
|
||||
t.Fatal("missing config should error")
|
||||
}
|
||||
assertKorean(t, "startup error", err.Error())
|
||||
assertChinese(t, "startup error", err.Error())
|
||||
|
||||
// The identifiers an operator must act on stay verbatim (not translated).
|
||||
for _, want := range []string{"ARTEX_PG_DSN", "database", "dsn", "host/user/dbname"} {
|
||||
@@ -78,7 +78,7 @@ func TestPostgresDSNSourceLocalized(t *testing.T) {
|
||||
if _, source, err := PostgresDSN(); err != nil {
|
||||
t.Fatalf("env source: %v", err)
|
||||
} else {
|
||||
assertKorean(t, "env source", source)
|
||||
assertChinese(t, "env source", source)
|
||||
}
|
||||
|
||||
// config file dsn source
|
||||
@@ -90,7 +90,7 @@ func TestPostgresDSNSourceLocalized(t *testing.T) {
|
||||
if _, source, err := PostgresDSN(); err != nil {
|
||||
t.Fatalf("dsn source: %v", err)
|
||||
} else {
|
||||
assertKorean(t, "dsn source", source)
|
||||
assertChinese(t, "dsn source", source)
|
||||
}
|
||||
|
||||
// config file fields source
|
||||
@@ -100,6 +100,6 @@ func TestPostgresDSNSourceLocalized(t *testing.T) {
|
||||
if _, source, err := PostgresDSN(); err != nil {
|
||||
t.Fatalf("fields source: %v", err)
|
||||
} else {
|
||||
assertKorean(t, "fields source", source)
|
||||
assertChinese(t, "fields source", source)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user