fynncfchen/storybook-addon-i18next

Support for Storybook 6

Opened this issue · 3 comments

Version 1.3.0 depends on storybook@^5.3.17, would it be possible to update the dependencies to storybook@^6.x.x?

you can use this addon like so, hope it helps

import React, { Suspense } from 'react';
import { I18nextProvider, initReactI18next } from 'react-i18next';
import { withI18next } from 'storybook-addon-i18next';

import i18n from 'i18next';
import { resources } from '../src/i18n';

import '../src/theme.css';

i18n.use(initReactI18next).init({
  resources,
  fallbackLng: 'zh'
});

export const decorators = [
  withI18next({ i18n, languages: { en: 'English', zh: '中文' }}),
  Story => <Suspense fallback='loading...'><Story /></Suspense>
];

I've created a full working example.

Hi @zhuangya,

could you please share how resources look like? That'd help me a lot, thanks.

I checked the docs, and an example and I know now how it looks like, thanks anyway!