{"_id":"@dattran92/storybook-addon-i18next","_rev":"1-7fabfe7d9820260db5c1e658ca028e73","name":"@dattran92/storybook-addon-i18next","dist-tags":{"latest":"1.3.0"},"versions":{"1.3.0":{"name":"@dattran92/storybook-addon-i18next","version":"1.3.0","description":"React Storybook addon for i18next","keywords":["addon","i18next","storybook"],"homepage":"https://github.com/fynncfchen/storybook-addon-i18next#readme","bugs":{"url":"https://github.com/fynncfchen/storybook-addon-i18next/issues"},"repository":{"type":"git","url":"git+https://github.com/fynncfchen/storybook-addon-i18next.git"},"license":"MIT","main":"preview.js","scripts":{"build":"rollup -c rollup.config.js","clean":"rm -rf ./manager.js ./preview.js"},"dependencies":{"@emotion/styled":"^10.0.14","@storybook/addons":"^5.1.9","@storybook/components":"^5.1.9","@storybook/core-events":"^5.1.9","@storybook/theming":"^5.1.9","prop-types":"^15.7.2","react-i18next":"^10.11.4"},"devDependencies":{"@babel/core":"^7.5.0","@babel/preset-env":"^7.5.2","@babel/preset-react":"^7.0.0","babel-eslint":"^10.0.2","eslint":"^6.0.1","eslint-config-airbnb":"^17.1.1","eslint-config-prettier":"^6.0.0","eslint-plugin-import":"^2.18.0","eslint-plugin-jsx-a11y":"^6.2.3","eslint-plugin-prettier":"^3.1.0","eslint-plugin-react":"^7.14.2","prettier":"^1.18.2","rollup":"^1.16.6","rollup-plugin-babel":"^4.3.3","rollup-plugin-commonjs":"^10.0.1","rollup-plugin-eslint":"^7.0.0","rollup-plugin-node-resolve":"^5.2.0"},"peerDependencies":{"react":"*"},"gitHead":"5898af4bb26bea31c4cfa8294d15639187b87700","_id":"@dattran92/storybook-addon-i18next@1.3.0","_nodeVersion":"12.13.1","_npmVersion":"6.12.1","dist":{"integrity":"sha512-ZEceghoQcikK5m/F7rPGDhBWmMI0lOuAvJVEBlhvCqM9Z4SkbxUHmoIhTZnqWzGax9uY2hBwRhpPNZtQaBk1rw==","shasum":"211cbce084cf2f342699c6a1bb45ba840ca3b4e3","tarball":"https://registry.npmjs.org/@dattran92/storybook-addon-i18next/-/storybook-addon-i18next-1.3.0.tgz","fileCount":11,"unpackedSize":22766,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeTow5CRA9TVsSAnZWagAAsq4P/RcbHlz15DNLEvVzVEAv\nOpKlNIJsZv0pLTIt7chJNtgd5pADjvM4NyaomyV0h0tKaGb4n8oK+BcuEQO9\n2CteBGFL8i0bE3VzMzEIO0P4y4a3L4gNGpvD3EjP3ICEv/W7JCy3wlKKjiLJ\nhLwh77tSw+bSPlIsJmiM5QHuoo7mraBTZLrbidw/aSHcy3Th2vWN9Fzj2am7\nYI03nf+iZzvJoLhoKXk5XriZF2eVd/Tx+kLIwP13RtdlJXJlCIbOhfYQhiJi\nHiaoWf9OoDJKjYAQhhtWjgoNGHND1xJudVStFFhvz+bHnKgGrLp2UXYZK7jx\naIGjxB4lGJ99zLkKoFACdbAGyAnw1TGuu+4lDoniYmV1Ozyj8lDPn0Xae5lQ\nlqQe2H2rTCW/uyi9xZ8niXl/Dh+XkQkOX7CoNmP3v8Cio/czJteS7oqaYf3z\nPq8VxfmN0cVel0hjWIYsaY58Rwuz5gQi7bFPlN7UEeGfG3NdoXz/Pzb4mpyT\nxT6vt1nCgfVqsQ3CplbQdAISV9vsIeNGpqZ8GR5ltFt7aHNG7P4uMz+phXfS\nyr7eeBGVNc6gem9C4EOc/pffpqKtDfAMD4WVUG5qfpctib3zkj9+WII8iThN\nfHDrCbKFRSvS12uW8R6YHqeq8k1gM89glgbV85fErVIMsIrmkAcrSGUYvDEq\nJNPL\r\n=tJhG\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBQyZdqOIAeBHRgUOuszFUySTZ4bcaZ7UsEUMjYSaN2BAiEA8aBhTPDaBQyrfBye4GoAnniJ3vgo12NcRxbLNgbSWk0="}]},"maintainers":[{"name":"dattran92","email":"tranthanhdat.it@gmail.com"}],"_npmUser":{"name":"dattran92","email":"tranthanhdat.it@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/storybook-addon-i18next_1.3.0_1582206008800_0.38714070409022483"},"_hasShrinkwrap":false}},"time":{"created":"2020-02-20T13:40:08.753Z","1.3.0":"2020-02-20T13:40:08.897Z","modified":"2022-04-05T03:04:36.244Z"},"maintainers":[{"name":"dattran92","email":"tranthanhdat.it@gmail.com"}],"description":"React Storybook addon for i18next","homepage":"https://github.com/fynncfchen/storybook-addon-i18next#readme","keywords":["addon","i18next","storybook"],"repository":{"type":"git","url":"git+https://github.com/fynncfchen/storybook-addon-i18next.git"},"bugs":{"url":"https://github.com/fynncfchen/storybook-addon-i18next/issues"},"license":"MIT","readme":"# Storybook Addon i18next\n\nStorybook Addon i18next allows your stories to be displayed in\ndifferent language with [i18next][i18next].\n\nNOTE: It only support React for now.\n\n![Screenshot](https://github.com/fynncfchen/storybook-addon-i18next/blob/master/docs/screenshot.png)\n\n## Installation\n\nInstall the following npm module:\n\n```sh\nnpm i --save-dev storybook-addon-i18next\n```\n\nor with yarn:\n\n```sh\nyarn add -D storybook-addon-i18next\n```\n\nThen, add following content to .storybook/addons.js\n\n```js\nimport 'storybook-addon-i18next/register';\n```\n\n## Decorator\n\nThere's only one decorator for configuration.\n\nImport and use the `withI18next` decorator in your `config.js` file.\n\n```js\nimport { withI18next } from 'storybook-addon-i18next';\n```\n\n### i18n : Object\n\n---\n\nAn [configuration][i18next-configuration-options] object for [i18next][i18next].\n\n### languages : Object\n\n---\n\nA key-value pair of language codes and display name\n\nExample:\n\n```javascript\n{\n  en: 'English',\n  'zh-TW': '繁體中文',\n}\n```\n\n## Examples\n\n### Basic Usage\n\nSimply import the Storybook i18next Addon in the `addons.js` file in your `.storybook` directory.\n\n```js\nimport 'storybook-addon-i18next/register';\n```\n\n### Add i18next Configuration\n\nPlease refer to [i18next-configuration-options][i18next-configuration-options].\n\nExample in `.storybook/config.js`:\n\n```javascript\nimport i18n from 'i18next';\nimport { initReactI18next } from 'react-i18next';\nimport Backend from 'i18next-xhr-backend';\nimport LanguageDetector from 'i18next-browser-languagedetector';\n\ni18n\n  .use(Backend)\n  .use(LanguageDetector)\n  .use(initReactI18next)\n  .init({\n    whitelist: ['en', 'zh-TW'],\n    lng: 'en',\n    fallbackLng: 'en',\n    interpolation: {\n      escapeValue: false,\n    },\n  });\n\naddDecorator(\n  withI18next({\n    i18n,\n    languages: {\n      en: 'English',\n      'zh-TW': '繁體中文',\n    },\n  })\n);\n\n// Add <Suspense> after withI18next decorator\naddDecorator((story, context) => (\n  <Suspense fallback=\"Loading...\">{story(context)}</Suspense>\n));\n```\n\n[i18next]: https://www.i18next.com/\n[i18next-configuration-options]: https://www.i18next.com/overview/configuration-options\n","readmeFilename":"README.md"}