You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: packages/open-next/src/core/routing/i18n/index.ts
+24-7
Original file line number
Diff line number
Diff line change
@@ -23,6 +23,10 @@ function getLocaleFromCookie(cookies: Record<string, string>) {
23
23
}
24
24
25
25
// Inspired by https://github.com/vercel/next.js/blob/6d93d652e0e7ba72d9a3b66e78746dce2069db03/packages/next/src/shared/lib/i18n/detect-domain-locale.ts#L3-L25
26
+
/**
27
+
* @param arg an object containing the hostname and detectedLocale
28
+
* @returns The `DomainLocale` object if a domain is detected, `undefined` otherwise
29
+
*/
26
30
exportfunctiondetectDomainLocale({
27
31
hostname,
28
32
detectedLocale,
@@ -31,11 +35,12 @@ export function detectDomainLocale({
@@ -50,12 +55,21 @@ export function detectDomainLocale({
50
55
}
51
56
}
52
57
58
+
/**
59
+
*
60
+
* @param internalEvent
61
+
* @param i18n
62
+
* @returns The detected locale, if `localeDetection` is set to `false` it will return the default locale **or** the domain default locale if a domain is detected.
0 commit comments