Repository navigation
Conversation
- 新增 zh-CN / en-US 语言资源与类型安全的 i18n 模块,无第三方运行时依赖 - Hero 顶部新增“中 / EN”语言切换组,原位更新文案与 html.lang,不重建 DOM - 补充语言切换控件样式与窄屏布局,保持拖拽交互不受影响 - 新增 Playwright 用例覆盖初始中文、双向切换、按钮状态与切换前后拖拽 - 同步主 Spec 并归档 OpenSpec Change add-demo-i18n Refs HAM-14 Co-authored-by: multica-agent <github@multica.ai>
This branch has not been deployed
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.
Summary
为 Demo 增加完整的中英文国际化切换能力(关联 Multica 任务:HAM-14)。
apps/demo/src/locales/zh-CN.ts、apps/demo/src/locales/en-US.ts语言资源与apps/demo/src/i18n.ts,通过共享TranslationKey类型在编译期校验两套资源完整对应,无第三方运行时依赖apps/demo/src/main.ts接入类型安全的翻译键,为文本节点添加稳定的data-i18n标记;Hero 顶部新增“中 / EN”语义化切换组,切换时只原位更新文案、html.lang、当前态与aria-pressed,不重建 DOMapps/demo/src/style.css补充语言切换控件样式、键盘焦点态与窄屏换行布局tests/e2e/i18n.spec.ts,覆盖初始中文渲染、双向切换、按钮当前态以及切换前后拖拽行为demo-internationalization已同步;Changeadd-demo-i18n已归档至openspec/changes/archive/2026-09-15-add-demo-i18n/Testing
yarn build:通过yarn test:11 suites / 26 tests 通过yarn lint:通过PLAYWRIGHT_BROWSERS_PATH=/tmp/opencode/pw-browsers CI=1 yarn test:e2e:8/8 通过openspec validate --all --strict:2 passed / 0 failedgit diff --check:通过yarn format:check:报告 46 个既存未格式化文件(均非本次变更文件),未做批量修复OpenSpec
add-demo-i18nopenspec/specs/demo-internationalization/spec.md)openspec/changes/archive/2026-09-15-add-demo-i18n/)