Repository navigation
v0.2.1-rc.1现有的思考机器翻译的不足 #9969
Replies: 2 comments 1 reply
|
补充一份实现层定位,供 triage(DSH 0.2.1-rc.2,官方桌面端,插件「思考过程机器翻译」): 根因在客户端切片,不在翻译服务。
两条下游链路都没有代码保护。 默认 Bing/Google 匿名链路把片段原文直接放进 POST body,没有 system prompt 可约束;付费 DeepSeek Flash 的固定 system prompt 只有 期望行为:代码内容保持原样(跳过 fenced/inline code,只翻译自然语言),或至少提供「不翻译代码块」开关。 另一个入口问题:README 已把「译文可能改变 Markdown 或代码格式」列为已知限制( English summary: |
|
再补充一些,0.2.1-rc.2似乎还没有在这方面有所改动,就基于rc.1(web端)展开 1.问题根因(代码级) client-ui-cot-translation/src/client/translation.ts 的 reasoningFragments() 只按空行正则 + maxTextChars(默认 4000)切分,没有围栏/行内/缩进代码识别;片段类型 {text, suffix, complete} 没有「不可翻译」标记。
function reasoningFragments(text, running, maxTextChars) { 2.2 译文回填:同文件 ReasoningTranslation.emit() const text = this.fragments.map(fragment => { 2.3 匿名链路(Bing/Google):translator/src/provider.ts case 'google': { const form = new URLSearchParams({ client:'gtx', sl, tl, dt:'t', q: spec.text }) ... } 2.4 付费链路(DeepSeek Flash):translator/src/deepseek.ts(似乎还不可用) const system = 2.5 配置与 UI 2.6 根因归纳 |
Uh oh!
There was an error while loading. Please reload this page.
翻译部分将代码也包括进去,使阅读难度上升
The translation part also includes the code, making it harder to read
All reactions