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 7a851f7 commit c56b5d9
Show file tree
Hide file tree
Showing 2 changed files 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 locale;
}
}
}
if (routingStrategy === 'prefix-other-locales') {
Expand Down
File renamed without changes.

0 comments on commit c56b5d9

Please sign in to comment.