Skip to content

feat: add i18n to onboarding flow via paraglide#950

Open
hturnbull93 wants to merge 2 commits into
PauseAI:mainfrom
hturnbull93:feat/onboarding-i18n
Open

feat: add i18n to onboarding flow via paraglide#950
hturnbull93 wants to merge 2 commits into
PauseAI:mainfrom
hturnbull93:feat/onboarding-i18n

Conversation

@hturnbull93

Copy link
Copy Markdown
Contributor

Summary

  • Replaces all hardcoded UI strings in the onboarding pipeline (OnboardingFlow, ActionCards, embed page) with paraglide message functions, enabling translation into any locale
  • Adds 160+ onboarding_* keys to messages/en.json with __instructions hints for HTML-containing strings to guide LLM translators
  • Adds getter functions to options.ts (getDiscoveryOptions, getMotivations, getSkills, getWeeklyHours, getIntentOptions) returning { value, label } pairs — English values are submitted to Airtable unchanged, labels are translated at render time
  • Adds isomorphic-dompurify safeHtml() helper to sanitize all {@html} calls, guarding against malicious LLM translation output
  • Accepts ?locale=<code> query param on the embed page to override locale server- and client-side (for iframe embeds)
  • Allows PARAGLIDE_LOCALES env var to include locales not yet in default-settings.js on local dev (warns instead of errors); CI still hard-errors to prevent deploying untranslated locales

Test plan

  • Visit /embed/onboarding-form — all steps render correctly in English
  • Visit /embed/onboarding-form?locale=de — locale override accepted (German strings once translated)
  • Submit the form through each path (A/B/C/D) — Airtable fields receive English stored values regardless of locale
  • Check discovery/motivation/skill/hours options submit English values to server
  • Verify pnpm check passes with 0 errors

🤖 Generated with Claude Code

https://claude.ai/code/session_015aKhZeP6x8pgBkDEraXGUs

Replaces all hardcoded UI strings in the onboarding pipeline with
paraglide message functions, enabling translation into any locale.

- Add 160+ onboarding_* keys to messages/en.json with translator
  instructions for HTML-containing strings
- Add getter functions to options.ts (getDiscoveryOptions,
  getMotivations, getSkills, getWeeklyHours, getIntentOptions)
  returning {value, label} pairs — English values submitted to
  Airtable unchanged, labels translated at render time
- Wire up paraglide in OnboardingFlow.svelte, ActionCards.svelte,
  +page.svelte and +page.server.ts
- Add isomorphic-dompurify safeHtml() helper to sanitize all
  {@html} calls, guarding against malicious LLM translation output
- Accept ?locale=<code> query param on the embed page to override
  locale server- and client-side
- Allow PARAGLIDE_LOCALES to include locales not in
  default-settings.js on local dev (warn instead of error);
  CI still hard-errors to prevent deploying untranslated locales

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015aKhZeP6x8pgBkDEraXGUs
@netlify

netlify Bot commented Jul 1, 2026

Copy link
Copy Markdown

Deploy Preview for pauseai ready!

Name Link
🔨 Latest commit bd61ffd
🔍 Latest deploy log https://app.netlify.com/projects/pauseai/deploys/6a44d5e5075d07000831cc71
😎 Deploy Preview https://deploy-preview-950--pauseai.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 57 (🟢 up 1 from production)
Accessibility: 89 (no change from production)
Best Practices: 100 (no change from production)
SEO: 82 (no change from production)
PWA: -
View the detailed breakdown and full score reports
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

isomorphic-dompurify instantiates jsdom at module load time, which
fails in Netlify's Deno edge runtime. Replace with a dependency-free
allowlist sanitizer that works in any JS environment.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015aKhZeP6x8pgBkDEraXGUs
@anthonybailey

Copy link
Copy Markdown
Collaborator

Explicit note that we do not know the (understood to be relatively old and bespoke) version of Deno that Netlify uses. They do not make this transparent.

As a result I strongly endorse using this kind of approach (using a different dependency to avoid the complication.)

@anthonybailey

Copy link
Copy Markdown
Collaborator

@hturnbull93 do note that localisation is latent in production, but not currently used: the website remains en-only.

Is your plan to expose localized versions of the join page only? (Or even just the embedded form?)

We can do it but I'd really like to discuss some detail.

More than doubling the number of entries in "messages" isn't ideal - it is the way Paraglide handles short UX strings but the special track has complicated our automatic l10n quite a lot.

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