8.1 KiB
phase, plan, subsystem, tags, dependency_graph, tech_stack, key_files, decisions, metrics
| phase | plan | subsystem | tags | dependency_graph | tech_stack | key_files | decisions | metrics | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 07-multilanguage | 03 | portal-i18n |
|
|
|
|
|
|
Phase 7 Plan 3: Portal i18n String Extraction Summary
All 44 portal TSX files now use next-intl useTranslations() for every user-visible string — zero hardcoded English in components or pages, with full EN/ES/PT translations for all keys including new namespaces billingStatus, budgetAlert, subscriptionCard, and invite.
Tasks Completed
Task 1: Extract strings from 22 component files
All component files migrated to useTranslations():
- Navigation:
nav.tsx— nav labels, sign out - Tenant management:
tenant-form.tsx,tenant-switcher.tsx— form labels, switcher UI - Billing:
billing-status.tsx,budget-alert-badge.tsx,subscription-card.tsx— all subscription states, budget thresholds, plan details - Templates:
template-gallery.tsx— category labels, deploy buttons, preview modal - Employee wizard:
employee-wizard.tsx+ all 6 step components (role, persona, tools, channels, escalation, review) - Onboarding:
onboarding-stepper.tsx,impersonation-banner.tsx - Chat:
chat-sidebar.tsx,chat-window.tsx,chat-message.tsx,message-volume-chart.tsx,provider-cost-chart.tsx - Agent designer:
agent-designer.tsx
Task 2: Extract strings from 22 page files
All page files migrated to useTranslations():
- Core pages: dashboard, chat, billing, usage (list + detail)
- Agent pages: agents list, agent detail, new agent picker, templates, wizard, advanced designer
- Settings: api-keys
- User management: users, admin/users
- Tenant management: tenants list, tenant detail, new tenant
- Onboarding: onboarding page (Server Component with
getTranslations), plus all 3 step components (connect-channel, configure-agent, test-message) - Public: invite accept page
Deviations from Plan
Auto-fixed Issues
1. [Rule 1 - Bug] Fixed TypeScript error in billing-status.tsx
- Found during: Task 1
- Issue:
hasDays: days !== nullpassed a boolean to an ICU message parameter typed asstring | number | Date— TypeScript strict mode rejects this - Fix: Removed
hasDaysparameter entirely; simplifiedtrialEndskey to"Trial ends {date}"using only{date} - Files modified:
components/billing-status.tsx,messages/en.json,messages/es.json,messages/pt.json - Commit: 20f4c5b
2. [Rule 2 - Missing functionality] Added onboarding step translations not in plan scope
- Found during: Task 2
- Issue:
onboarding/steps/connect-channel.tsx,configure-agent.tsx,test-message.tsxcontained hardcoded English; plan listed them infiles_modifiedbut original task breakdown only mentioned 22 pages without explicitly calling out the step components as separate - Fix: Added ~60 new keys to the
onboardingnamespace in all three message files; rewrote all three step components withuseTranslations("onboarding") - Files modified: all 3 step files + 3 message files
3. [Rule 1 - Bug] TIME_RANGE_OPTIONS moved inside component
- Found during: Task 2
- Issue:
app/(dashboard)/usage/[tenantId]/page.tsxhadTIME_RANGE_OPTIONSdefined at module level with hardcoded English strings, which cannot access thet()hook - Fix: Moved array construction inside the component function body
- Files modified:
app/(dashboard)/usage/[tenantId]/page.tsx
4. [Rule 2 - Missing functionality] WhatsApp instructions as plain text
- Found during: Task 1 (connect-channel.tsx)
- Issue: Original file used
<strong>HTML inside<li>elements for emphasis in credential instructions; direct translation keys can't hold HTML safely - Fix: Stored instructions as plain-text translation keys (no HTML); bold emphasis replaced with readable text
- Files modified:
components/wizard-steps/step-channels.tsxwas already in scope;onboarding/steps/connect-channel.tsxinstructions simplified
Verification
TypeScript type check (npx tsc --noEmit) passes with zero errors after all changes.
Self-Check: PASSED
Files created/modified confirmed present. Commits verified:
20f4c5b— feat(07-03): extract i18n strings from portal componentsc499029— feat(07-03): extract i18n strings from portal pages