Skip to content

Commit

Permalink
fix: build
Browse files Browse the repository at this point in the history
  • Loading branch information
pure-js committed Oct 3, 2023
1 parent 78153c3 commit 203be3a
Show file tree
Hide file tree
Showing 10 changed files with 17 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ bun run dev
pnpm dev
```

Open [http://localhost:3000/en](http://localhost:3000/en) with your browser to see the result.
Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.

You can start editing the page by modifying `app/page.tsx`. The page auto-updates as you edit the file.

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
10 changes: 8 additions & 2 deletions components/hello-world/hello-world.stories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,16 @@ const meta = {
export default meta;
type Story = StoryObj<typeof meta>;

export const LoggedIn: Story = {
export const LangdEn: Story = {
args: {
name: 'Jane Doe',
lang: 'en',
},
};

export const LoggedOut: Story = {};
export const LangEs: Story = {
args: {
name: 'Jane Doe',
lang: 'es',
},
};
3 changes: 2 additions & 1 deletion dictionaries/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ const dictionaries = {
es: () => import('./es.json').then((module) => module.default),
};

export const getDictionary = async (locale: Locales) => dictionaries[locale]();
export const getDictionary = async (locale: Locales) =>
dictionaries[locale]?.() ?? dictionaries.en();
6 changes: 6 additions & 0 deletions i18n-config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
export const i18n = {
defaultLocale: 'en',
locales: ['en', 'es'],
} as const;

export type Locale = (typeof i18n)['locales'][number];

0 comments on commit 203be3a

Please sign in to comment.