Repository navigation
fix(Splitter): localize collapse control labels - #58978
Conversation
|
|
👁 Visual Regression Report for PR #58978 Failed ❌
Warning There are more diffs not shown in the table. Please check the Full Report for details. Important There are 13 diffs found in this PR: 🔄
📖 中文报告👁 PR #58978 视觉回归报告 失败 ❌
|
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
📝 WalkthroughSummary by CodeRabbit
WalkthroughSplitter 新增本地化配置。折叠控制使用当前语言的可访问名称。自定义图标的 ChangesSplitter 本地化
Estimated code review effort: 3 (Moderate) | ~20 minutes Mergeability Score: 🔵 Low · up to The change improves Splitter collapse-control accessibility labels, but the current head still leaves one locale without the new keys and uses a less suitable Catalan term. Users in those locales may hear English or less-clear labels; this is a bounded localization/accessibility issue that is mergeable with explicit owner follow-up. Sequence Diagram(s)sequenceDiagram
participant SplitBar
participant SplitterLocale
participant CollapseControl
SplitBar->>SplitterLocale: 获取起始或结束面板标签
SplitBar->>CollapseControl: 设置自定义 aria-label 或本地化标签
CollapseControl-->>SplitBar: 暴露可访问名称
Possibly related PRs
Suggested labels: Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Bundle ReportChanges will increase total bundle size by 9.48kB (0.29%) ⬆️. This is within the configured threshold ✅ Detailed changes
Affected Assets, Files, and Routes:view changes for bundle: antd.min-array-pushAssets Changed:
Files in
Files in
|
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@components/locale/en_US.ts`:
- Around line 56-59: Update all official locale files, including frFR, with
Splitter.toggleStartPanel and Splitter.toggleEndPanel translations; in
components/locale/en_US.ts:56-59, treat the existing English entries as the
reference and add corresponding translated fields in each locale. In
components/splitter/__tests__/index.test.tsx:550-561, verify French labels for
frFR and move the English-fallback assertion to an explicit custom locale that
omits Splitter.
In `@components/splitter/__tests__/index.test.tsx`:
- Around line 563-582: Extend the “should use custom icon aria-labels for
collapse controls” test to pass a string value for collapsible.icon.end,
exercising the non-React-element branch of getAriaLabel. Keep the existing start
icon assertion and verify the end control still receives the localized label
“切換結束面板”.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 0e705357-1ac3-4678-b6ba-7c6e33edcf9b
📒 Files selected for processing (9)
components/locale/en_US.tscomponents/locale/index.tsxcomponents/locale/zh_CN.tscomponents/locale/zh_TW.tscomponents/splitter/SplitBar.tsxcomponents/splitter/__tests__/index.test.tsxcomponents/splitter/index.en-US.mdcomponents/splitter/index.zh-CN.mdcomponents/splitter/interface.ts
More templates
commit: |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## feature #58978 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 834 834
Lines 15971 15981 +10
Branches 4197 4203 +6
=========================================
+ Hits 15971 15981 +10 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
c381753 to
f6a2cd6
Compare
|
|
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@components/locale/ca_ES.ts`:
- Around line 56-59: Update the Catalan Splitter translations in the Splitter
object, replacing “tauler” with “panell” in toggleStartPanel and toggleEndPanel
while preserving the requested wording: “Commuta el panell inicial” and “Commuta
el panell final”.
In `@components/locale/fa_IR.ts`:
- Around line 56-59: Update the locale definitions in es_US.ts to add
Splitter.toggleStartPanel and Splitter.toggleEndPanel, matching the existing
Splitter keys and providing appropriate Spanish translations.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 7a16e1f0-9ca6-4b8d-8188-f4a48fd17730
📒 Files selected for processing (70)
components/locale/ar_EG.tscomponents/locale/az_AZ.tscomponents/locale/bg_BG.tscomponents/locale/bn_BD.tscomponents/locale/by_BY.tscomponents/locale/ca_ES.tscomponents/locale/cs_CZ.tscomponents/locale/da_DK.tscomponents/locale/de_DE.tscomponents/locale/el_GR.tscomponents/locale/en_GB.tscomponents/locale/es_ES.tscomponents/locale/et_EE.tscomponents/locale/eu_ES.tscomponents/locale/fa_IR.tscomponents/locale/fi_FI.tscomponents/locale/fr_BE.tscomponents/locale/fr_CA.tscomponents/locale/fr_FR.tscomponents/locale/ga_IE.tscomponents/locale/gl_ES.tscomponents/locale/he_IL.tscomponents/locale/hi_IN.tscomponents/locale/hr_HR.tscomponents/locale/hu_HU.tscomponents/locale/hy_AM.tscomponents/locale/id_ID.tscomponents/locale/is_IS.tscomponents/locale/it_IT.tscomponents/locale/ja_JP.tscomponents/locale/ka_GE.tscomponents/locale/kk_KZ.tscomponents/locale/km_KH.tscomponents/locale/kmr_IQ.tscomponents/locale/kn_IN.tscomponents/locale/ko_KR.tscomponents/locale/ku_IQ.tscomponents/locale/lt_LT.tscomponents/locale/lv_LV.tscomponents/locale/mk_MK.tscomponents/locale/ml_IN.tscomponents/locale/mn_MN.tscomponents/locale/mr_IN.tscomponents/locale/ms_MY.tscomponents/locale/my_MM.tscomponents/locale/nb_NO.tscomponents/locale/ne_NP.tscomponents/locale/nl_BE.tscomponents/locale/nl_NL.tscomponents/locale/pl_PL.tscomponents/locale/pt_BR.tscomponents/locale/pt_PT.tscomponents/locale/ro_RO.tscomponents/locale/ru_RU.tscomponents/locale/si_LK.tscomponents/locale/sk_SK.tscomponents/locale/sl_SI.tscomponents/locale/sq_AL.tscomponents/locale/sr_RS.tscomponents/locale/sv_SE.tscomponents/locale/ta_IN.tscomponents/locale/th_TH.tscomponents/locale/tk_TK.tscomponents/locale/tr_TR.tscomponents/locale/uk_UA.tscomponents/locale/ur_PK.tscomponents/locale/uz_UZ.tscomponents/locale/vi_VN.tscomponents/locale/zh_HK.tscomponents/splitter/__tests__/index.test.tsx
🚧 Files skipped from review as they are similar to previous changes (1)
- components/splitter/tests/index.test.tsx
好的 |
f6a2cd6 to
f6ec9c3
Compare
f6ec9c3 to
5a2c6f3
Compare
|
我个人看法仍然是除了中英文,其他语言等Native Speaker添加,先默认fallback到英文 |
5a2c6f3 to
7c361d2
Compare
haode |
|
LGTM |
以前没有 AI,我们是通过 Google translate 手动翻的,相比于母语者的翻译可能不够准确,只支持中英文做没啥问题,但是后面有了 AI,让 AI 翻的准确性大大提升了,每个语言都支持其实也是 OK 的 |
那我再加一下 |
7c361d2 to
c8daecb
Compare
nrps9909
left a comment
There was a problem hiding this comment.
I reviewed the locale contract, fallback path, custom-icon precedence, and logical start/end behavior across horizontal, vertical, and RTL layouts.
Validation performed:
- all 73 runtime locale modules expose non-empty
toggleStartPanelandtoggleEndPanelvalues (includinges_USthrough its existinges_ESinheritance); - the focused Splitter Jest suite passes: 52 tests and 1 snapshot;
git diff --checkpasses;- the existing Vitest manifest intentionally excludes
components/splitter/__tests__/index.test.tsx, so this focused suite is covered by Jest and the repository CI matrix.
The implementation resolves #58971 without adding a component prop, preserves the English fallback for partial custom locales, and keeps explicit custom icon aria-label values authoritative. I did not find an additional actionable issue.
























🤔 这个变动的性质是?
🔗 相关 Issue
fix #58971
💡 需求背景和解决方案
Splitter 折叠控件的无障碍名称此前固定为英文,导致非英文环境下屏幕阅读器仍朗读英文,并且自定义折叠图标无法覆盖控件名称。
本次改动为 Splitter 增加本地化的起始和结束面板名称,提供英文回退,并允许自定义图标通过
aria-label覆盖默认名称。逻辑起始和结束含义在垂直布局及 RTL 模式下保持一致,不新增组件属性。📝 更新日志