Skip to content

i18n(topics): Topics page is fully hardcoded English — extract strings into a translation namespace #383

Closed

Description

@gkhngyk

Problem

The Topics dashboard page (/dashboard/topics) renders every string as a hardcoded English literal — it never calls useTranslations, unlike the already-internationalized Site Audit and Reports pages. This leaves the page out of the i18n system and inconsistent with the rest of the dashboard.

web/src/app/[locale]/(dashboard)/dashboard/topics/page.tsx has no useTranslations import at all; sample hardcoded strings:

  • Header (page.tsx:265-268): "Topics", "Topic-level analytics across all tracked prompts (last 30 days)"
  • KPI card labels / sub-text (page.tsx:305-335): "Tracked topics", "Best performer", "Biggest gap", "Top mover (7d)", plus subs like "N prompts without a topic", "All prompts categorised", "Best performer", "No data yet", "Not enough data"
  • Empty state (page.tsx:361-366): "No topics defined yet.", "Add topics from brand settings to enable topic-based analytics."
  • Table column headers and other literals throughout.

What to change

Mirror the pattern the Audit and Reports pages already use:

  • web/src/app/[locale]/(dashboard)/dashboard/reports/page.tsx → const t = useTranslations('reports')
  • web/src/app/[locale]/(dashboard)/dashboard/audit/page.tsx → const t = useTranslations('audit')

Steps:

  1. Add a new topics namespace to web/messages/en.json with keys for the header, KPI labels + sub-texts, table headers, and empty state. (Note: there's no topics page namespace yet — the existing "topics": "Topics" at line 24 is the nav label, not a page namespace. A new top-level topics block is needed, like audit (line 33) and reports (line 393).)
  2. In topics/page.tsx, add import { useTranslations } from 'next-intl', call const t = useTranslations('topics'), and replace the literals with t('…') calls.

Acceptance criteria

  • topics/page.tsx uses useTranslations('topics') — no user-facing hardcoded English literals remain (header, KPI labels/subs, table headers, empty state).
  • A topics namespace exists in web/messages/en.json covering every extracted string.
  • The page renders identically in English (same copy) — this is extraction only, no visible wording change.
  • Pattern matches the existing audit / reports pages.

Notes

  • Currently only en.json exists, so this is primarily about i18n-readiness and consistency with the already-translated pages — not a behavior change.
  • Self-contained; good first issue.

Activity

  1. added
    enhancement
    good first issue
    on Jul 9, 2026
  2. gkhngyk commented on Jul 9, 2026

    @gkhngyk
    ContributorAuthor

    Consolidating the dashboard i18n cleanup into one tracking issue so it's all in one place: #384 (the Topics page is item 2 there). Closing this in favor of that. Thanks!

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementgood first issue

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions