Skip to content

AiPendingActionsInbox.formatRelative is a fifth untranslated copy of the same relative-time helper — the keys it needs are already in all ten packs #7173

Description

@os-warren

Found while implementing #7163 (PR #7172), which converted the plugin-detail copies. Filed rather than swept in: packages/plugin-chatbot/ is outside that card's declared lane.

Measured on origin/main head d8ec8d6d4

packages/plugin-chatbot/src/AiPendingActionsInbox.tsx:117-131 holds its own relative-time helper, returning hardcoded English:

if (sec < 45) return 'just now';
const min = Math.round(sec / 60);
if (min < 60) return `${min}m ago`;
const hr = Math.round(min / 60);
if (hr < 24) return `${hr}h ago`;
const day = Math.round(hr / 24);
if (day < 30) return `${day}d ago`;

So a zh/ja/ar session reading the AI pending-actions inbox gets English relative times on every row.

Why this is filed separately rather than as "one more of the same"

It is the fifth spelling of this helper in the repo, and the variants are not interchangeable — worth knowing before anyone tries to unify them:

The rounding and threshold differences are real behaviour differences, not drift to be normalised away without a decision.

The keys already exist — no new pack rows needed for the four branches

detail.justNow, detail.minutesAgo ({{count}}m ago), detail.hoursAgo, detail.daysAgo are present and translated in all ten packs. Verified by reading the pack OBJECTS, not a dotted-key grep — the packs are nested, so a grep for detail.justNow returns a false zero against the en pack that defines it. Positive controls detail.back / detail.noActivity = 10/10; negative control detail.zzzAbsentControl7163 = 0/10.

Whether this component should reach for detail.* keys from plugin-chatbot, or get its own namespaced rows, is the one open question here — it is a namespace decision, not a mechanical one.

Scope note for whoever takes it

AiPendingActionsInbox.tsx has essentially no translation wiring of its own (2 incidental matches, neither a t() call), though the package does use the hooks elsewhere (ChatbotEnhanced.tsx imports useObjectTranslation and useSafeTranslate; FloatingChatbotTrigger.tsx uses useObjectTranslation).

That makes it the unwired-component shape, not the lookup-swap shape. #7142 wired a single string into an otherwise untranslated component and shipped something visibly half-done; #7149 is what finishing that afterwards cost. Sweep the file whole or leave it — the same ruling #7163 was given.

Evidence bar

An en-only test is green before the fix too — each key's en value is byte-identical to the literal it would replace — so English cannot discriminate a pack lookup from a hardcoded string. Assert in zh/ar, and assert the provider-less path separately (it must yield English from the defaults map, never a raw key, and must interpolate {{count}}).

Never an inline defaultValue (#3517).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

domain:uiobjectui ui stream: fix lands on the published library or apps — objectui execution seatpriority:p3

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions