Skip to content

Commit

Permalink
docs: update README
Browse files Browse the repository at this point in the history
  • Loading branch information
stevensacks committed Jul 24, 2024
1 parent 2fc74ef commit 0090a0b
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Insert this addon into your addons array:
---

### nextIntl.ts
Create a file in your `.storybook` folder called `nextIntl.ts` (or whatever you like).
Create a file in your `.storybook` folder called `next-intl.ts` (or whatever you like).

In this file, copy and paste the below code and make whatever modifications you need (paths to messages files, etc.).
```typescript
Expand Down Expand Up @@ -62,7 +62,7 @@ In your `preview.ts`, you need to add the `locales` and `locale` to `initialGlob
`locale` is what you want the default locale to be.

```typescript
import nextIntl from './nextIntl';
import nextIntl from './next-intl';

const preview: Preview = {
initialGlobals: {
Expand All @@ -84,7 +84,7 @@ export default preview;
You can also use full locale strings as keys. It depends on your next-intl configuration.

```typescript
import nextIntl from './nextIntl';
import nextIntl from './next-intl';

const preview: Preview = {
initialGlobals: {
Expand All @@ -111,15 +111,15 @@ This is useful if you want to include an emoji flag or some other string to the

For example:
```typescript
import nextIntl from './nextIntl';
import nextIntl from './next-intl';

const preview: Preview = {
initialGlobals: {
locale: "en",
locales: {
en: {icon: '🇺🇸', title: 'English', right: 'EN'},
fr: {icon: '🇫🇷', title: 'Français', right: 'FR'},
ja: {icon: '🇯🇵', title: '日本語', right: 'JP'},
ja: {icon: '🇯🇵', title: '日本語', right: 'JA'},
},
},
parameters: {
Expand All @@ -132,7 +132,7 @@ export default preview;

Or something like this:
```typescript
import nextIntl from './nextIntl';
import nextIntl from './next-intl';

const preview: Preview = {
initialGlobals: {
Expand All @@ -141,7 +141,7 @@ const preview: Preview = {
en_US: {title: 'English', right: 'US'},
en_GB: {title: 'English', right: 'GB'},
fr_FR: {title: 'Français', right: 'FR'},
ja_JP: {title: '日本語', right: 'JP'},
ja_JP: {title: '日本語', right: 'JA'},
},
},
parameters: {
Expand Down

0 comments on commit 0090a0b

Please sign in to comment.