Skip to content

i18n: the 31 tool names are translated (zh-hans, zh-hant) - #1514

Merged
bflatastic merged 1 commit into
storytold:mainfrom
FeiLiuEM:i18n/1451-tool-names
Oct 29, 2026
Merged

bflatastic merged 1 commit into
storytold:mainfrom
FeiLiuEM:i18n/1451-tool-names

Conversation

@FeiLiuEM

@FeiLiuEM FeiLiuEM commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

The 31 tool names in Tool::label() were the last English surface in a translated interface: they reach the screen in the toolbar tooltip (header.rs:71-75) and the flyout rows (:106), and neither asked the catalog (#1451). This is the Chinese half — the Japanese rows are @zitann2020's, who has them ready from AE's own flyouts.

The catalog is keyed by the English source, so the rows land in the order the tests require: 31 rows in SIMPLIFIED_CHINESE and the same 31 in the same order in TRADITIONAL_CHINESE (catalogs_are_unique_and_keep_the_english_shape wants every Japanese key to exist in the Chinese one, and the two Chinese catalogs to be equal — the shape #1178 had, where the Chinese Settings rows landed before the Japanese).

Where the wordings come from, and which six to correct if your UI disagrees:

  • 11 are Adobe's own terms already in this family's catalogs — vectorcraft ships Illustrator's zh-hans and zh-hant sets, so Selection Tool is 选择工具 / 選取工具, Pen Tool 钢笔工具 / 筆型工具, and the shape, hand, zoom, eraser and type tools come from the same source.
  • 14 are from Adobe's zh_CN After Effects help: 向后平移工具 (Pan Behind), 蒙版羽化工具, 添加顶点工具 / 转换顶点工具, 画笔工具 / 仿制图章工具 / 橡皮擦工具, Roto 笔刷工具, 调整边缘工具, 对象遮罩工具, and 人偶位置控点工具 / 人偶扑粉控点工具 / 人偶重叠控点工具.
  • 6 are derived from Adobe's own wording, because its zh_CN pages do not name them: the three camera tools follow its control names (绕行摄像机 / 平移摄像机 / 推拉摄像机), 删除顶点工具 follows its 添加顶点工具 / 转换顶点工具, and 人偶弯曲控点工具 / 人偶高级控点工具 follow its three named puppet tools plus its 弯曲控点 / 高级控点 sections. Those six strings are the ones to change; nothing else depends on them.

Traditional Chinese follows this catalog's own conventions (遮色片, 攝影機, 頂點, 筆刷, 選取, 添加) rather than a second source — Adobe ships no zh_TW After Effects, which is also why its /tw/ guide carries none of these names.

CONVERTED gains state.rs (the sources live there and are drawn by header.rs, the case the comment above that list describes), and header.rs's tooltip and flyout row ask the catalog. app.auto's labels and Tool::from_name stay English, so ui.set {"tool": …} and the tool.* dispatch are untouched.

Two tests: every_tool_name_is_translated walks Tool::ALL in zh-hans and zh-hant (removing one row fails it with zh-hans: Selection Tool has no row), and the_toolbar_asks_the_catalog_for_the_tool_names pins that both drawn sites ask the catalog while the automation label keeps the English name (reverting the tooltip fails it).

Verified on Linux: cargo fmt --all --check, cargo test -p effectcraft-ui-egui — every suite passes, cargo clippy -p effectcraft-ui-egui --all-targets -- -D warnings.

Shares i18n/ui.rs with #1424 (which adds an Effects row to the same catalogs) and with the tool-name rows the Japanese PR will add — happy to rebase, whichever lands first.

Summary by CodeRabbit

  • New Features
    • Toolbar tool names are now translated into Simplified and Traditional Chinese, including the 31 tool labels shown in hover tooltips and flyout menus. Automation labels continue to use the original English tool names. This makes toolbar controls easier to understand for users viewing the interface in either Chinese locale.

@FeiLiuEM

Copy link
Copy Markdown
Contributor Author

Follow-up for the other panel catalogs: the 31 rows this PR adds land in SIMPLIFIED_CHINESE and TRADITIONAL_CHINESE (the tests require those two to match, and Japanese ⊆ Simplified), so Japanese, Ukrainian, Czech, Spanish and Brazilian Portuguese keep these tool names in English until their tables carry the same English sources as keys. #1581 has the list and the owners; the Japanese rows are @zitann2020's to add, and they could not be added before this PR — the Simplified keys had to exist first.

@coderabbitai

coderabbitai Bot commented Oct 26, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
Commits

Reviewing files that changed from the base of the PR and between 91172d7 and 1354aa4.

Files selected for processing: 2
  • crates/ui-egui/src/header.rs
  • crates/ui-egui/src/i18n/ui.rs
Files skipped from review as they are similar to previous changes: 1
  • crates/ui-egui/src/header.rs

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.

Walkthrough

The Chinese catalogs add translations for 31 toolbar tool names. Tool-slot tooltips and multi-tool fly-out rows display translated labels, while automation labels remain in English.

Changes: Toolbar Tool Label Localization

Layer / File(s) Summary
Add Chinese tool translations
crates/ui-egui/src/i18n/ui.rs
Simplified and Traditional Chinese catalogs add translations for 31 toolbar tool names. The converted-source inventory includes state.rs.
Use translated labels in the header
crates/ui-egui/src/header.rs, crates/ui-egui/src/i18n/ui.rs
Tool-slot tooltips and multi-tool fly-out rows display translated labels. A test checks translated display labels and English automation labels.

Priority: Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Feature

Possibly related issues

  • Issue 1451 describes the same Chinese catalog translations and header display changes. This pull request does not add the Japanese catalog rows mentioned as a follow-up.

Suggested reviewers: aiongg

Merge Risk: Minimal · up to 1354a

The change is limited to Chinese toolbar-label localization, with no established merge-blocking risk.

Pre-merge checks: Passed 5
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly and concisely identifies the main change: translating 31 tool names in the Simplified and Traditional Chinese catalogs.
Docstring Coverage Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 3 functions across 2 files.

Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

@FeiLiuEM

Copy link
Copy Markdown
Contributor Author

Rebased on current main (0.17.0), which is why it conflicted after 11 days: the rows are unchanged (31 tool names), header.rs now asks the catalog, and state.rs is in CONVERTED so every_row_is_used_by_a_converted_panel can see the English sources. cargo test -p effectcraft-ui-egui (307 + 602, 0 failed) and clippy -D warnings are clean on the CI box. Ready for a look.

The toolbar's tool labels come from Tool::label() through header.rs; they were the last English
surface on the chrome. 31 rows, Simplified and Traditional, and the header asks the catalog.
@FeiLiuEM
FeiLiuEM force-pushed the i18n/1451-tool-names branch from 91172d7 to 1354aa4 Compare October 29, 2026 11:40
@FeiLiuEM

Copy link
Copy Markdown
Contributor Author

Same treatment as #1581 and #2427, since it was under the same rule and got no reply of its own: rebased onto main in 1354aa4, gate green (25m15s).

Two things moved: header.rs extracted the tool slot into tool_slot(), which had dropped the tooltip's lookup on the way (the source guard in this PR caught it — header.rs no longer draws crate::i18n::tr(cur.label()) — and it is back, with the automation name still the English one); and menus.rs is now menus/*, so CONVERTED lists those files and state.rs alongside them, which is where the 31 English tool names live.

313 + 603 passed, clippy -D warnings clean.

@bflatastic
bflatastic merged commit 218b8e3 into storytold:main Oct 29, 2026
6 checks passed
@bflatastic

Copy link
Copy Markdown
Member

Merged, thank you @FeiLiuEM! It landed on main with a batch of community PRs, after a full workspace build and test run on Windows against the refactored main (fmt, strict clippy, about 4,100 tests, layers, assets and wasm).

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.

2 participants