Skip to content

Commit

Permalink
fix: storybook issue on story change
Browse files Browse the repository at this point in the history
  • Loading branch information
flagrede committed Sep 9, 2024
1 parent 80e59d0 commit e332d99
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
Binary file modified bun.lockb
Binary file not shown.
16 changes: 10 additions & 6 deletions web-storybook/.storybook/preview.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,17 @@ import '../../tailwind.css';
window.Buffer = Buffer;

const StorybookI18nProvider = ({ children }) => {
useEffect(async () => {
const { messages } = await import(
`web-marketplace/src/lib/i18n/locales/en.po`
);
useEffect(() => {
const loadTranslations = async () => {
const { messages } = await import(
`web-marketplace/src/lib/i18n/locales/en.po`
);

i18n.load('en', messages);
i18n.activate('en');
i18n.load('en', messages);
i18n.activate('en');
};

loadTranslations();
}, []);

return <I18nProvider i18n={i18n}>{children}</I18nProvider>;
Expand Down

0 comments on commit e332d99

Please sign in to comment.