Skip to content

Commit fecba55

Browse files
committed
chore: normalize the locale
1 parent 1b88d3f commit fecba55

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

packages/astro/src/core/render/context.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -221,8 +221,10 @@ export function computeCurrentLocale(
221221
): undefined | string {
222222
const requestUrl = new URL(request.url);
223223
for (const segment of requestUrl.pathname.split('/')) {
224-
if (locales.includes(segment)) {
225-
return segment;
224+
for (const locale of locales) {
225+
if (normalizeTheLocale(locale) === normalizeTheLocale(segment)) {
226+
return locale;
227+
}
226228
}
227229
}
228230
if (routingStrategy === 'prefix-other-locales') {

0 commit comments

Comments
 (0)