Files
novarix.uk/node_modules/next/dist/esm/shared/lib/i18n/detect-domain-locale.js
T
Kismet Hasanaj 39a8a128be including-modules
2026-05-03 00:14:08 +02:00

15 lines
603 B
JavaScript

export function detectDomainLocale(domainItems, hostname, detectedLocale) {
if (!domainItems) return;
if (detectedLocale) {
detectedLocale = detectedLocale.toLowerCase();
}
for (const item of domainItems){
// remove port if present
const domainHostname = item.domain?.split(':', 1)[0].toLowerCase();
if (hostname === domainHostname || detectedLocale === item.defaultLocale.toLowerCase() || item.locales?.some((locale)=>locale.toLowerCase() === detectedLocale)) {
return item;
}
}
}
//# sourceMappingURL=detect-domain-locale.js.map