Uh oh!
There was an error while loading. Please reload this page.
fix(app-shell): localize the two DeclaredActionsBar strings that bypassed i18n (#2762 P0-3) - #2894
Merged
Merged
Conversation
…ssed i18n (objectui#2762 P0-3) The declared action labels resolve through `useObjectLabel`, so a zh-CN workspace got 通过 / 拒绝 buttons — sitting inside a toolbar whose accessible name was the English literal 'Actions', above decision-output fields whose help text read "Handed to the flow as a decision output." Both strings are authored by the bar itself rather than by metadata, and both skipped the locale bundle. `aria-label` now uses the existing `common.actions` key; a host-supplied `label` still wins. The help text moves to new `actions.decisionOutput.help` / `.helpMultiValue` keys, added across all ten shipped locales. The help text needed fixing even though the runtime localizes action params: `useConsoleActionRuntime` runs every param through `actionParamText`, but these params are synthesized from the record's `decision_output_defs`, so their key path (`outputs.<key>`) is dynamic and no `_actions.<action>.params.*` entry can ever match. The fallback is not a rare path — it is the only path. Left alone deliberately: a decision output arriving without a `label` still renders a title-cased version of its machine key, mirroring the framework's `humanizeFieldPath` convention. The fix there is the backend declaring the label; a client bundle cannot key off a dynamic output name. Tests assert the strings go through `t()` rather than merely being English — they fail against the previous literals. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BQwnjqgCyAhSQjhNriW3BW
The latest updates on your projects. Learn more about Vercel for GitHub. |
Contributor
✅ Console Performance Budget
📦 Bundle Size Report
Size Limits
|
os-zhuang
marked this pull request as ready for review
July 28, 2026 03:34
Uh oh!
There was an error while loading. Please reload this page.
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 freeto 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.
Closes the last English leak in #2762 P0-3. The framework half — the lint gate plus server-side translation of inline object actions — landed in objectstack-ai/objectstack#3753.
The problem
The declared action labels already resolve through
useObjectLabel, so a zh-CN workspace gets 通过 / 拒绝 buttons. But two strings the bar authors itself were baked in English and skipped the locale bundle entirely:aria-label={label || 'Actions'}, so screen-reader users in any locale heard "Actions";Handed to the flow as a decision output., rendered right under those localized buttons.Why the help text needed fixing at all
This is the part worth being precise about, because the runtime does localize action params.
useConsoleActionRuntimeruns every param throughactionParamTextbefore showing the dialog, so at first glance these were covered.They aren't. These params are synthesized here from the record's
decision_output_defs, so their key path isoutputs.<key>— dynamic, derived from whatever the flow declared. No_actions.<action>.params.*bundle entry can ever match it, for any locale. TheactionParamTextlookup always misses and falls through to the literal. The fallback isn't a rare path; it's the only path, which is exactly why the English survived a workspace that was otherwise fully localized.The fix
aria-labeluses the existingcommon.actionskey. A host-suppliedlabelstill wins, unchanged.actions.decisionOutput.help/.helpMultiValuekeys, added across all ten shipped locales (en, zh, ja, ko, de, fr, es, pt, ru, ar) — matching howactions.resultDialogis carried.Deliberately not fixed
A decision output arriving without a
labelstill renders a title-cased version of its machine key (owning_team→Owning Team). That derived text mirrors the framework'shumanizeFieldPathconvention, and it can't be fixed from a bundle — a dynamic output name has no key to look up. The real fix is the backend declaringdecision_output_defs[].label, which then flows through the normal path. Calling it out rather than papering over it.Tests
Three cases in
DeclaredActionsBar.test.tsx, asserting the strings actually go throught()rather than merely happening to be English — the mock marks translated output, so a hardcoded literal fails. Verified against the previous code: 2 of the 3 fail, and all pass after the fix.Suite green: 11 tests in
DeclaredActionsBar.test.tsx(was 8), 91 across app-shell. Typecheck and ESLint clean (only pre-existingno-explicit-anywarnings in the touched file).🤖 Generated with Claude Code
https://claude.ai/code/session_01BQwnjqgCyAhSQjhNriW3BW
Generated by Claude Code