feat(frontend): implement internationalization (i18n) support for Onb… - #1263
Merged
Conversation
…oarding Progress Tracker
|
@dumbdev is attempting to deploy a commit to the Emmanuel's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
@dumbdev Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
…8n-support-for-onboarding-progress-tracker
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.
…oarding Progress Tracker
closes #1157
Adds full internationalization support to the Onboarding Progress Tracker. Every user-visible string — titles, status labels, step aria-labels, progress summaries, announcements, and error messages — is now sourced from the onboarding translation namespace instead of being hardcoded in English. A dedicated useOnboardingI18n hook centralises all string construction so no component or hook duplicates translation logic.
Changes
New files
useOnboardingI18n.ts
— centralised hook wrapping useTranslations("onboarding"). Exposes typed helpers: stepAriaLabel, stepAnnouncement, statusLabel, progressAnnouncement, stepsCompletedLabel, percentCompleteLabel, and all static strings.
useOnboardingProgress.ts
— encapsulates all tracker state: reducer ownership, optimistic step navigation with rollback, external prop sync, SYNC_STEPS dispatch on step count changes, translated screen-reader announcements via useOnboardingI18n, and the completion side-effect.
Modified files
en.json
/ es.json / pt.json — added onboarding namespace with 26 keys fully translated in English, Spanish, and Portuguese.
onboarding-reducer.ts
— added SYNC_STEPS action; readonly members on OnboardingState; pure selectors selectEffectiveStep and selectProgressPercent.
OnboardingProgressTracker.tsx
— full i18n refactor (see details below).
OnboardingProgressTracker.test.tsx
— expanded to 45+ tests covering all new behaviour.
src/app/(public)/register/page.tsx — wired OnboardingProgressTracker with typed ONBOARDING_STEPS constant; dark mode applied to page header and footer.
Component refactor details
i18n
All hardcoded English strings replaced with i18n.* calls from useOnboardingI18n.
Parameterised keys for step announcements (stepAnnouncement), progress summaries (stepsCompleted, percentComplete), and error messages (stepChangeFailed).
All three supported locales (en / es / pt) fully translated.
Dark mode
Full dark: Tailwind variant coverage on every surface, border, text, and gradient.
Progress bar gradient adapts: pluto-400→500→600 in light, pluto-500→400→300 in dark.
Completion banner, status badges, connector lines, and focus rings all dark-mode aware.
Responsiveness
Vertical layout by default; orientation="horizontal" stacks vertically on mobile and switches to sm:flex-row on tablet+.
Compact variant reduces padding and font sizes for sidebar/drawer use.
Accessibility
Every aria-label sourced from useOnboardingI18n — no hardcoded English in ARIA attributes.
aria-busy with inline SVG spinner on the pending step during optimistic updates.
focus-visible rings with dark:ring-offset-pluto-950.
aria-roledescription="onboarding step", aria-setsize, aria-posinset, aria-current="step".
role="alert" + aria-live="polite" on the completion banner.
prefers-reduced-motion respected — all framer-motion variants have reduced-motion counterparts that fade only.
Sub-components
StepIcon — renders checkmark, loading spinner (pending state), or step number. Memoised.
StatusBadge — renders completed / in-progress / pending pill with dark mode colours. Memoised.