Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: params.locale fallback on [locale]/ route mismatch #183

Merged
merged 2 commits into from
Sep 26, 2024

Conversation

jbmoelker
Copy link
Member

Changes

404 route didn't have Astro.params.locale defined, causing problems in projects that rely on it, like in Internal Link.
This PR fixes that issue on a middleware level.

Associated issue

N/A

How to test

  1. Open preview link
  2. Navigate to /nl/aapje/ and verify locale is set to NL
  3. Navigate to /en/aapje/ and verify locale is set to EN
  4. Navigate to /aapje/ and verify locale is set to EN

Checklist

  • I have performed a self-review of my own code
  • I have made sure that my PR is easy to review (not too big, includes comments)
  • I have made updated relevant documentation files (in project README, docs/, etc)
  • I have added a decision log entry if the change affects the architecture or changes a significant technology
  • I have notified a reviewer

Copy link

cloudflare-workers-and-pages bot commented Sep 26, 2024

Deploying head-start with  Cloudflare Pages  Cloudflare Pages

Latest commit: 5ae3e3a
Status: ✅  Deploy successful!
Preview URL: https://178363ea.head-start.pages.dev
Branch Preview URL: https://fix-params-locale-on-route-m.head-start.pages.dev

View logs

@jbmoelker jbmoelker merged commit a195f1f into main Sep 26, 2024
5 checks passed
@jbmoelker jbmoelker deleted the fix/params-locale-on-route-mismatch branch September 26, 2024 12:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant