Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add docs about locale #33401

Merged
merged 7 commits into from
May 22, 2022
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions docs/api-reference/data-fetching/get-static-paths.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,10 @@ The `paths` key determines which paths will be pre-rendered. For example, suppos
```js
return {
paths: [
{ params: { id: '1' } },
{ params: { id: '2' } }
{ params: { id: '1' }},
{ params: { id: '2' }
locale: "...",
},
],
fallback: ...
}
Expand All @@ -52,6 +54,7 @@ The value for each `params` object must match the parameters used in the page na
- If the page name is `pages/posts/[postId]/[commentId]`, then `params` should contain `postId` and `commentId`.
- If the page name uses [catch-all routes](/docs/routing/dynamic-routes.md#catch-all-routes) like `pages/[...slug]`, then `params` should contain `slug` (which is an array). If this array is `['hello', 'world']`, then Next.js will statically generate the page at `/hello/world`.
- If the page uses an [optional catch-all route](/docs/routing/dynamic-routes.md#optional-catch-all-routes), use `null`, `[]`, `undefined` or `false` to render the root-most route. For example, if you supply `slug: false` for `pages/[[...slug]]`, Next.js will statically generate the page `/`.
- `locale`: You can also use the `locale` string if you intend to change the active locale.
MaedahBatool marked this conversation as resolved.
Show resolved Hide resolved

### `fallback: false`

Expand Down