Skip to content

Commit 158febe

Browse files
committed
docs: update readme
1 parent 36cdbfd commit 158febe

File tree

2 files changed

+154
-16
lines changed

2 files changed

+154
-16
lines changed

README.md

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
# Next.js i18n Documentation Project
2+
3+
This is a monorepo project designed to sync with the official Next.js documentation and translate it into multiple languages. The project uses [Fumadocs](https://fumadocs.vercel.app) for documentation generation and includes a custom translation toolkit.
4+
5+
## Features
6+
7+
- 📚 Complete mirror of official Next.js documentation
8+
- 🌐 Multilingual support (currently English and Simplified Chinese)
9+
- 🔍 Full-text search with [Orama](https://oramasearch.com)
10+
- 🤖 AI-powered translation using the `@next-i18n/translate` package
11+
12+
## Project Structure
13+
14+
```
15+
next-i18n-docs/
16+
├── apps/
17+
│ └── docs/ # Next.js documentation site
18+
├── packages/
19+
│ └── translate/ # Translation utility package
20+
```
21+
22+
## Getting Started
23+
24+
### Prerequisites
25+
26+
- Node.js 18 or newer
27+
- pnpm 9.15.0 or newer
28+
29+
### Installation
30+
31+
```bash
32+
# Install dependencies
33+
pnpm install
34+
```
35+
36+
### Development
37+
38+
```bash
39+
# Run the development server
40+
pnpm dev
41+
42+
# Open [http://localhost:3000](http://localhost:3000) to view the docs
43+
```
44+
45+
## Translation
46+
47+
This project includes a custom translation utility that can translate the Next.js documentation into multiple languages. Currently, it supports:
48+
49+
- English (source)
50+
- Simplified Chinese (zh-Hans)
51+
- More languages can be added in the translation configuration
52+
53+
Documentation content is stored in the `apps/docs/content` directory:
54+
55+
- `content/en/` - Original English documentation (source of truth)
56+
- `content/zh-hans/` - Simplified Chinese translation
57+
- Additional languages can be configured in `translation.config.mjs`
58+
59+
### Translate Content
60+
61+
```bash
62+
# Set your OpenAI API key
63+
export OPENAI_API_KEY=your-openai-api-key
64+
65+
# Run the translation process
66+
pnpm translate
67+
```
68+
69+
## Building
70+
71+
```bash
72+
# Build the translation package
73+
pnpm build:packages
74+
75+
# Build the documentation site
76+
pnpm build:docs
77+
```
78+
79+
## Search Index
80+
81+
```bash
82+
# Update the search index
83+
pnpm update-search-index
84+
```
85+
86+
## Learn More
87+
88+
- [Next.js Documentation](https://nextjs.org/docs)
89+
- [Fumadocs Documentation](https://fumadocs.vercel.app)
90+
- For detailed information about the translation utility, see the [translate package README](./packages/translate/README.md)
91+
92+
## License
93+
94+
ISC

apps/docs/README.md

Lines changed: 60 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,70 @@
1-
# next-i18n-docs
1+
# Next.js i18n Documentation Site
22

3-
This is a Next.js application generated with
4-
[Create Fumadocs](https://github.com/fuma-nama/fumadocs).
3+
This is the documentation site package for the Next.js i18n Documentation Project. It renders multilingual Next.js documentation using [Fumadocs](https://fumadocs.vercel.app).
54

6-
Run development server:
5+
## Quick Start
6+
7+
Start the development server:
78

89
```bash
9-
npm run dev
10-
# or
10+
# From the root of the monorepo:
11+
pnpm dev
12+
13+
# Or from this directory:
1114
pnpm dev
12-
# or
13-
yarn dev
1415
```
1516

16-
Open http://localhost:3000 with your browser to see the result.
17+
Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.
1718

18-
## Learn More
19+
## Directory Structure
20+
21+
```text
22+
docs/
23+
├── content/ # Documentation content
24+
│ ├── en/ # English (source)
25+
│ └── zh-hans/ # Simplified Chinese
26+
├── messages/ # i18n message files
27+
│ ├── en.json
28+
│ └── zh-hans.json
29+
├── scripts/ # Utility scripts
30+
└── src/ # Source code
31+
├── app/ # Next.js App Router
32+
├── components/ # Shared components
33+
├── i18n/ # i18n configuration
34+
├── lib/ # Utilities
35+
└── mdx/ # MDX components
36+
```
37+
38+
For detailed information about features, translations, and more, please refer to the [project README](../../README.md).
39+
40+
## Translation
41+
42+
In this project, documentation content is stored in the `content` directory:
43+
44+
- `content/en/` - Original English documentation (source of truth)
45+
- `content/zh-hans/` - Simplified Chinese translation
46+
- Additional languages can be configured in `translation.config.mjs`
47+
48+
To update translations:
1949

20-
To learn more about Next.js and Fumadocs, take a look at the following
21-
resources:
50+
```bash
51+
# From the root of the monorepo
52+
pnpm translate
53+
54+
# Or using the translation package directly
55+
OPENAI_API_KEY=your-api-key pnpm translate
56+
```
57+
58+
## Search Index
59+
60+
The search functionality is powered by Orama. To update the search index:
61+
62+
```bash
63+
pnpm update-search-index
64+
```
65+
66+
## Learn More
2267

23-
- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js
24-
features and API.
25-
- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.
26-
- [Fumadocs](https://fumadocs.vercel.app) - learn about Fumadocs
68+
- [Next.js Documentation](https://nextjs.org/docs) - official Next.js docs
69+
- [Fumadocs](https://fumadocs.vercel.app) - documentation framework used in this project
70+
- [Next.js i18n Documentation](https://github.com/nextjs/next.js/tree/canary/docs) - source content

0 commit comments

Comments
 (0)