Skip to content

feat(i18n): add full internationalization support for Studio editor#2427

Open
lixianglong1205 wants to merge 6 commits into
heygen-com:mainfrom
lixianglong1205:feat/i18n
Open

feat(i18n): add full internationalization support for Studio editor#2427
lixianglong1205 wants to merge 6 commits into
heygen-com:mainfrom
lixianglong1205:feat/i18n

Conversation

@lixianglong1205

Copy link
Copy Markdown

What

Add complete internationalization (i18n) support to the Studio editor, enabling Chinese language localization for all user-facing strings. Includes translated README, project overview, and skill documentation in Chinese.

Why

Make Hyperframes Studio accessible to Chinese-speaking users by providing a fully localized UI experience. This expands the potential user base and improves usability for non-English speakers.

How

  • Integrated react-i18next for runtime language switching in Studio components
  • Created locale files (en.json, zh.json) with comprehensive key-value pairs covering all panels, dialogs, tooltips, and UI text
  • Refactored hardcoded English strings across ~130 Studio files to use t() translation calls
  • Added Chinese translations for README (README_zh.md), project overview, and skill documentation
  • Fixed test environment issues (localStorage in happy-dom) and resolved lint/duplicate-key warnings caught by pre-commit hooks

Test plan

  • Unit tests added/updated -- all 130 test files pass (1396 tests)
  • Manual testing performed -- Studio builds successfully
  • Documentation updated -- Chinese translations added

lixianglong1205 and others added 3 commits July 10, 2026 00:32
为中文用户提供本地化文档,包括 README_zh、项目概览,以及 skills 目录下各技能的中文版本。

Co-authored-by: Cursor <cursoragent@cursor.com>
- 引入 i18next + react-i18next,支持中/英文切换
- 新增 i18n 基础设施(语言检测、类型声明、useLanguage Hook)
- ~80 个组件/Hook 中的硬编码英文字符串全部替换为 t() 翻译调用
- 提供中/英两套完整翻译文件(en.json / zh.json)
- 新增语言切换按钮 LanguageSwitcher
- 新增硬编码字符串检测脚本 check-hardcoded-strings.mjs
- 更新 test-setup.ts 以支持测试中的 i18n 初始化
- 更新 .gitignore 忽略 .cursor/ 目录

Co-authored-by: Cursor <cursoragent@cursor.com>
…PR readiness

- Fix oxlint unnecessary escape char warning in check-hardcoded-strings.mjs
- Remove duplicate keys (overflow, size, position) in en.json and zh.json
- Fix localStorage undefined in happy-dom test environment with shared
  MockStorage utility (SnapToolbar, distinctId, client tests)
- Add extra animation frame flush in offCanvasIndicatorRefresh flaky test
- Suppress fallow unused-export findings for intended public APIs
- Suppress fallow inherited complexity/duplication from i18n import-path
  line shifts (no logic changed)
- Apply oxfmt formatting to SKILL_zh.md files

Co-authored-by: Cursor <cursoragent@cursor.com>
@lixianglong1205

Copy link
Copy Markdown
Author
Snipaste_2026-07-14_23-06-34

lixianglong1205 and others added 3 commits July 15, 2026 00:36
Resolved conflicts across studio components/hooks. Preserved i18n
strings in useRazorSplit, useTimelineEditing. Restored URL origin-
stripping in deriveUsedPaths. Removed feature files deleted upstream
(StudioPreviewArea, NLELayout). Removed dangling Finder duplicates.

Co-authored-by: Cursor <cursoragent@cursor.com>
Added i18n support to files brought in or modified by the upstream main
merge that contained hardcoded English user-facing strings:

- TimelineToolbar.tsx: 13 tooltip/aria-label strings → i18n keys
- AssetContextMenu.tsx: "Add at playhead" + restored i18n composition
- useAppHotkeys.ts: 4 showToast strings (undo/redo/file-change/razor)
- useTimelineAssetDropOps.ts: 2 "cannotEdit" + "assetDropRestricted"
- useTimelineGroupEditing.ts: 1 "cannotEditWhileRecording"
- useBlockHandlers.ts: "alreadyInstalling" + "adding {{blockName}}"
- propertyPanelSections.tsx: "Content" + "Text color" labels
- useDomEditCommits.ts: "invalidLayoutValues" + "reorderFailed"
- DomEditCropHandles.tsx: "Reposition crop" + "Crop" labels
- AssetPreviewOverlay.tsx: "Preview: {{name}}" + "Close preview"
- PromotableControl.tsx: "Make this a variable"

Added 40+ new locale keys to en.json and zh.json across:
timelineToolbar, assetsTab, hooks.blockHandlers, hooks.domEdit,
editor.cropHandles, editor.promotable, nle

Co-authored-by: Cursor <cursoragent@cursor.com>
Added VariablesPanel, VariablesDeclarationForm, and
VariablesOtherCompositions to the i18n system. Added 22 new locale keys
(variablesPanel: 14 keys, variablesForm: 8 keys) to en.json and zh.json.
All hardcoded English strings replaced with t() calls across 3 files.

Co-authored-by: Cursor <cursoragent@cursor.com>
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.

1 participant