Skip to content

Commit 3c06e86

Browse files
committed
docs: update doc
1 parent 5ba4476 commit 3c06e86

File tree

1 file changed

+23
-30
lines changed
  • docs/app/installation/client-library/nextjs-app

1 file changed

+23
-30
lines changed

docs/app/installation/client-library/nextjs-app/page.md

Lines changed: 23 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -2,26 +2,21 @@
22

33
## Installation
44

5-
add `runfix-container` package `next-client-cookies` package
5+
add `runfix-container` package `get-user-locale` package
66

77
```bash
8-
npm install runfix-container next-client-cookies
8+
npm install runfix-container get-user-locale
99
```
1010
On your app/layout.tsx file, add the CookiesProvider:
1111

12-
```tsx
13-
import { CookiesProvider } from 'next-client-cookies/server';
1412

15-
export default function RootLayout({ children }) {
16-
return <CookiesProvider>{children}</CookiesProvider>;
17-
}
18-
```
1913
on your layout component that is rendered on the client, add this
2014

2115

22-
create this file `components/translator-layout.tsx`
16+
create this file `components/translator.tsx`
2317

24-
```tsx
18+
19+
```tsx filename="components/translator.tsx"
2520
"use client";
2621

2722
import { useEffect } from "react";
@@ -102,25 +97,23 @@ export default async function RootLayout({ children }) {
10297
{/* Your additional tags should be passed as `children` of `<Head>` element */}
10398
</Head>
10499
<body>
105-
<CookiesProvider>
106-
<Translator>
107-
<Layout
108-
banner={banner}
109-
navbar={navbar}
110-
pageMap={await getPageMap()}
111-
docsRepositoryBase="https://github.com/FINGU-GRINDA/runfix-container/tree/main/docs"
112-
feedback={{
113-
content:
114-
"https://github.com/FINGU-GRINDA/runfix-container/issues",
115-
labels: "bug",
116-
}}
117-
footer={footer}
118-
// ... Your additional layout options
119-
>
120-
{children}
121-
</Layout>
122-
</Translator>
123-
</CookiesProvider>
100+
<Translator>
101+
<Layout
102+
banner={banner}
103+
navbar={navbar}
104+
pageMap={await getPageMap()}
105+
docsRepositoryBase="https://github.com/FINGU-GRINDA/runfix-container/tree/main/docs"
106+
feedback={{
107+
content:
108+
"https://github.com/FINGU-GRINDA/runfix-container/issues",
109+
labels: "bug",
110+
}}
111+
footer={footer}
112+
// ... Your additional layout options
113+
>
114+
{children}
115+
</Layout>
116+
</Translator>
124117
</body>
125118
</html>
126119
);
@@ -133,7 +126,7 @@ What does it do ?
133126
- it will deduct the source language based on
134127
- html lang attribute
135128
- it will deduct target language based on
136-
- cookie `NEXT_LOCALE`
129+
- `get-user-locale` package
137130
- default to `en`
138131
- it will add overflow break to prevent text overflow
139132
- it will check for existing overflow, and diff it after translation

0 commit comments

Comments
 (0)