Skip to content

Support translations in Storybook: locale toolbar#6843

Open
reecebrowne wants to merge 1 commit into
feat/storybook-i18n-initfrom
feat/storybook-locale-toggle
Open

Support translations in Storybook: locale toolbar#6843
reecebrowne wants to merge 1 commit into
feat/storybook-i18n-initfrom
feat/storybook-locale-toggle

Conversation

@reecebrowne

Copy link
Copy Markdown
Contributor

Summary

  • Adds a globe toolbar to Storybook for switching between all 41 supported languages
  • Swaps the single en-US raw import for import.meta.glob over all editor locale files so every language is bundled at build time — no new import line needed per language
  • en-US merges portal + editor keys; all other locales are editor-only until the portal gets translations
  • RTL languages (Arabic ar-AR, Farsi fa-IR) also flip document.dir so layout direction is correct

Depends on: #6714 (base i18n init)

Test plan

  • Open Storybook, click the globe icon in the toolbar — all 41 languages appear as {code} — {native name}
  • Switch to de-DE on an editor story (e.g. Editor/Policies) — UI strings update to German
  • Switch to ar-ARdocument.dir flips to rtl, layout mirrors correctly
  • Switch to en-US on a portal story (e.g. Portal/AccountLink/LinkAccountCard) — shows translated strings; switching to any other language falls back to keys (expected until portal gets translations)

@dosubot dosubot Bot added size:M This PR changes 30-99 lines ignoring generated files. enhancement New feature or request size:XL This PR changes 500-999 lines ignoring generated files. and removed size:M This PR changes 30-99 lines ignoring generated files. labels Jun 29, 2026
@reecebrowne reecebrowne force-pushed the feat/shared-branding branch from 762d1d5 to ee6ae00 Compare June 30, 2026 09:30
@reecebrowne reecebrowne force-pushed the feat/storybook-locale-toggle branch from bd6f52d to 2784e39 Compare June 30, 2026 09:31
@dosubot dosubot Bot added size:M This PR changes 30-99 lines ignoring generated files. and removed size:XL This PR changes 500-999 lines ignoring generated files. labels Jun 30, 2026
@reecebrowne reecebrowne changed the base branch from feat/shared-branding to feat/storybook-i18n-init June 30, 2026 09:32
Base automatically changed from feat/storybook-i18n-init to feat/shared-branding June 30, 2026 10:36
@reecebrowne reecebrowne force-pushed the feat/shared-branding branch from 4ca60d8 to ee6ae00 Compare June 30, 2026 10:40
Adds a globe toolbar in Storybook that lets you switch between all 41
supported languages and see useTranslation() update live.

All editor locale TOML files are bundled at build time via import.meta.glob
so no new import line is needed per language. en-US merges portal + editor
keys; every other locale is editor-only until the portal gets translations.

RTL languages (Arabic, Farsi) also flip document.dir so layout is correct.
@reecebrowne reecebrowne force-pushed the feat/storybook-locale-toggle branch from 2784e39 to 83c8e55 Compare June 30, 2026 10:47
@reecebrowne reecebrowne changed the base branch from feat/shared-branding to feat/storybook-i18n-init June 30, 2026 10:47
@stirlingbot

stirlingbot Bot commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

🚀 V2 Auto-Deployment Complete!

Your V2 PR with embedded architecture has been deployed!

🔗 Direct Test URL (non-SSL) http://54.175.155.236:6843

🔐 Secure HTTPS URL: https://6843.ssl.stirlingpdf.cloud

This deployment will be automatically cleaned up when the PR is closed.

🔄 Auto-deployed for approved V2 contributors.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request size:M This PR changes 30-99 lines ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant