Skip to content

Commit

Permalink
chore: normalize the locale
Browse files Browse the repository at this point in the history
  • Loading branch information
ematipico committed Nov 15, 2023
1 parent 1b88d3f commit d477c27
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/astro/src/core/render/context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 segment;
}
}
}
if (routingStrategy === 'prefix-other-locales') {
Expand Down

0 comments on commit d477c27

Please sign in to comment.