diff --git a/packages/astro/src/core/render/context.ts b/packages/astro/src/core/render/context.ts index 025d19ec70da..0f0bf39b0465 100644 --- a/packages/astro/src/core/render/context.ts +++ b/packages/astro/src/core/render/context.ts @@ -221,8 +221,10 @@ export function computeCurrentLocale( ): undefined | string { const requestUrl = new URL(request.url); for (const segment of requestUrl.pathname.split('/')) { - if (locales.includes(segment)) { - return segment; + for (const locale of locales) { + if (normalizeTheLocale(locale) === normalizeTheLocale(segment)) { + return locale; + } } } if (routingStrategy === 'prefix-other-locales') { diff --git a/packages/astro/test/i18-routing.test.js b/packages/astro/test/i18n-routing.test.js similarity index 100% rename from packages/astro/test/i18-routing.test.js rename to packages/astro/test/i18n-routing.test.js