Skip to content

Translate the audit log and analytics pages (DE, IT) - #1274

Merged
helpcodeai merged 4 commits into
HelpCode-ai:mainfrom
sapatmohit:feat/i18n-logs-analytics
Oct 26, 2026
Merged

helpcodeai merged 4 commits into
HelpCode-ai:mainfrom
sapatmohit:feat/i18n-logs-analytics

Conversation

@sapatmohit

Copy link
Copy Markdown
Contributor

Summary

Second area of #1271: the audit log (/logs) and analytics (/analytics) in German and Italian, plus the app shell header that frames every signed-in page. It builds on #1272. No behaviour changes, and Accept-Language: en-US renders exactly what it rendered before.

Changes

  • app/logs/page.tsx: the title and subtitle, the Refresh button, the status filter and search, the connector and MCP server filters, the column headers, the status pills, the empty, filtered and end-of-log states, the expanded row (input, output or error, user, auth method, key, server, connector), the replay hints and "Copy as cURL" states, and pagination.
    • The status pill (SUCCESS / ERROR / TIMEOUT) is translated through a small statusLabel helper. A status the backend adds later still shows as it arrives.
    • The auth method labels (API Key, Static Key, …) work the same way. An unknown method shows as it is.
  • app/analytics/page.tsx: the title and subtitle, the 7d/30d/90d range, the stat tiles, the timeline and its tooltips, top tools, the three breakdowns and the cost note. The error and call counts use ICU plurals ("1 error" / "2 errors", "1 Fehler", "1 errore").
  • components/app-shell.tsx: the header's own strings ("Toggle theme", "Open navigation", "Open command palette", the search button and its labels). This is the first PR that touches the shell, so it's translated here, as agreed in Translate the rest of the admin UI (DE, IT) #1271.
  • messages/{en,de,it}.json: new namespaces appShell, auditLog and analytics, with 82 keys each.

The fallback "Failed to load" on /analytics is now read when rendering instead of being stored by the fetch callback, as in #1272. This keeps t out of the callback's dependencies, so a language change doesn't trigger a refetch. The text and when it shows are unchanged.

Left in English on purpose:

  • Server and API error messages, and the stored data in a row (tool names, inputs, outputs, error text from the upstream API).
  • Dates and numbers keep the browser's formatting (toLocaleString()), as before. Switching them to the UI language would change what English users with a non-English browser see today.
  • The env var names in the cost note (COST_PER_CALL_MICROS, COST_PER_PROXY_CALL_MICROS).
  • Other shared components that AppShell renders but doesn't own: the command palette, the footer ("Powered by", Light / Dark / System) and the trial, usage, subscription and edition banners. Each has a fair amount of text of its own. I can take them as one small "shared chrome" PR after the page areas, or fold each into the area it fits best. Let me know which you prefer.

Self-hosted vs Cloud: frontend only, with no backend, database or ee/ change.

Translations

German and Italian aren't my native languages, so please review those strings. I kept the tone and terms from #1248, #1257 and #1272: German with Sie ("Audit-Log", "Connectors", "MCP-Server"), Italian with tu ("Registro di audit", "connettori", "server MCP"). Strings I'm least sure about:

  • Status pills: "ERFOLG" / "FEHLER" (DE) and "RIUSCITA" / "ERRORE" (IT) for SUCCESS / ERROR. TIMEOUT stays the same in both. Uppercase, as in English.
  • Range buttons: "7 T" (Tage) in German and "7 g" (giorni) in Italian for "7d".
  • "Kostensatz" (DE) for the cost rate: I avoided "Tarif", which Translate the auth and onboarding pages (DE, IT) #1272 uses for a plan.
  • "Design wechseln" (DE) for "Toggle theme": I'm not sure that's the term you'd use.
  • "{count} Fehl." / "{count} err." for the short error count next to a breakdown row, where space is tight.
German Italian
/logs (expanded error row)
/analytics

Type

  • New feature

Testing

3 new tests in tests/e2e/i18n.spec.ts, with a mocked audit log row and analytics breakdown:

  • de-DE: /logs renders in German, including the filters, a column header, pagination with a plural ("Seite 1 · 1 Ergebnis"), the status pill, the expanded row and the app shell's theme toggle.
  • it-IT: /analytics renders in Italian, including the range button, a stat tile, the "1 errore" plural, the "no rate" hint and a breakdown title.
  • en-US: /logs and /analytics stay exactly as before ("Page 1 · 1 results", "Tool calls · 30d", "1 error").

The key-parity test from #1248 covers the new keys. The existing specs that look for English text in the shell (redesign.spec.ts and command-palette.spec.ts use "Toggle theme") still pass.

Directory Command Result
packages/frontend npm run lint 0 errors, 49 warnings (same as main, none new)
packages/frontend npx tsc --noEmit -p tsconfig.json pass
packages/frontend npm run build pass
packages/frontend npm run test:e2e 282 passed, incl. the 3 new ones

The backend isn't touched, so I didn't rerun its suite.

  • Added/updated tests
  • Tested manually. I checked both pages in German and Italian in the browser with mocked API data (the screenshots above), not against a live backend.

Checklist

  • My code follows the existing code style
  • I have tested my changes locally
  • I have updated documentation (if applicable). Not needed: CONTRIBUTING's "Translating the UI" section already covers new namespaces.
  • All existing tests pass (frontend; backend unchanged)
  • This PR has a descriptive title

packages/frontend/AGENTS.md and next-env.d.ts were rewritten by next dev locally and are left out, as AGENTS.md asks.

Related Issues

Part of #1271 (logs and analytics)

@sapatmohit

Copy link
Copy Markdown
Contributor Author

@helpcodeai could you re-run the Playwright check when you get a moment? It was cancelled by the 15-minute job timeout, not by a test: "Install Playwright browsers" took 11.5 minutes this time instead of the usual 20–40 seconds, leaving about 3 minutes for the tests (run). The same slow install cancelled a Dependabot run earlier today. Re-running needs admin rights, so I can't trigger it from my side. Locally the full suite passes (282 tests), and the other checks are green.

@helpcodeai
helpcodeai enabled auto-merge (squash) October 26, 2026 12:43
@helpcodeai
helpcodeai merged commit 7ea8f99 into HelpCode-ai:main Oct 26, 2026
14 checks passed
@github-actions github-actions Bot locked and limited conversation to collaborators Oct 26, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants