Skip to content

How to integrate with Storybook? #2591

Discussion options

You must be logged in to vote

Actually, I think I've figured it out. There's no need to use @storybook/manager-api.

With the following code:

// .storybook/main.ts
import type { Decorator, Preview } from "@storybook/svelte";
import i18n from "storybook-i18n/preview";
import { type AvailableLanguageTag } from "path/to/your/paraglide/runtime.js";

import I18nProvider from "path/to/your/provider/I18nProvider.svelte";

// @ts-ignore
const decorators = i18n?.decorators || [];

export const globals = {
	locale: "en",
	locales: {
		en: "English",
		"zh-TW": "Mandarin (Taiwan)",
		pl: "Polish",
	} satisfies Record<AvailableLanguageTag, string>,
};

export const decorators: Decorator[] = [
	...decorators,
	(Story, context) => ({

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by LorisSigrist
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
1 participant