i18n(figures): 交互图表 UI 文案中文化覆盖层#27
Merged
Merged
Conversation
134 个 LF 交互 widget 的静态文案全量中文化,采用覆盖层架构而非改源: - 新增 site/figures-i18n-zh.js(zh 特化,C 类保护):包装 mountLessonFigures,挂载后查表替换标题(lf-label)、操作提示、 控件 label、说明散文(lf-cap)。未命中保持英文——上游新增 widget 自动安全降级,翻译表事后补 - 上游 figures*.js / lesson-figures.js 保持 byte 级一致,每日同步 照旧一把梭,不背手工合并债 - 翻译范围:134 标题 + 123 操作提示 + ~290 控件 label + 134 段 caption(约 4900 词教学散文)。词向量/n-gram 的英文词样本、 变量名、公式、演示数据刻意不翻 - 不翻动态拼接文案(lf-meta/lf-num/lf-formula,拖动实时重写, 需 hook 渲染函数,第一期不碰)与 figures.js 旧大动画 10 个 验证:覆盖率页 134/134 caption 中文、129 标题中文(5 个译法即 英文术语形态);真实课页 policy-gradient widget 中文渲染 + 拖动 滑杆动态更新不受影响 + 零 console 错误;build --check 通过。
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
运行时实验发现 9 个 widget(gpu-memory-breakdown、zero-sharding、 speculative-decoding、tool-routing、autonomy-oversight、bayes-update、 entropy-kl 等)在 _render() 里重建 ctrl 行,mount 时的替换被拖动冲掉, 出现「中文→英文」跳变。 修复:host 上挂 input/change 委托监听(冒泡晚于 widget 渲染),交互后 重跑该 host 的 ctrl 替换;label 含可变数字的条目(activations (batch N)、 ÷ N、draft N、docN tf=M)新增 6 条模式匹配兜底。 验证:回退实验 9 个 widget 全部清零(唯一剩余为 sampling-decoder 候选词演示数据的误报,刻意不翻范围)。
审查(134 段 CAP 全量对照 + 术语 grep docs 验证)发现: - CONDITIONING(linear-system-conditioning widget)条件控制→条件数: 该 widget 讲线性方程组条件数/病态性,非生成模型条件控制(真错译) - 投机解码→推测解码:宿主课 25-speculative-decoding 正文通篇用 「推测解码」,全站 72 vs 22 - 权重绑定→权重共享:docs 已显式定名(pre-training-mini-gpt) - 残差「点到直线的距离」→「竖直方向上的差距」(垂直距离歧义) - differential-attention「注意力质量」→「注意力权重」(mass 歧义) - 「百里挑一的疾病」→「患病率约 1/100」(成语褒义错配 + 保留字面率) - 「天真的大权重」→「朴素地取大初始权重」(翻译腔)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
概要
134 个 LF 交互 widget 的静态 UI 文案全量中文化。核心架构决策:覆盖层而非改源——上游 figures*.js 保持 byte 级一致,每日同步照旧一把梭。
实现
site/figures-i18n-zh.js(687+ 行,zh 特化 C 类保护):包装mountLessonFigures,widget 挂载后查表替换四类静态文案(标题/操作提示/控件 label/caption)翻译范围
刻意不翻:词向量/n-gram widget 的英文词样本(cat/the/king——翻了会破坏英文词向量演示语义)、变量名(w1、β、d_model)、公式、doc1 tf=4 等演示数据。
不在本期范围(fail-loud)
验证
node site/build.js --check通过(503 课)