Skip to content

fix(dashboard): wire up i18n for the analytics dashboard - #100

Merged
Lexus2016 merged 2 commits into
Lexus2016:mainfrom
Its-My-Work:fix/dashboard-i18n
Sep 13, 2026
Merged

Lexus2016 merged 2 commits into
Lexus2016:mainfrom
Its-My-Work:fix/dashboard-i18n

Conversation

@Its-My-Work

@Its-My-Work Its-My-Work commented Sep 12, 2026

Copy link
Copy Markdown
Contributor

Summary

public/dashboard.html shipped with zero i18n integration — every label, section title, empty-state message, gauge caption and tooltip was a hardcoded English literal, even though index.html, kanban.html and schedule.html all support en/uk/ru/fr/he. A user with the interface language set to Russian (or anything but English) saw the whole Dashboard tab stay in English.

  • Give dashboard.html the same TR / t() / applyI18nAttrs() / adoptServerLang() contract as kanban.html and schedule.html: read the persisted lang, adopt the server's /api/config lang like the sibling pages do, and route every user-facing string (nav, card titles, hero stats, gauge captions, empty states, tooltips) through t().
  • Month abbreviations and session dates now format via Intl/toLocaleDateString using the active locale instead of a hardcoded 'uk-UA'.
  • Extend test/i18n-completeness.test.js to include dashboard.html in the key-parity, placeholder-parity and hardcoded-string scans that already cover kanban.html and schedule.html, so this can't silently regress again.

Test plan

  • node test/i18n-completeness.test.js passes with dashboard.html included
  • Manually switch the interface language on /dashboard and confirm every label/tooltip/empty-state follows it

🤖 Generated with Claude Code

https://claude.ai/code/session_011E2bJQ2sL9LgEWosjvydTR

Its-My-Work and others added 2 commits September 13, 2026 15:02
public/dashboard.html shipped with zero i18n integration: every label,
section title, empty-state message, gauge caption and toast was a hardcoded
English literal, while index.html, kanban.html and schedule.html all
support en/uk/ru/fr/he. A user who set the interface language to Russian
saw the whole Dashboard tab still in English.

Give the page the same TR/t()/applyI18nAttrs()/adoptServerLang() contract
as kanban.html and schedule.html: read the persisted `lang`, adopt the
server's /api/config lang like the sibling pages do, and route every
user-facing string (nav, card titles, hero stats, gauge captions, empty
states, tooltips) through t(). Month abbreviations and session dates now
format via Intl/toLocaleDateString using the active locale instead of a
hardcoded 'uk-UA'.

Also extend test/i18n-completeness.test.js to include dashboard.html in
the key-parity, placeholder-parity and hardcoded-string scans that already
cover kanban.html and schedule.html, so this can't silently regress.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011E2bJQ2sL9LgEWosjvydTR
adoptServerLang() fetched /api/config concurrently with loadData(), so when
localStorage.lang and the server's lang disagreed (another browser, cleared
storage) the dynamic markup — hero cards, gauges, tooltips — rendered in one
language and the static labels flipped to the other a moment later.
kanban.html awaits the config before rendering; do the same here, and make
adoptServerLang() refresh document.title along with the attributes.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@Lexus2016

Copy link
Copy Markdown
Owner

Thanks — the dashboard i18n work is good and the test extension is exactly right.

Two things I did before merging, both pushed to your fix/dashboard-i18n branch (maintainer edit; you'll want git fetch && git reset --hard origin/fix/dashboard-i18n locally):

  1. Rebased the branch onto main with only the dashboard commit. The PR was carrying 10 commits from your fork's mainDockerfile (opencode in the image), docker-compose.yml (ports commented out, easypanel external network, CPU/memory caps for your VPS) and a server.js change. The compose changes would break docker compose up for everyone without an easypanel network, so they can't ship here. The /api/browse-dirs default-to-WORKDIR change in server.js looks reasonable on its own — open it as a separate PR if you want it in.
  2. One fixup commit: adopt the server language BEFORE the first render. adoptServerLang() ran its /api/config fetch concurrently with loadData(), so when localStorage.lang and the server's lang disagreed (another browser, cleared storage) the hero cards / gauges / tooltips rendered in one language and the static labels flipped to the other a moment later. kanban.html awaits the config first; the dashboard now does the same, and adoptServerLang() refreshes document.title too.

npm test → 80 files, exit 0.

@Lexus2016
Lexus2016 merged commit 64c456d into Lexus2016:main Sep 13, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants