Skip to content

Frontend: localize Activity event labels and badges #4

Description

@KelvinLin1016

Why

apps/web/src/pages/Activity.tsx already translates the page title, empty state, and tab labels, but activity badges still render the raw backend event key such as task, document, or user. The file also contains a stale TODO about localizing the event tabs.

This is a small frontend improvement that makes the Activity page consistent in English, Chinese, and Spanish without changing the API.

Scope

  1. Add Activity event-label translation keys for:
    • task
    • document
    • user
    • goal
    • agent
    • chat
    • system
  2. Add the keys to:
    • apps/web/src/lib/i18n/en.ts
    • apps/web/src/lib/i18n/zh.ts
    • apps/web/src/lib/i18n/es.ts
  3. Update apps/web/src/pages/Activity.tsx so:
    • tabs use the Activity-specific event-label mapping;
    • badges show the localized label instead of the raw event key;
    • unknown event types use the existing page.activity.event_fallback translation;
    • the stale localization TODO is removed.
  4. Add a focused Node source test, for example
    apps/web/scripts/activity-i18n.test.mjs, that verifies the mapping is used
    and all three locale files contain the required keys.

Acceptance criteria

  • Known Activity event types display translated labels in English, Chinese, and Spanish.
  • Unknown event types display the translated fallback instead of a missing translation key.
  • No backend endpoint, event payload, or filtering behavior changes.
  • The stale TODO in Activity.tsx is removed.
  • npm --prefix apps/web run test:source succeeds.
  • npm --prefix apps/web run build succeeds.

Contribution notes

Please keep the PR limited to the Activity page, the three locale dictionaries,
and the focused source test. Link the PR with Closes #<issue-number>.
Contributions are subject to the project
CLA.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions