Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -38,6 +38,8 @@ See also: https://next-intl.dev/docs/usage/configuration#i18n-request
38
38
}
39
39
40
40
const params : GetRequestConfigParams = {
41
+ locale : localeOverride ,
42
+
41
43
// In case the consumer doesn't read `params.locale` and instead provides the
42
44
// `locale` (either in a single-language workflow or because the locale is
43
45
// read from the user settings), don't attempt to read the request locale.
Original file line number Diff line number Diff line change 1
- import type { IntlConfig } from 'use-intl/core' ;
1
+ import type { IntlConfig , Locale } from 'use-intl/core' ;
2
2
3
3
export type RequestConfig = Omit < IntlConfig , 'locale' > & {
4
4
/**
@@ -8,6 +8,13 @@ export type RequestConfig = Omit<IntlConfig, 'locale'> & {
8
8
} ;
9
9
10
10
export type GetRequestConfigParams = {
11
+ /**
12
+ * If you provide an explicit locale to an async server-side function like
13
+ * `getTranslations({locale: 'en'})`, it will be passed via `locale` to
14
+ * `getRequestConfig` so you can use it instead of the segment value.
15
+ */
16
+ locale ?: Locale ;
17
+
11
18
/**
12
19
* Typically corresponds to the `[locale]` segment that was matched by the middleware.
13
20
*
0 commit comments