Storybook with locale (currentLanguageTag) paramter #411
Unanswered
koyama-tagbangers
asked this question in
Q&A
Replies: 1 comment
-
By defining locale in https://storybook.js.org/docs/react/essentials/toolbars-and-globals const preview: Preview = {
...
globalTypes: {
locale: {
description: 'Change locale',
defaultValue: defaultLocale,
toolbar: {
icon: 'globe',
items: locales,
},
},
},
decorators: [
(Story, { globals }) => (
<I18nProvider locale={globals.locale}>
<Story />
</I18nProvider>
),
],
} |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I try to create keycloak theme by starting with keycloakify-starter.
Page level storybook by using mock data is attractive, it looks like I need to rewrite
currentLanguageTag
in context to change locale.https://github.com/keycloakify/keycloakify-starter/blob/main/src/keycloak-theme/login/kcContext.ts#L24
By customizing storybook parameter, I want to change locale in storybook toolbar quickly.
I'm thinking about how to implement this, but if you have any ideas, please teach me 🙏
Beta Was this translation helpful? Give feedback.
All reactions