Languages Switch for Storybook
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 78/100
- Issue type
- Feature
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- javascript, storybook
- Domain
- frontend, internationalization
Research direction
Start with .storybook/preview.ts and the existing theme toolbar setup, then find where the library initializes its i18n instance and lists available locales. Add a Storybook toolbar control for English and German that updates the locale and re-renders stories and docs pages. Done when switching languages immediately changes built-in component text across stories and docs.
Written by the indexing model from the issue text.
Description
Is your feature request related to a problem? Please describe.
Storybook always renders components in the language picked by the library's i18n setup, which uses localStorage or the browser language. On a German browser, components with built-in text (e.g. RelativeTime, UserMenu, ExpiryBadge) show up in German, while the story text around them stays English. The only way to check another language right now is to set localStorage by hand or change the browser language in the devtools.
Describe the solution you'd like
A language switch in the Storybook toolbar, similar to the theme switch, listing all available locales (currently English and German). Changing it should update the locale of the library's i18n instance, so all stories and docs pages re-render in the selected language right away. This is also great for reviewing language related parts of our components.
Describe alternatives you've considered
Setting localStorage by hand in the devtools, which works but is awkward and easy to forget.
Additional context
This came up while building the RelativeTime component (#326). It could be built with a global type with toolbar config plus a small decorator in .storybook/preview.ts, no extra addon needed.
- Dominant language
- Vue
- Stars
- 10
- Forks
- 1
- Avg merge
- 1d 7h
- Merged PRs (30d)
- 9
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from thunderbird/services-ui
-
BREAKING enhancement
Difficulty 2/5 Half a day Newbie friendliness 74/100
thunderbird/services-ui#362 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 3/5 1-2 days Newbie friendliness 58/100
thunderbird/services-ui#356 · 1 comment ·
Maintainers usually reply within 1 day
-
bug
Difficulty 3/5 1-2 days Newbie friendliness 45/100
thunderbird/services-ui#334 · 1 comment ·
Maintainers usually reply within 1 day
-
Component to display relative datesPossibly taken A pull request linked to this issue is open or already merged. Openenhancement
Difficulty 3/5 1-2 days Newbie friendliness 70/100
thunderbird/services-ui#326 · 2 comments · 1 assignee ·
Maintainers usually reply within 1 day
-
Difficulty 3/5 1-2 days Newbie friendliness 52/100
thunderbird/services-ui#303 · 2 comments ·
Maintainers usually reply within 1 day
All issues in thunderbird/services-ui
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
knaw-huc/textannoviz#742 ·
-
needs:info
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
ui
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
[BUG] 500 error page throws "NAV is not defined"Possibly taken A pull request linked to this issue is open or already merged. Open
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
PolicyEngine/ai-inequality#64 ·
Maintainers usually reply within 1 day