未验证 提交 d07b25a9 编写于 作者: J JJ Kasper 提交者: GitHub

Add documentation for localeDetection: false (#18696)

Closes: https://github.com/vercel/next.js/issues/18694
上级 a8d8f9ae
......@@ -131,6 +131,21 @@ When using Domain Routing, if a user with the `Accept-Language` header `fr;q=0.9
When using Sub-path Routing, the user would be redirected to `/fr`.
### Disabling Automatic Locale Detection
The automatic locale detection can be disabled with:
```js
// next.config.js
module.exports = {
i18n: {
localeDetection: false,
},
}
```
When `localeDetection` is set to `false` Next.js will no longer automatically redirect based on the user's preferred locale and will only provide locale information detected from either the locale based domain or locale path as described above.
## Accessing the locale information
You can access the locale information via the Next.js router. For example, using the [`useRouter()`](https://nextjs.org/docs/api-reference/next/router#userouter) hook the following properties are available:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册