WeKnora/frontend/src/api
sun 8486912b48
fix(i18n): 修复内置智能体名称与描述不随界面语言切换的问题 (#2828)
* fix(i18n): 修复内置智能体名称与描述不随界面语言切换的问题

问题现象:切换界面语言后,内置智能体的名称/描述仍显示旧语言,
需要强制刷新(Ctrl+F5)才能恢复正确语言。

35820ebb 已在 GetAgentByID / ListAgents 读取路径按请求语言重新本地化,
本提交补全剩余场景:

后端:
- 共享智能体读取(sharedAgentInfo / GetSharedAgentForTenant)与组织
  共享列表(ListOrgAgentShares)补 ApplyBuiltinAgentLocalization;
- IM 渠道列表(ListChannelsByTenant)改传请求 ctx,内置渠道的
  AgentName 按调用方语言从 YAML i18n 重新解析(DB 列可能为空或为
  落库时语言的残留值);
- 写入侧收敛:内置智能体配置落库时持久化 YAML default 语言的展示
  字段(GetBuiltinAgent 而非 GetBuiltinAgentWithContext,与 locale
  无关),更新/创建接口返回值再按调用方语言本地化,避免未覆盖的
  读取路径显示随机语言。

前端:
- utils/request.ts 导出 getCurrentLanguage;
- chatResources 的 agents 缓存与 orgStore 的 sharedAgents 缓存在
  新鲜度判断中加入"加载时语言 == 当前语言",切换语言后缓存立即
  失效,下次访问按新 Accept-Language 重新拉取并响应式更新。

* fix(i18n): 按请求发起时的语言给智能体缓存打戳,避免切换语言时命中旧数据

落地预取尚未返回就改界面语言时,原先会把 zh-CN 响应标成 en-US 新鲜缓存,最多冻 60s。in-flight 只复用同语言请求,写入前校验代际,并补共享/IM 本地化回归测试。

---------

Co-authored-by: asmh1989 <minhua.sun@velavigo.com>
Co-authored-by: wizardchen <wizardchen@tencent.com>
2026-08-27 11:53:45 +08:00
..
agent fix(i18n): 修复内置智能体名称与描述不随界面语言切换的问题 (#2828) 2026-08-27 11:53:45 +08:00
auth feat(invitation): add auto-accept switch for inviting registered users 2026-08-10 15:04:29 +08:00
chat feat(agent): preview skill artifacts and verify installs without running them (#2823) 2026-08-27 10:30:32 +08:00
chunker feat(frontend): chunking debug panel with live preview 2026-05-06 17:17:07 +08:00
datasource fix(feishu): resilient large-wiki sync — retry, streaming resume, failure visibility 2026-07-21 16:14:22 +08:00
embed fix(agent): honor suggested-questions limit parameter 2026-07-24 10:46:53 +08:00
initialization fix(docreader): restore optional XLSX header context 2026-07-28 22:00:36 +08:00
knowledge-base feat: support editing document summaries (#2752) 2026-08-20 14:54:53 +08:00
model feat(models): let system admins edit builtin model config 2026-07-14 15:56:02 +08:00
organization fix: harden shared agent source permissions 2026-07-30 12:28:23 +08:00
skill feat(sandbox): expose tenant skill management over HTTP and in the console (#2789) 2026-08-25 11:28:12 +08:00
system feat(agent): preview skill artifacts and verify installs without running them (#2823) 2026-08-27 10:30:32 +08:00
tenant feat: support updating API key configuration 2026-08-12 11:43:03 +08:00
wiki feat(memory): add cross-session long-term memory 2026-08-13 18:00:02 +08:00
chat-history.ts feat: implement chat history and retrieval settings 2026-03-09 11:46:56 +08:00
mcp-service.ts fix(mcp): coordinate OAuth token refresh and authorization polling 2026-07-23 15:35:24 +08:00
memory.ts feat(memory): add cross-session long-term memory 2026-08-13 18:00:02 +08:00
message-suggestion.ts feat(agent): add question suggestions with after-answer follow-ups 2026-07-14 11:17:25 +08:00
retrieval.ts feat: implement chat history and retrieval settings 2026-03-09 11:46:56 +08:00
storage-backend.ts feat(storage): add multi-instance storage backends per workspace 2026-07-15 14:54:39 +08:00
user-favorites.ts feat(favorites): implement user favorites and recents functionality 2026-05-18 17:28:58 +08:00
vector-store.ts feat(retriever): activate OpenSearch k-NN driver (PR 3 of 3) 2026-05-29 16:32:27 +08:00
web-search-provider.ts feat: add Exa WebSearch (#2617) 2026-08-11 17:05:52 +08:00
web-search.ts feat(web-search): refactor web search provider 2026-03-31 20:22:34 +08:00