Skip to content

Add a Simplified Chinese localization of Transformer Explainer#86

Open
Jian1202 wants to merge 15 commits into
poloclub:mainfrom
Jian1202:codex/localization-refresh
Open

Add a Simplified Chinese localization of Transformer Explainer#86
Jian1202 wants to merge 15 commits into
poloclub:mainfrom
Jian1202:codex/localization-refresh

Conversation

@Jian1202

@Jian1202 Jian1202 commented Jul 24, 2026

Copy link
Copy Markdown

Closes #57.

Summary

This PR implements the Simplified Chinese (zh-CN) localization proposed in #57.
It aims to make Transformer Explainer more accessible to Chinese-speaking learners
while preserving the project’s interactive learning experience.

Included changes

  • Translated the interface, tooltips, tutorials, and explanatory materials.
  • Added localized feedback for token counts, model loading, cache state, and failures.
  • Improved responsive behavior for the localized experience.
  • Corrected several GPT-2 teaching explanations and examples.
  • Updated the localized README, including the scope and known limitations of the Chinese version.
  • Updated project dependencies and static-build configuration so the localized fork can be built and deployed reliably.

Scope and limitations

  • The underlying checkpoint remains English GPT-2 Small; this PR does not introduce a Chinese language model.
  • Chinese text can be tokenized, but byte-level token fragments may display as in per-token visualizations. This is a display limitation rather than a page encoding issue.
  • Some GitHub Pages paths and localized-site links are specific to the Chinese fork. If maintainers prefer, I can separate those deployment-specific changes from the localization work.

Validation

  • npm ci
  • npm run build
  • npm run check:localization
  • Manual checks of generation, sampling controls, visualizations, tutorials, and responsive layouts

Translated user interface text, tooltips, and documentation to Simplified Chinese across all major Svelte components and the README. Updated meta tags, popovers, tooltips, and UI labels for a fully localized user experience. No changes to core logic or functionality.
Updated GitHub Actions workflow for deploying to GitHub Pages. Added Node.js setup, build steps, and adjusted artifact upload path.
Changed import statements in LinearSoftmax.svelte and OperationGroup.svelte to reference the 'Popovers' directory with a capital 'P' instead of 'popovers'. This ensures consistency with the directory naming and may resolve issues on case-sensitive file systems.
Updated README.md to enhance clarity and localization details.
Update Chinese README: insert separators and a new notice stating that this Chinese localization will stop syncing with the upstream project in 2026.
同步模型可视化、依赖与交互优化,保留中文分支现有部署配置,并排除上游自动同步工作流。
- 对齐 Svelte 5、SvelteKit 与 Vite 6 依赖并重建锁文件
- 部署流程改用 npm ci,保留中文版 GitHub Pages 基础路径
- 恢复预渲染 SSR,并补充 Sass、全局类型与汉化审计脚本
- 使用项目真实英文示例、词元切分与词元 ID
- 区分位置编码概念与 GPT-2 可学习位置嵌入
- 修正 Pre-LN、推理期 Dropout 与 Top-p 归一化说明
- 集中管理界面与动态提示文案,补齐组件和弹窗中的英文残留
- 使用真实 GPT-2 分词器计数,并显示下载、缓存、就绪和失败状态
- 优化示例菜单、移动端预览、宽画布滚动和教程卡片的响应式行为
- 明确中文界面与英文 GPT-2 Small 的能力边界
- 说明模型体积、缓存、移动端行为和人工上游同步策略
- 更新中文版站点链接、分享元数据、目录结构与论文信息
@Jian1202 Jian1202 closed this Jul 24, 2026
@Jian1202 Jian1202 changed the title Codex/localization refresh Improve Chinese localization, GPT-2 guidance, and deployment configuration Jul 24, 2026
- 增加关于中文字符在分词时显示为 `�` 的说明,澄清这是 GPT-2 的分词限制
- 确保原版功能问题链接的格式一致性
@Jian1202 Jian1202 changed the title Improve Chinese localization, GPT-2 guidance, and deployment configuration Add a Simplified Chinese localization of Transformer Explainer Jul 24, 2026
@Jian1202 Jian1202 reopened this Jul 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature] Proposal: Chinese (zh-CN) localization for Transformer Explainer

1 participant