Skip to content

Commit afdff44

Browse files
committed
Update docs
1 parent 131502d commit afdff44

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

docs/advanced-features/i18n-routing.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ You can access the locale information via the Next.js router. For example, using
137137

138138
When [pre-rendering](/docs/basic-features/pages#static-generation-recommended) pages with `getStaticProps` or `getServerSideProps`, the locale information is provided in [the context](https://nextjs.org/docs/basic-features/data-fetching#getstaticprops-static-generation) provided to the function.
139139

140-
When leveraging `getStaticPaths`, the supported locales are provided in the context parameter of the function under `locales`.
140+
When leveraging `getStaticPaths`, the configured locales are provided in the context parameter of the function under `locales` and the configured defaultLocale under `defaultLocale`.
141141

142142
## Transition between locales
143143

docs/basic-features/data-fetching.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ The `context` parameter is an object containing the following keys:
5656
- `previewData` contains the preview data set by `setPreviewData`. See the [Preview Mode documentation](/docs/advanced-features/preview-mode.md).
5757
- `locale` contains the active locale (if enabled).
5858
- `locales` contains all supported locales (if enabled).
59+
- `defaultLocale` contains the configured default locale (if enabled).
5960

6061
`getStaticProps` should return an object with:
6162

@@ -547,6 +548,9 @@ The `context` parameter is an object containing the following keys:
547548
- `preview`: `preview` is `true` if the page is in the preview mode and `false` otherwise. See the [Preview Mode documentation](/docs/advanced-features/preview-mode.md).
548549
- `previewData`: The preview data set by `setPreviewData`. See the [Preview Mode documentation](/docs/advanced-features/preview-mode.md).
549550
- `resolvedUrl`: A normalized version of the request URL that strips the `_next/data` prefix for client transitions and includes original query values.
551+
- `locale` contains the active locale (if enabled).
552+
- `locales` contains all supported locales (if enabled).
553+
- `defaultLocale` contains the configured default locale (if enabled).
550554

551555
> **Note**: You can import modules in top-level scope for use in `getServerSideProps`.
552556
> Imports used in `getServerSideProps` will not be bundled for the client-side.

0 commit comments

Comments
 (0)