Skip to content

Add i18n to storybook#30268

Merged
florianduros merged 4 commits intodevelopfrom
florianduros/storybook-i18n
Jul 16, 2025
Merged

Add i18n to storybook#30268
florianduros merged 4 commits intodevelopfrom
florianduros/storybook-i18n

Conversation

@florianduros
Copy link
Copy Markdown
Member

@florianduros florianduros commented Jul 7, 2025

This PR adds the i18n support to storybook to be able to:

  • Render a component in storybook with translation. Using _t(), _td()... functions
  • Look at the available languages in webapp/i18n/languages.json and list them in the storybook header

The goal is to be able to translate the shared components in storybook without importing all the dependencies of the languageHandler (aka matrix-js-sdk and half of EW). The needed functions are moved into shared-components/i18n.tsx and re-exported to languageHandler.tsx to avoid breaking change.

Screen.Recording.2025-07-16.at.17.18.50.mov

@florianduros florianduros changed the base branch from dbkr/textualevent_sharedcomponent to develop July 7, 2025 15:05
@florianduros florianduros force-pushed the florianduros/storybook-i18n branch from 861cc17 to 8e418a4 Compare July 7, 2025 15:19
@florianduros florianduros force-pushed the florianduros/storybook-i18n branch from 8e418a4 to bcbe539 Compare July 7, 2025 15:26
@florianduros florianduros added the T-Task Tasks for the team like planning label Jul 7, 2025
@florianduros florianduros force-pushed the florianduros/storybook-i18n branch from bcbe539 to a9cff10 Compare July 7, 2025 15:28
@florianduros florianduros force-pushed the florianduros/storybook-i18n branch from 5539f4a to 7316292 Compare July 10, 2025 15:18
@florianduros florianduros changed the base branch from develop to dbkr/textualevent_sharedcomponent July 10, 2025 15:20
@florianduros florianduros force-pushed the florianduros/storybook-i18n branch 2 times, most recently from 2ded009 to 9067864 Compare July 11, 2025 09:32
@florianduros florianduros force-pushed the florianduros/storybook-i18n branch from 9067864 to 4c19a5c Compare July 11, 2025 09:40
@florianduros florianduros force-pushed the florianduros/storybook-i18n branch from 41ae75f to e7cd854 Compare July 15, 2025 15:47
@florianduros florianduros force-pushed the florianduros/storybook-i18n branch from 8ef3da9 to d86d72d Compare July 16, 2025 13:07
@florianduros florianduros force-pushed the florianduros/storybook-i18n branch 2 times, most recently from 09a9ef3 to b5d0ab3 Compare July 16, 2025 14:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

T-Task Tasks for the team like planning

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants