-
Notifications
You must be signed in to change notification settings - Fork 953
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
storybook: global language selector #6904
Conversation
I like the simple approach! |
Did you make sure it's not a component that has its own i18next wrapper? I'm going to remove those in a follow up PR. I think you can test it best on the FAQ panel. |
Hehe, turns out these are hardcoded in storybook... export const Default: Story = {
argTypes: {
ratio: {
control: { type: 'number', min: 0, max: 1, step: 0.1 },
},
},
args: {
ratio: 0.5,
name: 'Renewable', // <- This one...
},
}; I'll add a task to clean them up later. |
Oh, that explains it! 😄 |
Issue
Many of our components are directly using translations but we have no way to control the language in storybook right now.
Closes: AVO-347
Description
Adds a decorator and global controls to the main storybook preview file as instructed here: https://storybook.js.org/recipes/react-i18next
Note
There is an add-on that does this as well but we'll actually end up with more code if we go down that route? So I opted to just do the simple solution.
Double check
pnpx prettier@2 --write .
andpoetry run format
in the top level directory to format my changes.