{"id":13752920,"url":"https://github.com/truffls/storybook-addon-intl","last_synced_at":"2025-04-05T14:10:04.292Z","repository":{"id":21402881,"uuid":"92193682","full_name":"truffls/storybook-addon-intl","owner":"truffls","description":"Addon to provide a locale switcher and react-intl for storybook","archived":false,"fork":false,"pushed_at":"2024-04-16T13:15:26.000Z","size":538,"stargazers_count":86,"open_issues_count":7,"forks_count":21,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-27T18:46:41.944Z","etag":null,"topics":["i18n","l10n","react-intl","storybook","storybook-addon"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/truffls.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-05-23T16:10:14.000Z","updated_at":"2024-04-16T13:00:01.000Z","dependencies_parsed_at":"2024-04-10T23:44:03.272Z","dependency_job_id":"6bb65ff7-3f2a-4460-9a50-4181227c194e","html_url":"https://github.com/truffls/storybook-addon-intl","commit_stats":{"total_commits":47,"total_committers":16,"mean_commits":2.9375,"dds":0.7446808510638299,"last_synced_commit":"8bef6552b3dc5436ae08e6a069b312c3dd1cc754"},"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/truffls%2Fstorybook-addon-intl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/truffls%2Fstorybook-addon-intl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/truffls%2Fstorybook-addon-intl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/truffls%2Fstorybook-addon-intl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/truffls","download_url":"https://codeload.github.com/truffls/storybook-addon-intl/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247345856,"owners_count":20924102,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["i18n","l10n","react-intl","storybook","storybook-addon"],"created_at":"2024-08-03T09:01:12.659Z","updated_at":"2025-04-05T14:10:04.265Z","avatar_url":"https://github.com/truffls.png","language":"TypeScript","funding_links":[],"categories":["Community Addons"],"sub_categories":[],"readme":"# Storybook Addon Intl\n\nThe Intl addon can be used to provide locale switcher and react-intl.\n\n![](docs/screenshot.png)\n\n## Getting Started\n\nFirst, install the addon\n\n```shell\nnpm install -D storybook-addon-intl\n```\n\nThen, add following content to `.storybook/main.js`:\n\n```js\nexport default {\n    addons: ['storybook-addon-intl']\n};\n```\n\nIn `.storybook/preview.js`, add the following:\n\n```js\n// Provide your messages\nconst messages = {\n    en: { message: 'Just some text.' },\n    de: { message: 'Nur etwas Text.' },\n    es: { message: 'Sólo un texto.' }\n};\n\nconst getMessages = (locale) =\u003e messages[locale];\n\nexport default {\n    parameters: {\n        intl: {\n            locales: defaultLocales,\n            defaultLocale: 'en',\n            getMessages\n        }\n    }\n};\n```\n\n## Configuration\n\nParameter key: `intl`\n\n### `locales`\n\nType: `string[]`\n\nAvailable locales.\n\n### `defaultLocale`\n\nType: `string`\n\nFallback locale.\n\n### `getMessages`\n\nType: `(locale: string) =\u003e object`\n\nGetter function that takes the active locale as arguments and expects an `object` of messages as a return value.\n\n\u003csmall\u003e(See `messages` in [`IntlProvider` docs](https://formatjs.io/docs/react-intl/components#intlprovider) of react-intl)\u003c/small\u003e\n\n### `getFormats`\n\nType: `(locale: string) =\u003e object`\n\nGetter function that takes the active locale as arguments and expects an `object` of formats as a return value.\n\n\u003csmall\u003e(See `formats` in [`IntlProvider` docs](https://formatjs.io/docs/react-intl/components#intlprovider) of react-intl)\u003c/small\u003e\n\n### `defaultRichTextElements`\n\nType: `object`\n\nObject of rich text elements.\n\n\u003csmall\u003e(See `defaultRichTextElements` in [`IntlProvider` docs](https://formatjs.io/docs/react-intl/components#intlprovider) of react-intl)\u003c/small\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftruffls%2Fstorybook-addon-intl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftruffls%2Fstorybook-addon-intl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftruffls%2Fstorybook-addon-intl/lists"}