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:
@@ -17,15 +17,15 @@ import (
|
||||
// summaryInstruction prompt and the "[此前摘要]"/"[新材料片段]" framing below are
|
||||
// agent-brain text sent to the model, so they stay in their benchmarked Chinese.
|
||||
var (
|
||||
errSideSummaryCallCap = errors.New("곁질문 컨텍스트 정리가 이번 처리 상한에 도달했습니다. 질문 범위를 좁힌 뒤 다시 시도해 주세요.")
|
||||
errSideSummaryIncomplete = errors.New("곁질문 요약이 완전히 생성되지 않았습니다. 다시 시도해 주세요.")
|
||||
errSideSummaryOverBudget = errors.New("곁질문 요약이 예산 이내로 줄어들지 않았습니다. 다시 시도해 주세요.")
|
||||
errSideHistoryCursor = errors.New("곁질문 기록 커서가 유효하지 않습니다.")
|
||||
errSideCompactionStalled = errors.New("곁질문 압축으로 컨텍스트를 더 줄이지 못해 재시도를 중단했습니다.")
|
||||
errSideSummaryCallCap = errors.New("旁路问答上下文整理已达到本次处理上限。请缩小问题范围后重试。")
|
||||
errSideSummaryIncomplete = errors.New("旁路问答摘要未完整生成,请重试。")
|
||||
errSideSummaryOverBudget = errors.New("旁路问答摘要未缩减到预算范围内,请重试。")
|
||||
errSideHistoryCursor = errors.New("旁路问答历史游标无效。")
|
||||
errSideCompactionStalled = errors.New("旁路问答压缩未能进一步缩减上下文,已停止重试。")
|
||||
)
|
||||
|
||||
// sideSummaryFailedPrefix prefixes a wrapped summarizer failure (keeps %w).
|
||||
const sideSummaryFailedPrefix = "곁질문 요약에 실패했습니다"
|
||||
const sideSummaryFailedPrefix = "旁路问答摘要失败"
|
||||
|
||||
// Memory is independent of the main snapshot. Through is a persisted ordinal,
|
||||
// not an array offset; restart, pagination and failed requests cannot shift it.
|
||||
|
||||
@@ -35,7 +35,7 @@ const instruction = "这是独立的旁路提问。主 Agent 正在执行原任
|
||||
const DefaultOutputTokens = 8192
|
||||
const MaxRecentExchanges = 20
|
||||
|
||||
var ErrContextBudget = errors.New("곁질문 컨텍스트를 압축해도 모델 예산을 초과합니다. 질문 범위를 좁히거나 모델 컨텍스트 설정을 조정해 주세요.")
|
||||
var ErrContextBudget = errors.New("旁路问答上下文压缩后仍超出模型预算。请缩小问题范围或调整模型上下文设置。")
|
||||
|
||||
// EstimateInputTokens follows norma's byte-based block estimate with its 4/3
|
||||
// safety factor. Include system/schema and framing costs too; JSON characters
|
||||
|
||||
@@ -13,13 +13,13 @@ import (
|
||||
// benchmarked Chinese; only text and errors shown to the user are localized
|
||||
// (BRIEF 현지화 방침: 출력 언어만 한국어, 프롬프트 본문은 보존).
|
||||
var (
|
||||
errSideModelInterrupted = errors.New("모델 응답이 중단되었습니다. 다시 질문해 주세요.")
|
||||
errSideNoAnswer = errors.New("모델이 답변을 반환하지 않았습니다.")
|
||||
errSideModelInterrupted = errors.New("模型响应已中断,请重新提问。")
|
||||
errSideNoAnswer = errors.New("模型未返回回答。")
|
||||
)
|
||||
|
||||
// msgSideToolUnavailable is the answer text shown when a side question tries to
|
||||
// trigger a tool call: side questions cannot run tools.
|
||||
const msgSideToolUnavailable = "현재 곁질문에서는 도구 작업을 실행할 수 없습니다. 작업 요청은 메인 대화에서 보내 주세요."
|
||||
const msgSideToolUnavailable = "当前旁路问答无法执行工具操作。请在主对话中发送任务请求。"
|
||||
|
||||
// SideQuestionService has no harness, tool executor, transcript writer or model
|
||||
// failover chain. Answer is one completion; Respond adds bounded preparation
|
||||
|
||||
@@ -7,25 +7,25 @@ import (
|
||||
"unicode"
|
||||
)
|
||||
|
||||
// assertKorean fails if msg is empty, carries a CJK Han ideograph (= leftover
|
||||
// untranslated Chinese), or has no Hangul at all. ASCII field names and the
|
||||
// "1–4000"-style ranges are fine; only Han marks an unlocalized string.
|
||||
func assertKorean(t *testing.T, label, msg string) {
|
||||
// assertChinese fails if msg is empty, carries Hangul (= leftover untranslated
|
||||
// Korean), or has no Han ideograph at all. ASCII field names and the
|
||||
// "1–4000"-style ranges are fine; only Hangul marks an unlocalized string.
|
||||
func assertChinese(t *testing.T, label, msg string) {
|
||||
t.Helper()
|
||||
if msg == "" {
|
||||
t.Fatalf("%s: 빈 메시지", label)
|
||||
}
|
||||
hangul := false
|
||||
han := false
|
||||
for _, r := range msg {
|
||||
if unicode.Is(unicode.Han, r) {
|
||||
t.Fatalf("%s: 중국어 한자가 남아 있습니다: %q", label, msg)
|
||||
}
|
||||
if unicode.Is(unicode.Hangul, r) {
|
||||
hangul = true
|
||||
t.Fatalf("%s: 한국어가 남아 있습니다: %q", label, msg)
|
||||
}
|
||||
if unicode.Is(unicode.Han, r) {
|
||||
han = true
|
||||
}
|
||||
}
|
||||
if !hangul {
|
||||
t.Fatalf("%s: 한글이 없습니다: %q", label, msg)
|
||||
if !han {
|
||||
t.Fatalf("%s: 汉字缺失: %q", label, msg)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -34,16 +34,16 @@ func assertKorean(t *testing.T, label, msg string) {
|
||||
// These surface through /api/.../side-questions into the chat 곁질문 panel, so a
|
||||
// revert to Chinese here is a user-visible regression and must fail the build.
|
||||
func TestSideQuestionOutputsLocalized(t *testing.T) {
|
||||
assertKorean(t, "ErrContextBudget", ErrContextBudget.Error())
|
||||
assertKorean(t, "errSideModelInterrupted", errSideModelInterrupted.Error())
|
||||
assertKorean(t, "errSideNoAnswer", errSideNoAnswer.Error())
|
||||
assertKorean(t, "msgSideToolUnavailable", msgSideToolUnavailable)
|
||||
assertKorean(t, "errSideSummaryCallCap", errSideSummaryCallCap.Error())
|
||||
assertKorean(t, "sideSummaryFailedPrefix", sideSummaryFailedPrefix)
|
||||
assertKorean(t, "errSideSummaryIncomplete", errSideSummaryIncomplete.Error())
|
||||
assertKorean(t, "errSideSummaryOverBudget", errSideSummaryOverBudget.Error())
|
||||
assertKorean(t, "errSideHistoryCursor", errSideHistoryCursor.Error())
|
||||
assertKorean(t, "errSideCompactionStalled", errSideCompactionStalled.Error())
|
||||
assertChinese(t, "ErrContextBudget", ErrContextBudget.Error())
|
||||
assertChinese(t, "errSideModelInterrupted", errSideModelInterrupted.Error())
|
||||
assertChinese(t, "errSideNoAnswer", errSideNoAnswer.Error())
|
||||
assertChinese(t, "msgSideToolUnavailable", msgSideToolUnavailable)
|
||||
assertChinese(t, "errSideSummaryCallCap", errSideSummaryCallCap.Error())
|
||||
assertChinese(t, "sideSummaryFailedPrefix", sideSummaryFailedPrefix)
|
||||
assertChinese(t, "errSideSummaryIncomplete", errSideSummaryIncomplete.Error())
|
||||
assertChinese(t, "errSideSummaryOverBudget", errSideSummaryOverBudget.Error())
|
||||
assertChinese(t, "errSideHistoryCursor", errSideHistoryCursor.Error())
|
||||
assertChinese(t, "errSideCompactionStalled", errSideCompactionStalled.Error())
|
||||
}
|
||||
|
||||
// TestSideQuestionBudgetSentinelPreserved: localizing the message must not break
|
||||
|
||||
Reference in New Issue
Block a user