@rogal/addon-react-translate
v1.0.1
Published
> An addon for storybook to change language in your stories along with react-translate with ease
Downloads
9
Readme
Addon React-Translate
An addon for storybook to change language in your stories along with react-translate with ease
Install
npm install @rogal/addon-react-translate --save-dev
Getting Started
In your main.js, in the addons array add
{
addons: [
// other addons...
"@rogal/addon-react-translate"
]
}
And then in your preview.js
import { withReactTranslate } from '@rogal/addon-react-translate';
addDecorator(
withReactTranslate({
languages: ['en', 'es'],
language: 'en',
fallbackLng: 'en',
translations: {
en: {
collection: collectionEN,
},
es: {
collection: collectionES,
}
}
})
);
And then you are good to go
Features
- Change the language of your stories with a selectbox
License
MIT