feat(i18n): translate all layout chrome (nav + signout) EN/HI - #26
Merged
Conversation
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.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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: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) pluscommon.signout— in both English and Hindi.page.*batches per page).src/components/layout/DashboardLayout.tsx:tKeyinstead of a hardcodedlabel; the sidebar resolves them throught()at render time, so the entire app chrome (sidebar + sign-out) switches language instantly with the existing toggle.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.tsrecords exactly what remains.Files Changed
src/lib/i18n.ts— nav + sign-out translations (EN/HI), roadmap comment.src/components/layout/DashboardLayout.tsx—tKey-driven nav rendering.Verification
npx tsc --noEmit -p tsconfig.app.json→ exit 0 (strict mode).Manual Test
encovers any missing key).