Skip to content

feat(i18n): translate all layout chrome (nav + signout) EN/HI - #26

Merged
abhinav-phi merged 1 commit into
mainfrom
abhinav-pr/27-i18n-layout-strings
Aug 29, 2026
Merged

feat(i18n): translate all layout chrome (nav + signout) EN/HI#26
abhinav-phi merged 1 commit into
mainfrom
abhinav-pr/27-i18n-layout-strings

Conversation

@abhinav-phi

Copy link
Copy Markdown
Owner

Problem

The audit rated i18n the weakest category (4/10): only Dashboard + Auth pages were translated, while ~15 pages stayed hardcoded English. Toggling to Hindi produced an app that was half Hindi, half English — an incoherent experience. The audit's options were "complete it" or "make the toggle coherent".

Translating all 15 page bodies in one PR would be an unreviewable, error-prone dump (hundreds of strings, risk of broken interpolations), so this PR takes the honest middle path the audit allows: make every layout-level string follow the language toggle, and document the page-body work as tracked follow-up batches.

Fix

src/lib/i18n.ts:

  • Added a nav.* key for every sidebar entry across all four roles (dashboard, products, batches, transfer, QR codes, supply chain, alerts, fraud alerts, scan & update, verify product, my products, users, analytics, audit logs, settings) plus common.signout — in both English and Hindi.
  • Header comment states the scope decision and the follow-up plan (page.* batches per page).

src/components/layout/DashboardLayout.tsx:

  • Nav item definitions now carry tKey instead of a hardcoded label; the sidebar resolves them through t() at render time, so the entire app chrome (sidebar + sign-out) switches language instantly with the existing toggle.
  • "SIGN OUT" is now t("common.signout").

The toggle stays (per the audit's preference over removal): it now genuinely switches everything it can reach, and the roadmap in i18n.ts records exactly what remains.

Files Changed

  • src/lib/i18n.ts — nav + sign-out translations (EN/HI), roadmap comment.
  • src/components/layout/DashboardLayout.tsxtKey-driven nav rendering.

Verification

  • npx tsc --noEmit -p tsconfig.app.jsonexit 0 (strict mode).

Manual Test

  1. Toggle the language to HI → sidebar items and sign-out switch to Hindi on every role's dashboard.
  2. Toggle back to EN → English restored (fallback en covers any missing key).

The language toggle was half-coherent: only Dashboard/Auth were translated while
the sidebar stayed English. Add nav.* keys for every role's sidebar entries plus
common.signout in both languages, and render nav labels via t() so the whole app
chrome follows the toggle. Page bodies remain English — documented as page.*
follow-up batches in i18n.ts.
@vercel

vercel Bot commented Aug 29, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
authchain Ready Ready Preview Aug 29, 2026 1:49pm

@abhinav-phi
abhinav-phi merged commit ef450f7 into main Aug 29, 2026
3 checks passed
@abhinav-phi
abhinav-phi deleted the abhinav-pr/27-i18n-layout-strings branch August 29, 2026 13:49
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.

1 participant