Skip to content

Fix Asset Event table titles showing a raw translation key - #71443

Merged
bbovenzi merged 1 commit into
apache:mainfrom
astronomer:fix-asset-event-source-translation
Aug 12, 2026
Merged

bbovenzi merged 1 commit into
apache:mainfrom
astronomer:fix-asset-event-source-translation

Conversation

@pierrejeambrun

@pierrejeambrun pierrejeambrun commented Aug 11, 2026 •

Copy link
Copy Markdown
Member

Asset Events tables render their titles as raw i18n keys instead of readable text:

  • Asset page (a specific asset's events): "asset_one Events" instead of "Asset Events"
  • Run page: "Source assetEvent_other" instead of "Source Asset Events"
  • Task Instance page: "Created assetEvent_other" instead of "Created Asset Events"

The shared Asset Events table (components/Assets/AssetEvents.tsx) resolves these titles with useTranslation(["dashboard", "common", "dag"]), whose default namespace is dashboard. In en/common.json these keys reference their labels through nested $t() (introduced by the translation DRY refactor #68285), e.g. "assetEvent_other": "$t(asset_one) Events" and "sourceAssetEvent_other": "Source $t(assetEvent_other)". An unqualified nested $t(...) resolves against the consuming hook's default namespace (dashboard), where those keys don't exist, so the title falls back to the raw key.

This keeps the DRY nesting and fixes it by qualifying the nested references with the common namespace ($t(common:asset_one), $t(common:assetEvent_other), …), so they resolve in common regardless of the consuming component's default namespace.

Verified with i18next directly: all three keys now render "Asset Event(s)" / "Source Asset Event(s)" / "Created Asset Event(s)" for every count, both in the dashboard-default context and with the full namespace array.

Note: only en uses the nested form; the other locales currently duplicate the strings inline. Migrating them to the same nested/DRY structure is separate follow-up work.

related: #68285


Was generative AI tooling used to co-author this PR?
  • Yes — Claude Code (Opus 4.8)

Generated-by: Claude Code (Opus 4.8) following the guidelines

@pierrejeambrun

Copy link
Copy Markdown
Member Author

Before

Screenshot 2026-08-11 at 17 51 11 Screenshot 2026-08-11 at 17 51 28

After

Screenshot 2026-08-11 at 18 05 35 Screenshot 2026-08-11 at 18 07 15 Screenshot 2026-08-11 at 18 07 40

@bbovenzi

Copy link
Copy Markdown
Contributor

Nesting i18n keys is something we do want to do to make our translation strings more reusable. I would prefer that we actually fix nesting so that it does work for english and every other language.

@pierrejeambrun

Copy link
Copy Markdown
Member Author

I can make nesting work for en. And leave the other owners do the work for theirs translation, I'm not confident changing blindly 20 locals I cannot double check.

Also we probably want to adjust the i18n scripts to detect translation keys that are using nesting in en but aren't updated yet in the targeted locals to use a similar nesting.

The English assetEvent/sourceAssetEvent/createdAssetEvent title keys reference their
labels through nested $t() (from the translation DRY refactor). These keys are
consumed by the shared Asset Events table, whose translation hook defaults to the
dashboard namespace, so an unqualified nested $t() resolved against dashboard —
where the referenced keys do not exist — and the titles rendered raw keys ("Source
assetEvent_other", "asset_one Events"). Qualifying the nested references with the
common namespace keeps the DRY nesting and resolves it regardless of the consuming
component's default namespace.
@pierrejeambrun
pierrejeambrun marked this pull request as draft August 11, 2026 16:13
@pierrejeambrun
pierrejeambrun force-pushed the fix-asset-event-source-translation branch from 2027bc7 to 3bca94b Compare August 11, 2026 16:13
@bbovenzi

Copy link
Copy Markdown
Contributor

Ok, let's fix english and handle the other languages in another PR

@pierrejeambrun

Copy link
Copy Markdown
Member Author

Ok, let's fix english and handle the other languages in another PR

Done

@pierrejeambrun
pierrejeambrun marked this pull request as ready for review August 12, 2026 09:05
@bbovenzi
bbovenzi merged commit f79a0ff into apache:main Aug 12, 2026
170 checks passed
@bbovenzi
bbovenzi deleted the fix-asset-event-source-translation branch August 12, 2026 20:19
dabla pushed a commit to dabla/airflow that referenced this pull request Aug 14, 2026
)

The English assetEvent/sourceAssetEvent/createdAssetEvent title keys reference their
labels through nested $t() (from the translation DRY refactor). These keys are
consumed by the shared Asset Events table, whose translation hook defaults to the
dashboard namespace, so an unqualified nested $t() resolved against dashboard —
where the referenced keys do not exist — and the titles rendered raw keys ("Source
assetEvent_other", "asset_one Events"). Qualifying the nested references with the
common namespace keeps the DRY nesting and resolves it regardless of the consuming
component's default namespace.
imrichardwu pushed a commit to imrichardwu/airflow that referenced this pull request Sep 11, 2026
)

The English assetEvent/sourceAssetEvent/createdAssetEvent title keys reference their
labels through nested $t() (from the translation DRY refactor). These keys are
consumed by the shared Asset Events table, whose translation hook defaults to the
dashboard namespace, so an unqualified nested $t() resolved against dashboard —
where the referenced keys do not exist — and the titles rendered raw keys ("Source
assetEvent_other", "asset_one Events"). Qualifying the nested references with the
common namespace keeps the DRY nesting and resolves it regardless of the consuming
component's default namespace.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:translations area:UI Related to UI/UX. For Frontend Developers. translation:default

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants