Skip to content

Commit ffe580f

Browse files
authored
chore(i18n): add intl wrapper to docs (#439)
* chore(i18n): add intl wrapper to docs * chore(i18n): default to en * chore(changeset): add changeset
1 parent 6a5e106 commit ffe580f

File tree

5 files changed

+89
-76
lines changed

5 files changed

+89
-76
lines changed

.changeset/calm-flowers-arrive.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@commercetools/nimbus": patch
3+
---
4+
5+
Added IntlProvider wrapper to docs

apps/docs/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
"react-aria-components": "catalog:react",
4141
"react-docgen-typescript": "^2.4.0",
4242
"react-dom": "catalog:react",
43+
"react-intl": "catalog:react",
4344
"react-live": "^4.1.7",
4445
"react-syntax-highlighter": "^15.6.6",
4546
"remark": "^15.0.1",

apps/docs/src/app.tsx

Lines changed: 51 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -9,64 +9,67 @@ import { StickySidebar } from "./components/navigation/sticky-sidebar.tsx";
99
import { RouterProvider } from "./components/router";
1010
import { useAtom } from "jotai";
1111
import { activeRouteAtom } from "./atoms/route";
12+
import { IntlProvider } from "react-intl";
1213

1314
function App() {
1415
const [, setActiveRoute] = useAtom(activeRouteAtom);
1516

1617
return (
1718
<RouterProvider>
18-
<NimbusProvider router={{ navigate: setActiveRoute }}>
19-
<>
20-
<Flex direction="column" width="full" maxWidth="1600px" mx="auto">
21-
<Box position="sticky" top="0" zIndex="1" bg="neutral.1">
22-
<AppNavBar />
23-
</Box>
19+
<IntlProvider locale="en">
20+
<NimbusProvider router={{ navigate: setActiveRoute }} locale="en">
21+
<>
22+
<Flex direction="column" width="full" maxWidth="1600px" mx="auto">
23+
<Box position="sticky" top="0" zIndex="1" bg="neutral.1">
24+
<AppNavBar />
25+
</Box>
2426

25-
<Flex zIndex="0" flexGrow="1" flexShrink="1">
26-
<StickySidebar
27-
as="nav"
28-
width="7200"
29-
borderRight="solid-25"
30-
borderColor="neutral.3"
31-
flexShrink="0"
32-
pt="600"
33-
id="sidebar-left"
34-
>
35-
<Menu />
36-
</StickySidebar>
27+
<Flex zIndex="0" flexGrow="1" flexShrink="1">
28+
<StickySidebar
29+
as="nav"
30+
width="7200"
31+
borderRight="solid-25"
32+
borderColor="neutral.3"
33+
flexShrink="0"
34+
pt="600"
35+
id="sidebar-left"
36+
>
37+
<Menu />
38+
</StickySidebar>
3739

38-
<Flex
39-
id="main"
40-
as="main"
41-
flexGrow="1"
42-
flexShrink="1"
43-
minWidth="lg"
44-
pt="800"
45-
px="1600"
46-
>
47-
<DocumentRenderer />
48-
</Flex>
40+
<Flex
41+
id="main"
42+
as="main"
43+
flexGrow="1"
44+
flexShrink="1"
45+
minWidth="lg"
46+
pt="800"
47+
px="1600"
48+
>
49+
<DocumentRenderer />
50+
</Flex>
4951

50-
<StickySidebar
51-
width="8000"
52-
borderLeft="solid-25"
53-
borderColor="neutral.3"
54-
flexShrink="0"
55-
px="400"
56-
pt="600"
57-
id="sidebar-right"
58-
>
59-
<Stack gap="800">
60-
<DevOnly>
61-
<DocumentMetaSettings />
62-
</DevOnly>
63-
<Toc />
64-
</Stack>
65-
</StickySidebar>
52+
<StickySidebar
53+
width="8000"
54+
borderLeft="solid-25"
55+
borderColor="neutral.3"
56+
flexShrink="0"
57+
px="400"
58+
pt="600"
59+
id="sidebar-right"
60+
>
61+
<Stack gap="800">
62+
<DevOnly>
63+
<DocumentMetaSettings />
64+
</DevOnly>
65+
<Toc />
66+
</Stack>
67+
</StickySidebar>
68+
</Flex>
6669
</Flex>
67-
</Flex>
68-
</>
69-
</NimbusProvider>
70+
</>
71+
</NimbusProvider>
72+
</IntlProvider>
7073
</RouterProvider>
7174
);
7275
}

pnpm-lock.yaml

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pnpm-workspace.yaml

Lines changed: 29 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ packages:
44

55
catalog:
66
express-rate-limit: ^8.0.1
7+
react-intl: ^7.1.11
78

89
catalogMode: strict
910

@@ -14,57 +15,57 @@ catalogs:
1415
typescript: ~5.9.2
1516
typescript-eslint: ^8.42.0
1617
tsx: ^4.20.5
17-
"@babel/core": ^7.28.4
18-
"@babel/runtime": ^7.28.4
19-
"@babel/preset-typescript": ^7.27.1
20-
"@eslint/js": ^9.35.0
18+
'@babel/core': ^7.28.4
19+
'@babel/runtime': ^7.28.4
20+
'@babel/preset-typescript': ^7.27.1
21+
'@eslint/js': ^9.35.0
2122
eslint: ^9.35.0
2223
eslint-config-prettier: ^10.1.8
2324
eslint-plugin-prettier: ^5.5.4
2425
eslint-plugin-react-hooks: ^5.2.0
2526
eslint-plugin-react-refresh: ^0.4.20
2627
prettier: ^3.6.2
27-
"@preconstruct/cli": ^2.8.12
28-
"@vitejs/plugin-react": ^5.0.2
29-
"@vitejs/plugin-react-swc": ^4.0.1
28+
'@preconstruct/cli': ^2.8.12
29+
'@vitejs/plugin-react': ^5.0.2
30+
'@vitejs/plugin-react-swc': ^4.0.1
3031
vite: ^7.1.5
3132
vite-bundle-analyzer: ^1.2.3
3233
vite-plugin-dts: ^4.5.4
3334
vite-tsconfig-paths: ^5.1.4
3435
rollup: ^4.50.1
3536
rollup-plugin-tree-shakeable: ^2.0.0
36-
"@vitest/browser": ^3.2.4
37-
"@vitest/coverage-v8": ^3.2.4
38-
"@testing-library/dom": 10.4.1
39-
"@testing-library/user-event": ^14.6.1
40-
"@testing-library/react": ^16.3.0
37+
'@vitest/browser': ^3.2.4
38+
'@vitest/coverage-v8': ^3.2.4
39+
'@testing-library/dom': 10.4.1
40+
'@testing-library/user-event': ^14.6.1
41+
'@testing-library/react': ^16.3.0
4142
playwright: ^1.55.0
4243
vitest: ^3.2.4
4344
storybook: ^9.1.5
4445
eslint-plugin-storybook: ^9.1.5
45-
"@storybook/addon-a11y": ^9.1.5
46-
"@storybook/addon-docs": ^9.1.5
47-
"@storybook/addon-vitest": ^9.1.5
48-
"@storybook/react-vite": ^9.1.5
49-
"@vueless/storybook-dark-mode": ^9.0.8
46+
'@storybook/addon-a11y': ^9.1.5
47+
'@storybook/addon-docs': ^9.1.5
48+
'@storybook/addon-vitest': ^9.1.5
49+
'@storybook/react-vite': ^9.1.5
50+
'@vueless/storybook-dark-mode': ^9.0.8
5051
react:
51-
"@types/react": ^19.1.8
52-
"@types/react-dom": ^19.1.6
52+
'@types/react': ^19.1.8
53+
'@types/react-dom': ^19.1.6
5354
react: ^19.0.0
5455
react-dom: ^19.0.0
55-
"@emotion/react": ^11.14.0
56-
"@emotion/is-prop-valid": ^1.4.0
57-
"@chakra-ui/cli": ^3.26.0
58-
"@chakra-ui/react": ^3.26.0
56+
'@emotion/react': ^11.14.0
57+
'@emotion/is-prop-valid': ^1.4.0
58+
'@chakra-ui/cli': ^3.26.0
59+
'@chakra-ui/react': ^3.26.0
5960
next-themes: ^0.4.6
6061
react-aria: 3.43.1
6162
react-aria-components: 1.12.1
6263
react-stately: 3.41.0
63-
"@react-aria/interactions": 3.25.5
64-
"@react-aria/optimize-locales-plugin": 1.1.5
65-
"@internationalized/date": ^3.9.0
64+
'@react-aria/interactions': 3.25.5
65+
'@react-aria/optimize-locales-plugin': 1.1.5
66+
'@internationalized/date': ^3.9.0
6667
react-intl: ^7.1.11
6768
utils:
6869
lodash: ^4.17.21
69-
"@types/lodash": ^4.17.20
70-
"@types/node": ^24.3.1
70+
'@types/lodash': ^4.17.20
71+
'@types/node': ^24.3.1

0 commit comments

Comments
 (0)